Back to the 2025 paper

Module 2: x86 Architecture, CPU Control, I/O, Memory System Design

20257m

Explain addressing modes with examples. Compare at least five different addressing techniques.

Worked SolutionAI Assisted

Addressing Modes

Definition: The technique used to specify the operand address in an instruction is called addressing mode. It tells how Effective Address (EA) of operand is calculated.

5 Important Addressing Modes with Examples (assume 8-bit opcode + address field)

  1. Implied / Implicit Mode

    • Operand is implicit in opcode itself.
    • CLC (clear carry), STC, HALT
    • EA not needed. Size 1 byte, fast.
  2. Immediate Mode

    • Operand itself is in instruction.
    • MOV A, #30H ; ADD #5 → AC ← AC + 5
    • EA = PC+1 (operand field). Fast, no memory reference but limited range (00 to 224−12^{24}-1 for 24-bit field).
  3. Direct / Absolute Mode

    • Address field gives effective address directly.
    • LOAD A, [1000H] → AC ← M[1000H]
    • EA = Address field. Simple but needs 2424 bits to address 1616 MB only, one memory access.
  4. Indirect Mode

    • Address field contains address of address.
    • LOAD A, @2000H → AC ← M[M[2000H]]
    • EA = M[Address field]. Can address 2322^{32} via pointer but needs 2 memory accesses, slow.
  5. Register Mode

    • Operand in register.
    • ADD R1, R2 → R1 ← R1+R2 ; MOV A,B
    • EA = Register ID. Very fast, no memory, limited registers.
  6. Register Indirect Mode

    • Register holds address of operand.
    • LOAD A, (R1) where R1=2000H → AC ← M[R1]
    • EA = (R). Flexible for pointer/array traversal.
  7. Indexed / Base-Relative Mode (extra)

    • LOAD A, 1000H(X) → EA = X + 1000 where X is index register. Useful for arrays. EA = R + displacement.

Comparison Table (5+ modes)

Feature Immediate Direct Indirect Register Register Indirect Indexed
EA = operand A M[A] R M[R] R + disp
Memory refs 0 1 2 0 1 1
Speed Fastest Medium Slow Fastest Medium Medium
Address range Limited to field 224=162^{24}=16MB Full 2322^{32} 2k2^{k} regs Full Full
Use Constants Global var Pointers CPU ops Pointers/tables Arrays
Instruction size 1 word 1 word 1 word 1 word 1 word 1 word+disp
Example ADD #5 LD 1000H LD @1000H ADD R1,R2 LD (R1) LD 1000(X)

Effective Address Calculation summary:

  • Direct: EA=AEA = A
  • Immediate: Operand=AOperand = A
  • Indirect: EA=M[A]EA = M[A]
  • Register: EA=REA = R
  • Indexed: EA=R+AEA = R + A

Direct needs large field for address; indirect saves field but extra fetch; register fastest; indexed best for relocatable/array structures.

Similar questions

Budget AppAndroid App

Pocketly on Android

Log daily food, travel, and hostel expenses instantly. Set monthly spending limits and see where your money goes without complex spreadsheets.