THE DIRECT PAGE the zero page, set free — a movable 16-bit D register
The 6502’s zero page — the fast first 256 bytes — is hardwired at address 0. The 65816 adds the D register (Direct page) and makes it movable: an effective address is now D + offset, so the fast page can sit anywhere in bank zero. Set D=0 and it is exactly the 6502 zero page (the special case); set D=$2000 and every zero-page instruction now hits $2000–$20FF. Each task, interrupt, or coroutine can carry its own fast page — the 6502’s most-used addressing mode, relocated.
THE TECHNIQUE effective address = D + offset; D=0 is the 6502 zero page
The demo resolves zero-page offset $10 with D=0 (0x0010, the 6502) and D=$2000 (0x2010, relocated): live demo
HISTORY & CREDIT 65C816 direct page (D)
“The zero page is at address zero, full stop.” — the 65816 relocates it with the D register; zero is just the default. cited
the register · D, a 16-bit direct-page base — effective address = D + dp. the special case · D=0 reproduces the 6502 zero page exactly. the use · per-task/interrupt fast pages — the hottest 6502 addressing mode, made relocatable.
The fast first page lifted off address zero and set anywhere — the 6502’s zero page as a movable window. relocation
RECOMMEND FOR I-13 the movable page, on the compiler
On the canonical compiler, offset $10 resolves to 0x0010 with D=0 (the 6502) and 0x2010 with D=$2000:
$ i13 run pm_directpage.i13 # effective addr = D + dp
RUN OK · 31 step(s) · peak stack 3 · call depth 1
zp_6502 = 16 -- D=0: the 6502 zero page
dp_moved = 8208 -- D=0x2000: relocated to 0x2010
relocatable = 1
Recommend as a NULL — a relocatable base, i.e. encoding. The direct page adds a base register to the effective-address computation; where a datum lives changes, but the addressing math is a coordinate offset (B44) and D=0 pins the 6502 case (B39). No new output-relation. NULL — the permutation freeing the 6502’s fast page to move.