Addressing Modes
Dr. Lijo V P
SCOPE, VIT Vellore
Addressing Mode
• The Way the operands are specified in
the instruction
– Operands can be in registers, memory or
embedded in the instruction
• The operation to be performed is
indicated by the opcode.
Addressing Mode -
Classification
Implied Addressing Mode
Immediate Addressing Mode
Direct Addressing Mode
Indirect Addressing Mode
Register Direct Addressing Mode
Register Indirect Addressing Mode
Displacement or Indexed Addressing Mode
Base Relative Addressing Mode
Auto Increment and Auto Decrement
Addressing Mode
Implied Addressing Mode
• Operand is implied / specified
implicitly in the instruction
• Effective Address (EA) = AC or
Stack[SP]
• CMA, CLC, STC
Immediate Addressing
mode
• Operand embedded in the
instruction
• Used during initialization
• MVI A, 23h
• No memory reference to fetch data
• Fast
Direct Addressing mode
• Effective address is a part of the
instruction.
• MOV A, 3000h
• Single memory reference to access
data
• No additional calculations to work
out effective address
Indirect Addressing Mode
Diagram
Indirect Addressing mode
• The address field of the instruction
gives the address where the
effective address of the operand
stored in the memory.
• Ex: Move CX, [4200H]
• Multiple memory accesses to find
operand
• Hence slower
Register Direct Addressing
Diagram
Register Direct
• Operand is in the register specified
in the address part of the instruction
• EA = R
• Ex: Mov AX, BX
• Special case of direct addressing
• Faster register access.
• No memory access.
Register Indirect
Register Indirect
• Address part of the instruction
specifies the register which gives
the address of the operand in
memory.
• Special case of indirect addressing
• EA = (R)
• Ex: Mov BX, [DX]
Auto Increment and Auto
Decrement Addressing Modes
• Extension to Register indirect addressing
mode.
• Register incremented or decremented
after accessing memory
• Useful while transferring large chunks of
contiguous data.
• Add R1, (R2)+
– R1 R1+ m[R2]
– R2 R2 + d ; d is the size of an
element.
Displacement Addressing
Mode
EA = A + (R)
Add R4, 100(R1)
R4 R4+ M[R1+100]
Relative addressing mode
• It is often used in branch (conditional
and unconditional) instructions,
locality of reference and cache usage.
• Effective address =Address part of
the instruction + PC value after fetch
cycle
• JMP 24
Base register Addressing
mode
• Used to facilitate the relocation of
programs in memory.
• Uses Base register.
• EA = Address part of the instruction
+ base value.
• Only the register [base register] will
be updated to reflect the beginning
of a new memory segment.
Indexed Addressing mode
• Used in performing iterative operations
• Address field holds the starting address
of the data array.
• Index register hold the actual index of
the operand in the array.
• EA = starting address(address part of an
inst) + index register value
Basic Addressing Modes
Differences
Problems
• Find the effective address and the content of AC for
the given data.
Addressing Mode Effective Content of AC
Address
Direct Address 500 AC ← (500) 800
Immediate operand 201 AC ← 500 500
Indirect address 800 AC ← ((500)) 300
Relative address 702 AC ← (PC + 500) 325
Indexed address 600 AC ← (XR + 500) 900
Register - AC ← R1 400
Register Indirect 400 AC ← (R1) 700
Autoincrement 400 AC ← (R1)+ 700
Autodecrement 399 AC ← -(R1) 450
• An instruction is stored at location 300 with its address field
at location 301. The address field has the value 400. A
processor register R1 contains the number 200. Evaluate
the effective address if the addressing mode of the
instruction is (a) direct; (b) immediate (c) relative (d)
register indirect; (e) index with R1 as the index register.
• Let the address stored in the program counter be
designated by the symbol X1. The instruction stored in X1
has the address part (operand reference) X2. The operand
needed to execute the instruction is stored in the memory
word with address X3. An index register contains the value
X4. What is the relationship between these various
quantities if the addressing mode of the instruction is
• (a) direct (b) indirect (c) PC relative (d) indexed?
References
• W. Stallings, Computer
organization and architecture,
Prentice-Hall,2000
• M. M. Mano, Computer System
Architecture, Prentice-Hall