Continuing on what MichaelM said: It would be extremely limiting to not be able to have other access to the stack area, like to handle parameters passed via the stack either implicitly or explicitly, handling them like this for example:
Code:
TSX
LSR $107,X
ROR $106,X
where you're accessing bytes at varying depths in the stack without first taking everything off from above them first.
Even in interrupts, if you handle BRK, you'd want to be able to do something like:
Code:
ISR: PHA ; (Later you may need to push Y also, with PHY, if the
PHX ; ISR uses Y anywhere. NMOS will have to go through A.)
TSX
LDA 103,X ; Get the stacked staus, and
AND #$10 ; see if the B bit is set (meaning a BRK instruction
BNE break ; caused the interrupt. If B bit is set, branch.
<service hardware interrupt>
PLX
PLA
RTI
;-------------
break: LDA 104,X ; The return addr is at 104,X and 105,X, and the
SEC ; signature byte is at the addr they point to, minus 1.
SBC #1 ; Use SBC here, not DEA, because we want the C flag.
STA temp ; Do low byte first (temp is in ZP),
LDA 105,X ; then high byte.
BCS brk1 ; If decrementing the low byte did a borrow,
DEA ; then decrement the high byte too.
brk1: STA temp+1
LDA (temp) ; Read the signature byte
. ; which will determine the next actions.
.
.
The stack is also used for finding inlined data the handle, and then return with the program counter incremented past the data, as in:
Code:
JSR PRIMM
.BYTE "This will be printed!", $00
or in synthesizing instructions, having local variables (including for recursion), etc..