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

THE COMPATIBILITY add without removing — documented 6502 code runs unchanged

The whole permutation rests on one guarantee: in emulation mode the 65816 adds without removing from the documented instruction set. Every documented 6502/65C02 opcode keeps its byte and its meaning, so documented 6502 code runs unchanged, and compIle 13’s hardware-verified ADC (10000/10000) matches on the binary. The honest caveat: the 65816 is built on the 65C02, not the NMOS 6502 — it drops the NMOS undocumented opcodes (their encodings became new instructions) and fixes the decimal-mode flags and the JMP ($xxFF) page-boundary bug. So it is backward-compatible with the documented ISA and a superset of the 65C02, not a strict superset of NMOS code that leans on those quirks. That aside, the move is real: the wider machine folds around the documented old one, reachable by a single mode bit.

THE TECHNIQUE documented 6502 result == 65816 (E=1,M=1) result — backward-compatible

The demo runs the same ADC on the 6502 and on the 65816 in emulation mode — identical result — then shows native mode adds width on top: live demo


HISTORY & CREDIT 65C816 backward compat · superset of the 65C02

“A more powerful CPU breaks the old software.” — the 65816 keeps every documented 6502/65C02 opcode and meaning; documented programs just run. cited

the guarantee · every documented 6502/65C02 opcode byte + meaning preserved — add without removing.
the containment · emulation mode = the documented 6502; compIle 13’s verified ADC matches on the binary.
the caveat · built on the 65C02, not NMOS: drops the undocumented opcodes, fixes the decimal flags & the JMP ($xxFF) bug — a superset of the documented ISA, reachable by one mode bit.

A wider processor folded around the documented older one without disturbing a documented opcode — the permutation, honestly stated. superset

RECOMMEND FOR I-13 the strict superset, on the compiler

On the canonical compiler, the 6502 ADC and the 65816 emulation-mode ADC give the identical 160, and native mode adds width on top:

$ i13 run pm_compatibility.i13 # 6502 vs 65816 emulation ADC RUN OK · 77 step(s) · peak stack 5 · call depth 1 result_6502 = 160 result_65816_emu = 160 strict_superset = 1 -- identical: 6502 subset of 65816 native_adds_width = 1
Recommend as the batch’s close — a keeper shot ruled NULL, and the honest answer to “permutate into SNES?”. Backward compatibility is what makes the permutation real: the documented 6502 is contained, unchanged, in the SNES CPU’s emulation mode, and compIle 13’s verified ADC matches on the binary. The panel ruled it NULL — B39: “superset via a mode bit” is a theorem about the instruction set (every correct 65816 obeys it by construction), not an enacted output-invariant. And the honest correction the credit panel caught: it is not a strict superset — the 65816 is a 65C02 derivative that drops the NMOS undocumented opcodes and fixes the decimal/JMP quirks, so NMOS code (NES games included) that leans on those will not run identically. The thesis stands, corrected: the SNES CPU is a permutation of the documented 6502, grounded on the binary.