GATE Computer ScienceEasyGATE CS (PYQ pattern)

A stack grows downwards in 4-byte units and SP = 0x8000 initially. The instructions PUSH, PUSH, CALL (pushes a 4-byte return address), POP, RET (pops the return address) and PUSH are executed in order. What is SP at the end?

  1. A. 0x7FF4
  2. B. 0x800C
  3. C. 0x7FF8
  4. D. 0x7FF0

Correct answer: C. 0x7FF8

Net change in words: −1 −1 −1 +1 +1 −1 = −2 words = −8 bytes, so SP = 0x8000 − 8 = 0x7FF8.

More Computer Organization and Architecture questions

Exams that ask this topic