Consider the instruction LW R1, 20(R2). During execution it reads a 32-bit…

2017

Consider the instruction LW R1, 20(R2). During execution it reads a 32-bit word from memory and stores it in 32-bit register R1.

The effective address of the memory location is obtained by adding constant 20 to the contents of R2.

Which option best reflects the addressing mode used for the memory operand?

  1. A.

    Immediate addressing

  2. B.

    Register addressing

  3. C.

    Register Indirect addressing

  4. D.

    Indexed addressing

Attempted by 121 students.

Show answer & explanation

Correct answer: D

Effective address calculation: EA = contents(R2) + 20.

This is a register plus constant displacement/offset form. Many texts call this base/displacement addressing. Since that exact name is not listed in the options, the best matching option is Indexed addressing, because the address is formed by adding a register value and an offset.

  • Not immediate: 20 is not the operand data; it is used to calculate an address.

  • Not register: the operand is in memory, not directly in a register.

  • Not pure register indirect: pure register indirect would use only contents(R2) as the address, without adding 20.

Answer: Indexed addressing

Explore the full course: Isro