An instruction is stored at location 300 with its address field at lo...
Relative: 302 + 400 = 702
In this mode the content of the program counter is added to the address part of the instruction in order to obtain the effective address.
View all questions of this test
An instruction is stored at location 300 with its address field at lo...
Addressing Modes and Effective Address
Addressing modes refer to the way in which the processor accesses memory to fetch operands or data. The effective address is the actual memory address that is used by the processor to access the data.
There are several addressing modes, including:
1. Immediate
2. Direct
3. Indirect
4. Register
5. Indexed
6. Relative
In this question, we are given the following information:
- An instruction is stored at location 300.
- The address field of the instruction is at location 301.
- The address field has the value 400.
- A processor register R1 contains the number 200.
- The effective address of the instruction is 702.
We need to determine the addressing mode of the effective address.
Solution
To determine the addressing mode, we need to understand how the effective address is calculated for each addressing mode.
1. Immediate: The operand is a constant value that is part of the instruction itself. The effective address is the value of the operand.
2. Direct: The operand is located at the memory address specified in the instruction. The effective address is the value of the memory address.
3. Indirect: The operand is a memory address that points to the actual data. The effective address is the value stored in the memory location pointed to by the address.
4. Register: The operand is stored in a processor register. The effective address is the value in the register.
5. Indexed: The operand is located at a memory address that is calculated by adding an offset to a base address stored in a register. The effective address is the sum of the base address and the offset.
6. Relative: The operand is a memory address that is calculated by adding an offset to the current program counter (PC) value. The effective address is the sum of the PC value and the offset.
In this question, we can calculate the effective address as follows:
- The instruction is stored at location 300, so the address field is at location 301.
- The address field has the value 400, so the instruction is trying to access the data at memory location 400.
- The effective address is 702, which means that the instruction is trying to access the data at memory location 702.
- The processor register R1 contains the number 200, but it is not used in calculating the effective address.
Since the effective address is not calculated using any of the addressing modes (Immediate, Direct, Indirect, Register, Indexed, or Relative), the correct answer is option C, which is Relative.