Instruction Sets: Addressing Modes and Formats
Instruction Sets: Addressing Modes and Formats
Immediate
Constant integer (8, 16, or 32 bits)
Constant value is stored within the instruction
Register
Name of a register is specified
Register number is encoded within the instruction
Memory
Reference to a location in memory
Memory address is encoded within the instruction, or
Register holds the address of a memory location
x86 Examples
mov count, [var]
Disadvantage
Address space is very limited.
x86 Examples
MOV EAX,EBX MOV CX,DX
x86 Example
MOV AL,[BX] MOV AX,[EBX]
MOV [EDI],EAX MOV [EAX],EDX
x86 Example
MOV AX, NAME[SI]
Example:ADD
Pop top two items from stack, add, place the
result on top of the stack