The smallest 6502 emulator in JS — ~300 lines, ~50 functions
The 6502 has a minimal register set: • A (Accumulator) - main math register • X, Y - index registers • SP - stack pointer ($0100-$01FF) • PC - 16-bit program counter • Status - N V - B D I Z C flags Memory: flat 64KB address space (0x0000-0xFFFF)
| ADDR | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | A | B | C | D | E | F |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| $0600 | ||||||||||||||||
| $0610 | ||||||||||||||||
| $0620 | ||||||||||||||||
| $0630 | ||||||||||||||||
| $0640 | ||||||||||||||||
| $0650 | ||||||||||||||||
| $0660 | ||||||||||||||||
| $0670 |