GATE / CS ARCHIVE

GATE CSE 2001 / QUESTION 1.10

Calls without a dedicated stack-pointer register

Computer Organization & Architecture · Instructions & Addressing Modes · Full GATE CSE 2001 paper

GATE 2001, Q1.10 1 mark · MCQ
Report issue

Instructions & Addressing Modes

Question 1.10, GATE 2001: A processor has no dedicated stack-pointer register. Does this prohibit subroutine calls, permit calls but not nesting, permit nesting but not interrupts, or still allow nested calls and interrupts?
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: A call must preserve a return address, but that address need not be pushed by a special hardware SP. A link register, a general-purpose register used as a software pointer, or explicit memory stores can preserve it.

Step 2: Before a nested call overwrites a link register, software saves the old value in a memory record and restores it on return. Interrupt context can be preserved by analogous hardware/software mechanisms.

Thus the absence of a dedicated stack-pointer register does not rule out nested calls or interrupts: D, assuming the processor otherwise provides the necessary control-transfer and storage operations.

Original paper, page 2