Addressing Modes- Q3

+2 votes

Consider an instruction of indirect addressing mode. What are the number of memory references by the processor when instruction is a computation that requires a single operand and when it is a unconditional branch instruction respectively ?

A. 3, 3
B. 3, 2
C. 2, 2
D. 4, 3

asked Jun 4 in Computer Organization by gbmentor (54,290 points)
reshown Jun 5 by gbmentor

1 Answer

+2 votes
Best answer
For any indirect addressing mode instruction with one operand we need 3 memory references.

1. accessing loaction of effective address

2. access the operand

3. writing back the modified value of the operand

example of indirect instruction with one operand is INCR [R1]


For branch instructions indirect addressing mode needs 2 memory access

1. access the address of the loaction of branch

2. access the branch address


In addition, we need 1 memory access each for fetching the instructions and hence the total memory access for each of above is

4 and 3
answered Jun 5 by vinayakjhapro18 (2,940 points)
why writing back the modified value of the operand is taking only 1 memory reference and why not 2?
Why it will take two memory reference according to you?
As we already have the address to write to when we read the operand in the first place. We can retain that value in MAR