Computer organization — addressing modes: In which addressing mode is the effective address computed by adding a constant displacement to the contents of a register?

Difficulty: Easy

Correct Answer: index mode

Explanation:


Introduction / Context:
Addressing modes define how the CPU interprets operands within instructions. Understanding each mode is essential for assembly programming, compiler back ends, and performance tuning because it affects how memory addresses are formed and accessed.



Given Data / Assumptions:

  • The CPU has registers that can participate in address calculation.
  • A constant displacement (offset) is provided in the instruction encoding.
  • The effective address must be the sum of a register value and a constant.


Concept / Approach:

Indexed addressing forms the effective address as: EA = R + displacement, where R is a base or index register, and displacement is a constant embedded in the instruction. This is widely used for array access and structure field addressing. Other modes (immediate, absolute, indirect) do not match this computation pattern.



Step-by-Step Solution:

Identify the calculation: EA must equal register contents plus a constant.Recall standard mode definitions: immediate uses literal data, absolute uses a fixed address, indirect dereferences a pointer from memory.Match the definition to indexed addressing.Select “index mode.”


Verification / Alternative check:

Instruction set manuals (x86 base+disp, ARM base+imm, RISC-V base+imm) all implement indexed/base-plus-displacement addressing for efficient array and stack access, confirming the choice.



Why Other Options Are Wrong:

  • Absolute mode: EA is a constant address, no register addition.
  • Indirect mode: EA is obtained by reading an address from memory via a pointer.
  • Immediate mode: operand is data, not an address.
  • None of the above: not applicable since index mode fits exactly.


Common Pitfalls:

Confusing indexed with based or relative addressing; many architectures use interchangeable terms but the key property is EA = register + displacement supplied in the instruction.


Final Answer:

index mode

More Questions from Operating Systems Concepts

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion