Skip to content

08 Addressing Modes

🧠 The 10-Mode Mnemonic

If Dhaka Is Really Raining, I Rather Always Stay Bed!
(Meaningful & Relatable: If it's pouring rain outside in Dhaka's traffic, the best decision is to just stay in bed!)

📋 The 10-Mode Breakdown

â€ĸ đŸŒ§ī¸ If → Immediate Mode
â€ĸ 🚗 Dhaka → Direct Mode
â€ĸ đŸŒ§ī¸ Is → Indirect Mode
â€ĸ đŸšĻ Really → Register Mode
â€ĸ â›ˆī¸ Raining, → Register Indirect Mode
â€ĸ 🛌 I → Indexed Mode
â€ĸ 😴 Rather → Relative Mode
â€ĸ 🛌 Always → Auto-increment/decrement Mode
â€ĸ 💤 Stay → Stack Mode
â€ĸ đŸ›ī¸ Bed! → Base Register Mode

The Complete 10-Mode Breakdown

  1. I → Immediate: The operand value is directly hardcoded into the instruction (e.g., MOV R1, #5).
  2. D → Direct (Absolute): The instruction gives the exact memory address of the data.
  3. I → Indirect: The instruction points to a memory address, which holds another address where the data is actually stored.
  4. R → Register: The operand is stored inside a CPU register rather than memory.
  5. R → Register Indirect: A CPU register holds the memory address of the data.
  6. I → Indexed: Calculates the final address by adding a constant offset to an index register.
  7. R → Relative (PC-Relative): The address is calculated as an offset relative to the Program Counter (used for jumps/branches).

✨ The 3 Added Modes:
8. A → Auto-Increment / Auto-Decrement: Similar to register indirect, but automatically changes the register pointer value after (or before) accessing the memory—great for stepping through arrays.
9. S → Stack: The operand is implicitly located at the top of the system stack (e.g., PUSH and POP operations).
10. B → Base Register (Implied/Displacement): The address is calculated by adding a displacement to a base register, allowing programs to relocate smoothly in memory.

Why the difference?

Different CPU architectures (like RISC vs. CISC) implement varying numbers of modes. While RISC architectures use fewer, simpler modes, comprehensive Computer Organization courses list all 10 unique configurations to cover everything from basic constants to complex data structure lookups.


Addressing Mode: ā§§ā§ĻāϟāĻŋāϰ Mnemonic

ā§§ā§ĻāϟāĻŋ Mode (āϏāĻŋāϰāĻŋāϝāĻŧāĻžāϞ)

  1. Implied
  2. Immediate
  3. Register
  4. Register Indirect
  5. Direct
  6. Indirect
  7. Relative
  8. Indexed
  9. Base Register
  10. Auto Increment/Decrement

Mnemonic (āĻĒā§āϰāĻĨāĻŽ āĻ…āĻ•ā§āώāϰ: I I R R D I R I B A)

"I Imagine Rabbits Run Down In Rainy Isolated Bushes, Always"

āĻ…āĻ•ā§āώāϰ Mode
I Implied
Imagine Immediate
Rabbits Register
Run Register indirect
Down Direct
In Indirect
Rainy Relative
Isolated Indexed
Bushes Base register
Always Auto inc/dec

āĻŦāĻžāĻ‚āϞāĻžāϝāĻŧ āĻŽāύ⧇ āϰāĻžāĻ–āĻžāϰ āϏāĻšāϜ āωāĻĒāĻžāϝāĻŧ: "Operand āϕ⧋āĻĨāĻžāϝāĻŧ āφāϛ⧇?"

āϧāĻžāĻĒ ā§§: Operand instruction-āĻāϰ āϭ⧇āϤāϰ⧇āχ (Memory āϞāĻžāϗ⧇ āύāĻž)
- Implied: Operand āĻŦāϞāĻžāϰ āĻĻāϰāĻ•āĻžāϰāχ āύ⧇āχ (āϝ⧇āĻŽāύ CLA, HLT)
- Immediate: Operand āύāĻŋāĻœā§‡āχ instruction-āĻ āφāϛ⧇ (MOV A, 5)

āϧāĻžāĻĒ ā§¨: Operand Register-āĻ
- Register: Register-āĻ āϏāϰāĻžāϏāϰāĻŋ āĻĄāĻžāϟāĻž (MOV A, B)
- Register Indirect: Register-āĻ āĻĄāĻžāϟāĻž āύ⧇āχ, āĻĄāĻžāϟāĻžāϰ address āφāϛ⧇ (MOV A, [BX])

āϧāĻžāĻĒ ā§Š: Operand Memory-āϤ⧇
- Direct: Instruction-āĻ memory address āĻĻ⧇āĻ“āϝāĻŧāĻž āφāϛ⧇ (LDA 2000H)
- Indirect: Address-āĻāϰ āϭ⧇āϤāϰ⧇ āφāϰ⧇āĻ•āϟāĻž address āφāϛ⧇ (āĻĻ⧁āχāĻŦāĻžāϰ memory āϝ⧇āϤ⧇ āĻšāϝāĻŧ)

āϧāĻžāĻĒ ā§Ē: Address āĻšāĻŋāϏāĻžāĻŦ āĻ•āϰ⧇ āĻŦ⧇āϰ āĻ•āϰāϤ⧇ āĻšāϝāĻŧ
- Relative: PC + offset (branch/jump-āĻ āĻŦā§āϝāĻŦāĻšāĻžāϰ āĻšāϝāĻŧ)
- Indexed: Index register + address (array-āϰ āϜāĻ¨ā§āϝ)
- Base Register: Base register + offset (relocation/segment-āĻāϰ āϜāĻ¨ā§āϝ)
- Auto inc/dec: Access-āĻāϰ āφāϗ⧇/āĻĒāϰ⧇ register āύāĻŋāĻœā§‡ +1 āĻŦāĻž -1 āĻšāϝāĻŧ (stack, loop)

āĻŽāύ⧇ āϰāĻžāĻ–āĻžāϰ āĻŸā§āϰāĻŋāĻ•

  • Indexed āĻŦāύāĻžāĻŽ Base: Index = array-āϰ index āĻŦāĻĻāϞāĻžāϝāĻŧ, address fixedāĨ¤ Base = base āĻŦāĻĻāϞāĻžāϝāĻŧ, offset fixedāĨ¤
  • Direct āĻŦāύāĻžāĻŽ Indirect: Direct = āϏ⧋āϜāĻž āϝāĻžāĻ“āĨ¤ Indirect = āĻĒāĻĨ⧇ āφāϰ⧇āĻ•āϜāύāϕ⧇ āϜāĻŋāĻœā§āĻžā§‡āϏ āĻ•āϰ⧇ āϝāĻžāĻ“ (extra memory access)āĨ¤
  • Relative: āϏāĻŦāϏāĻŽāϝāĻŧ PC-āĻāϰ āϏāĻžāĻĨ⧇ āϏāĻŽā§āĻĒāĻ°ā§āĻ•āĻŋāϤ, "relative" āĻŽāĻžāύ⧇ āφāĻ¤ā§āĻŽā§€āϝāĻŧ, PC-āϰ āφāĻ¤ā§āĻŽā§€āϝāĻŧāĨ¤

āĻŦāχāϭ⧇āĻĻ⧇ āĻŽā§‹āĻĄ āϏāĻ‚āĻ–ā§āϝāĻž ⧝ āĻŦāĻž ā§§ā§Ļ āĻšāϤ⧇ āĻĒāĻžāϰ⧇ (āĻ•āĻŋāϛ⧁ āĻŦāχ Auto increment āĻ“ Auto decrement āφāϞāĻžāĻĻāĻž āϧāϰ⧇, āĻ•āĻŋāϛ⧁ āĻŦāχ Implied āĻ“ Immediate-āϕ⧇ āĻāĻ•āϏāĻžāĻĨ⧇ āϰāĻžāϖ⧇)āĨ¤ āϤ⧋āĻŽāĻžāϰ āĻŦāχāϝāĻŧ⧇ āϕ⧋āύ āϕ⧋āύāϟāĻž āφāϛ⧇ āĻŦāϞāϞ⧇ āĻŽāĻŋāϞāĻŋāϝāĻŧ⧇ mnemonic āĻ āĻŋāĻ• āĻ•āϰ⧇ āĻĻ⧇āĻŦāĨ¤