Instructions & Addressing Modes
![Question 65, GATE 2005: Three-word ADD A[R0],@B uses destination indexed address A+R0 and source memory-indirect address M[B]. Opcode/modes are word 1, A and B are words 2/3. How many memory cycles in execution? A3; B4; C5; D6. Distinguish opcode-only fetch boundary from fetching all instruction words before execution.](../../assets/questions/CS-2005-Q65-1.webp)
Answer & solution
Answer: D if operand words fetched in execution; B if all three instruction words already fetched (no official key was published)
After fetching the opcode word, execution reads instruction word A and instruction word B (two cycles), reads destination M[A+R0] (one), reads the indirect pointer M[B] and then source M[M[B]] (two), and writes the sum to M[A+R0] (one). This totals six, D. If the phrase execution cycle instead excludes fetching ALL three instruction words, only the four operand accesses remain, B. The paper lack an explicit fetch-cycle boundary; the six-cycle answer uses the conventional opcode-only initial fetch assumed by this style of question. The total including all instruction words is seven memory accesses, with no overlap or cache effects specified.
Separate instruction-word reads from operand-addressing reads. After an opcode-only fetch, two more reads retrieve A and B. Indexed destination contributes one read of its old value; indirect source contributes one read for the pointer and one for its pointed-to value. Finally one write stores the sum. That is 2+1+2+1=6. If all three instruction words were already fetched, only four accesses remain; the missing boundary definition is therefore material, not a computational error.