THE 16-BIT STACK the stack leaves page one — a full 16-bit pointer in native mode
The 6502’s stack is trapped: the stack pointer is 8 bits and the high byte is hardwired to $01, so the stack is exactly the 256 bytes of page one, and pushing past it wraps around inside that page. In native mode the 65816’s stack pointer becomes a full 16-bit register — the stack can live anywhere in bank zero and be as large as you like. Emulation mode pins it back to page one (the 6502). It is the change that, with stack-relative addressing, makes deep recursion and real call stacks possible — the stack, unchained.
THE TECHNIQUE native: 16-bit SP anywhere; emulation: SP high byte pinned to $01
The demo shows SP in emulation mode forced into page one (0x0100) versus a free 16-bit SP in native mode: live demo
HISTORY & CREDIT 65C816 native 16-bit stack
“The stack is always page one.” — only in emulation mode; native mode gives a full 16-bit stack pointer. cited
emulation · 8-bit SP, high byte fixed $01 — 256 bytes, the 6502. native · full 16-bit SP — the stack lives anywhere in bank 0, any size. the payoff · with stack-relative (dart 465), deep recursion and real call frames.
A stack pointer freed from its single page — the 6502’s 256-byte stack grown to a bank. width
RECOMMEND FOR I-13 the freed stack, on the compiler
On the canonical compiler, SP=0 in emulation lands at 0x0100 (page one); in native it stays a free 16-bit value:
$ i13 run pm_stack16.i13 # emulation vs native SP
RUN OK · 38 step(s) · peak stack 3 · call depth 1
emu_sp = 256 -- E=1: forced into page 1 (0x0100)
nat_sp = 8192 -- E=0: full 16-bit, anywhere in bank 0
native_frees_stack = 1
Recommend as a NULL — a wider pointer, same family as the width flags. The 16-bit stack is the stack pointer widened (B44/B39, the emulation case pinned); more stack is a resource (B40). No new invariant. NULL — the permutation unchaining the stack from page one.