- Asked 10/22
- 2079 Baisakh · 8 marks
- 2078 Kartik · 10 marks
- 2076 Chaitra · 2+6 marks
- 2076 Asoj · 8 marks
- 2074 Chaitra · 8 marks
- 2072 Kartik · 10 marks
- 2070 Chaitra · 10 marks
- 2070 Asar · 10 marks
- 2068 Chaitra · 10 marks
- 2068 Baisakh (old course) · 8 marks
Addressing modes with examples
Short answer
An addressing mode defines how the instruction's address field yields the effective address. Modes include immediate (fast, constant), register (short, limited), direct (simple), indirect (large space, slow), indexed (arrays), relative (position-independent), and base register (relocation), each trading speed for flexibility.
Define addressing mode. Explain the different types of addressing modes with examples, comparing them (advantages and disadvantages).
An addressing mode is the rule by which the address field of an instruction is interpreted to find the operand (the effective address, EA). Addressing modes let an instruction reach a large memory with a short address field, and they support pointers, loops, arrays and relocation.
Types with examples
| Mode | Operand location / EA | Example |
|---|---|---|
| Implied | Operand is implicit in the opcode | CMA (complement accumulator); ADD in a stack (zero-address) machine |
| Immediate | Operand is in the instruction | MVI B, 32H (B = 32H) |
| Register | Operand is in a register named in the instruction | MOV A, B |
| Register indirect | Register holds the address of the operand | LDAX B; MOV A, M; EA = (R) |
| Direct (absolute) | Address field is the EA | LDA 2000H; EA = 2000H |
| Indirect | Address field points to a word that holds the EA | LOAD @500; EA = M[500] |
| Autoincrement / autodecrement | Register is used as a pointer, then incremented/decremented | LOAD (R1)+ ; EA = (R1), R1 = R1 + 1 |
| Relative | EA = PC + address field | JR offset; EA = PC + offset |
| Indexed | EA = index register + address field | LOAD 100(X); EA = 100 + (X) |
| Base register | EA = base register + address field | LOAD 20(BR); EA = (BR) + 20 |
Worked values
Take address field = 500, R1 = 400, M[500] = 800, M[400] = 300, PC = 200 (the updated PC value), XR = 100.
- Immediate: operand = 500.
- Direct: EA = 500, operand = M[500] = 800.
- Indirect: EA = M[500] = 800, operand = M[800].
- Register indirect: EA = R1 = 400, operand = M[400] = 300.
- Relative: EA = 200 + 500 = 700.
- Indexed: EA = 500 + 100 = 600, operand = M[600].
Advantages and disadvantages
| Mode | Advantage | Disadvantage |
|---|---|---|
| Immediate | No memory access for the operand; fast | Operand range is small and is a constant |
| Register | Very fast, short field | Few registers |
| Direct | Simple; one memory access | Limited address space; fixed address |
| Indirect | Large address space; easy pointers | Two or more memory accesses; slow |
| Register indirect | Large space, only one access, short field | Extra instruction to set the register |
| Indexed | Efficient for arrays and loops | Extra addition; needs an index register |
| Relative | Position-independent code; short branches | Limited branch range |
| Base register | Easy relocation of programs | Extra addition and register |
| Implied | Shortest instruction | Only for fixed operands |
✓ Answer checked by Claude Opus 5.5 (high effort)
Related questions
- Addressing modes in given instructions · Computer Organization and Architecture, chapter 2
- LD instruction under addressing modes · Computer Organization and Architecture, chapter 2
- Addressing modes of 8086 · Microprocessor, chapter 3 · asked 2×
- Addressing modes of 8051 · Embedded System, chapter 9 · asked 4×
- Instruction and data format, addressing modes · Microprocessor, chapter 2 · asked 2×
- Features and addressing modes of 8085 · Microprocessor, chapter 2
All Computer Organization and Architecture chapter 2 questions →