Skip to content
Related Articles

Related Articles

GATE | GATE-CS-2005 | Question 65

Improve Article
Save Article
  • Last Updated : 19 Nov, 2018
Improve Article
Save Article

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

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!