Open In App

GATE | GATE-CS-2005 | Question 65

Like Article
Like
Save
Share
Report

Consider a three word machine instruction

ADD A[R0], @ B 

The first operand (destination) “A [R0]” uses indexed addressing mode with R0 as the index register. The second operand (source) “@ B” uses indirect addressing mode. A and B are memory addresses residing at the second and the third words, respectively. The first word of the instruction specifies the opcode, the index register designation and the source and destination addressing modes. During execution of ADD instruction, the two operands are added and stored in the destination (first operand).
The number of memory cycles needed during the execution cycle of the instruction is

(A) 3
(B) 4
(C) 5
(D) 6


Answer: (B)

Explanation: In Indexed addressing mode, the base address is already in the instruction i.e A and to fetch the index data from R0 no memory access is required because it’s a register So to fetch the operand only 1 memory cycle is required.

Indirect Addressing mode requires 2 memory cycles only

Quiz of this Question


Last Updated : 19 Nov, 2018
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads