GATE Computer ScienceVery hardGATE CS (PYQ pattern)

An accumulator machine has memory contents M[100]=300, M[104]=7, M[150]=75, M[200]=150, M[300]=500 and registers R1 = 100, R2 = 4. Starting with ACC = 0 it executes: LOAD #100 (immediate); ADD 100 (direct); ADD @100 (memory indirect); ADD (R1+R2) (indexed, effective address = R1 + R2). What is ACC at the end?

  1. A. 407
  2. B. 907
  3. C. 975
  4. D. 707

Correct answer: B. 907

LOAD #100 → 100; ADD 100 → +M[100] = 300 → 400; ADD @100 → +M[M[100]] = M[300] = 500 → 900; ADD (R1+R2) → +M[104] = 7 → 907. Reading the indirect operand as M[100] again, or the indexed operand as M[R1] + R2, gives the other values.

More Computer Organization and Architecture questions

Exams that ask this topic