◄ WORLD V · SONNY 5DART 461 · a helldive at the net

THE DATA BANK 64KB becomes 16MB — a bank byte above every address

The 6502 sees 64KB, full stop — 16 address lines. The 65816 adds a Data Bank Register (DBR): a 24-bit address is bank : offset, (DBR « 16) | offset, opening 16MB (256 banks of 64KB). Set DBR=0 and data access is the 6502’s first 64KB (the special case); set DBR=2 and the same 16-bit offset now reads bank 2. It is how the SNES maps ROM, RAM, and registers across a huge space while keeping 6502-style 16-bit instructions for the common case — a whole extra byte of address, hiding above the old sixteen bits.

THE TECHNIQUE address = (DBR « 16) | offset — DBR=0 is the 6502’s 64KB

The demo forms a 24-bit address with DBR=0 (0x001234, the 6502) and DBR=2 (0x021234, bank 2): live demo


HISTORY & CREDIT 65C816 data bank register

“An 8-bit-family CPU tops out at 64KB.” — a bank byte lifts the 65816 to 16MB while keeping 16-bit offsets. cited

the register · DBR supplies the high byte — (DBR«16)|offset = 24 bits.
the space · 256 banks × 64KB = 16MB.
the special case · DBR=0 is the 6502’s single 64KB bank.

A byte of bank stacked above sixteen bits of offset — the 6502’s address space as one bank of two hundred fifty-six. address extension

RECOMMEND FOR I-13 the 24-bit address, on the compiler

On the canonical compiler, offset 0x1234 with DBR=0 is 0x001234, and with DBR=2 is 0x021234 (135732):

$ i13 run pm_databank.i13 # (DBR<<16) | offset RUN OK · 31 step(s) · peak stack 3 · call depth 1 a_6502 = 4660 -- DBR=0: 0x001234 (in the first 64KB) a_bank2 = 135732 -- DBR=2: 0x021234 extends_16mb = 1
Recommend as a NULL — more address, i.e. resource + encoding. The data bank enlarges the address space (a resource increase, B40) by prefixing a bank byte (an address encoding, B44); DBR=0 recovers the 6502 (B39). Bigger memory is not a new axis. NULL — the permutation’s reach: 64KB to 16MB with the 6502’s instructions intact.