In a processor that uses a full-descending stack organization, what happens…
2026
In a processor that uses a full-descending stack organization, what happens during a PUSH operation?
- A.
Decrement SP, then write data
- B.
Increment SP, then write data
- C.
Write data, then increment SP
- D.
Write data, then decrement SP
Show answer & explanation
Correct answer: A
Concept
A stack is defined by two independent design choices: the growth direction (ascending — addresses increase as items are pushed; descending — addresses decrease) and the pointer convention (full — the stack pointer (SP) already references the last item pushed; empty — SP references the next free slot). When SP is 'full', it always points at occupied data, so a PUSH must first move SP to a new address and only then store the value, to keep the 'SP-points-to-top' invariant true after the operation.
Application
Here the stack is full-descending: 'descending' means the stack grows toward lower memory addresses, and 'full' means SP already points at the most recently pushed item. Applying the PUSH sequence for this convention:
Decrement SP (SP = SP − 1, or SP − word size) so it points to the next lower, currently-empty address.
Write the data value into memory at the address SP now holds.
After these two steps SP again references the newest item, so the 'full' invariant holds. This is exactly: decrement SP, then write data.
Cross-check
Checking against the other three stack conventions confirms the mapping is unique — each combination of growth direction and pointer convention produces a different PUSH sequence:
Convention | Growth direction | Pointer meaning | PUSH sequence |
|---|---|---|---|
Full-Ascending | Addresses increase | Points to top (last pushed) | Increment SP, then write data |
Full-Descending | Addresses decrease | Points to top (last pushed) | Decrement SP, then write data |
Empty-Ascending | Addresses increase | Points to next free slot | Write data, then increment SP |
Empty-Descending | Addresses decrease | Points to next free slot | Write data, then decrement SP |
This also matches real hardware: ARM’s STMFD (Store Multiple Full Descending) / PUSH instructions implement exactly this full-descending "decrement-before-store" semantics.