Skip to content
Official PYQ · 2026

GATE CS 2026 Set 1 Q5 — Machine Instructions and Addressing Modes

Explain with AI

Consider a processor P\text{P} whose instruction set architecture is the load-store architecture. The instruction format is such that the first operand of any instruction is the destination operand.

Which one of the following sequences of instructions corresponds to the high-level language statement Z=X+Y\mathrm{Z}=\mathrm{X}+\mathrm{Y} ?

Note: X, Y, and Z are memory operands. R00, R11, and R22 are registers.

Choose one option
View worked solution

Answer: D

In a load-store architecture (such as RISC), arithmetic and logical instructions (like ADD) cannot directly access memory operands. They can only operate on processor registers. Memory access is strictly restricted to dedicated LOAD and STORE instructions.

Let's analyze the given high-level statement: Z=X+YZ = X + Y, where XX, YY, and ZZ are memory operands.

  1. Load XX into a register:
    LOAD R0, X (loads the value of memory location XX into register R0R0)
  2. Load YY into another register:
    LOAD R1, Y (loads the value of memory location YY into register R1R1)
  3. Perform the addition using registers:
    ADD R2, R0, R1 (computes R2=R0+R1R2 = R0 + R1)
  4. Store the result back to memory location ZZ:
    STORE Z, R2 (stores the value of register R2R2 into memory location ZZ)

Evaluating the options:

  • Option A: ADD Z, X, Y attempts to perform addition directly on memory operands, which is invalid in a load-store architecture.
  • Option B: ADD Z, R0, Y attempts to use memory operands ZZ and YY directly in an ADD instruction, which is invalid.
  • Option C: ADD R0, X, Y attempts to use memory operands XX and YY directly in an ADD instruction, which is invalid.
  • Option D: Correctly adheres to the load-store architecture constraints by loading operands into registers first, performing the addition on registers, and then storing the result back to memory.

Free practice · Your answers on this page are not saved.

Published
Report a correction
Keep exploringMore Machine Instructions and Addressing Modes questions