Which addressing mode uses the contents of a specified register as the effective address and then automatically increments that register to point to the next element in a list?

Difficulty: Easy

Correct Answer: Auto increment

Explanation:


Introduction / Context:
Addressing modes extend instruction flexibility and can accelerate common patterns like iterating through arrays or stacks. Auto-increment addressing is particularly useful for linear scans of buffers because it eliminates explicit instructions to update the pointer after each access.


Given Data / Assumptions:

  • A register holds the address of the current element.
  • Accessing the operand should also advance the pointer.
  • Increment amount may depend on operand size (for example, +1 for byte, +4 for word).


Concept / Approach:
In auto-increment mode, the effective address is taken from a register (like Rn). After the read or write, the CPU increments Rn automatically to the next element, reducing instruction count and improving pipeline efficiency for sequential access patterns.


Step-by-Step Solution:

1) Let Rn contain the address of A[i].2) Execute an instruction using [Rn] as the effective address (for example, load).3) The hardware completes the memory access.4) The CPU automatically increments Rn to point to A[i+1] (size-based increment).


Verification / Alternative check:
Assembly listings on architectures supporting this mode (for example, some ARM or DSP variants) show that pointer updates are implicit, saving an extra add instruction per iteration.


Why Other Options Are Wrong:

  • Indirect addressing: Uses a register for address but does not auto-update.
  • Index addressing: Adds index/offset; no implicit increment of the base register.
  • Auto decrement: Similar pattern but decrements after access (useful for stacks).
  • None of the above: Incorrect because auto increment matches the description.


Common Pitfalls:
Ignoring element size when reasoning about increment amounts, which can yield misaligned accesses or skipped elements.


Final Answer:
Auto increment

Discussion & Comments

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