In which addressing mode is the effective address of the operand generated by…
2012
In which addressing mode is the effective address of the operand generated by adding a constant value to the contents of a register?
Answer: D. Index — Concept: An addressing mode is the rule an instruction set uses to compute the effective address (EA) — the actual memory location from which the operand is…
- A.
Absolute
- B.
Indirect
- C.
Immediate
- D.
Index
Attempted by 62 students.
Show answer & explanation
Correct answer: D
Concept: An addressing mode is the rule an instruction set uses to compute the effective address (EA) — the actual memory location from which the operand is taken. Modes are told apart by two things: what the address field inside the instruction means, and whether the current content of a register is combined arithmetically with that field to build the EA. Displacement-style modes are exactly those that ADD an instruction-supplied constant to a register's content.
Application: The rule described here is a sum of two quantities — one constant that comes from the instruction and one value that is read out of a register at run time. Written as a formula this is the displacement form EA = X + [Ri], built as follows:
The instruction supplies a fixed constant X in its address field.
The processor reads the current content of the named register, written [Ri].
It adds the two to form the effective address: EA = X + [Ri].
The operand is then fetched from memory location EA.
A mode whose effective address is formed by that constant-plus-register sum, with the register acting as the varying part, is index addressing.
Cross-check: Setting the effective-address rule of each offered mode side by side makes the distinction explicit:
Addressing mode | How the effective address is formed |
|---|---|
Absolute | the address constant A carried in the instruction is itself the operand's address |
Indirect | the content of the named location or register is the operand's address, so the address is fetched, not computed |
Immediate | no effective address is formed at all; the address field carries the operand's value |
Index | a constant address field X is added to the current content of an index register |
Only the sum rule EA = X + [Ri] matches “a constant value added to the contents of a register”, so the mode being described is index addressing. This is also why index mode is the natural fit for arrays: the constant X names the array’s base while stepping the index register moves to the next element.