Professional Documents
Culture Documents
04 Addressing Modes PDF
04 Addressing Modes PDF
1. Immediate (literal)
operand part of instruction
limited operand magnitude
useful for storing small constants
no address calculation; no memory reference
<ea> = none
memory
Addressing Modes
3. Indirect (memory deferred)
address of operand is in the memory location
whose address appears in the instruction
address retrieved from memory
<ea> = (A)
instruction
e.g. ADD (PTR),R1
memory
Addressing Modes
3. Indirect (memory deferred)
address space of 2**N if word length is N;
however, number of effective addresses is limited
to 2**K where K is the length of the address field
in the machine code
some machines allow multilevel or cascaded
indirect addressing
<ea> = (...(A)...)
e.g. Data General NOVA ... the first bit of the
operand is an indirect bit where 0 means the
operand is data and a 1 means the operand is an
address
Addressing Modes
4. Register Direct
operand is in a register whose number appears in
the instruction; small address field in instruction
address space is very limited (i.e. # of registers)
no address calculation; no memory reference
<ea> = R
MOV AX,0FFH
MOVWF NUM1
registers
Addressing Modes
5. Register Indirect (deferred)
address of operand is in a register whose number
appears in the instruction
large address space
<ea> = (R)
instruction
LFSR 0,LIST
MOVF INDF0,W
memory
registers
Addressing Modes
5. Register Indirect - Autoincrement/Autodecrement
register indirect addressing where the address in the
register is automatically incremented/decremented either
before or after effective address calculations
for postincrement/postdecrement
<ea> = (R) instruction
(R) <-- (R) ± 1
memory
registers
Addressing Modes
5. Register Indirect - Autoincrement/Autodecrement
for preincrement/predecrement
(R) <-- (R) ± 1
instruction
<ea> = (R)
memory
registers
Addressing Modes
6. Stack
a) address of operand is in the stack pointer
- variation of register indirect addressing
<ea> = (SP)
(b) Autoindexing
automatically increment/decrement the index register
before/after a data access
<ea> = A + (R)
(R) <-- (R) + 1