When a CPU fetches an instruction word from memory, the word contains an operation code (op code) that indicates the type of operation the CPU is to perform and information specifying where the instruction operands are located. A computer may use various addressing modes to specify the operand location. One such addressing mode is shown below, where R designates some register within the CPU and d is a constant embedded in the instruction word

Which of the following terms best describes the addressing mode used by the instruction above?

A. Immediate addressing
B. Direct addressing
C. Indexed addressing
D. Indirect addressing

1 Answer

James Dowd

Updated on December 30th, 2020

Addressing modes specify the method used to detail the operand of an instruction. The operand of an instruction is both the part that specifies the data that is to be operated on as well as the data itself. Let's define the four possible addressing modes we are choosing between:

  1. Immediate Addressing: The actual data is used in the instruction itself. It is referred to as immediate because rather than calling on memory to retrieve the operand, it is direct in the instruction set, making it a fast addressing method.
  2. Direct addressing: Rather than having the data in the instruction set, in direct addressing we have the address of the data directly in the instruction set. Therefore, there is an extra step required by the processor to consult the memory address specified to retrieve the data.
  3. Indexed addressing: Here, our instruction set includes an index register and an offset. Calculations must be performed using the base register and offset to find the exact address of our operand. It allows us to access array elements at consecutive locations in the memory.
  4. Indirect addressing: Finally, indirect addressing is when our instruction set includes the address that will point to the address of our operand.

Based on these explanations, the addressing type being shown in the problem is C, indexed addressing. As described above, R would be our index register and d would be our offset. The sum sign indicates the calculations needed to be performed to arrive at the operand address. 

Copyright © 2024 Savvy Engineer