paaracetamol / py-6502-emu

A 6502 in Python

The CPU from the NES and the Apple II, with an assembler and a debugger.

The emulator debugger in a terminal: assembly listing, registers, flags and zero page memory

py-6502-emu / README.md

The idea The CPU behind the NES.

The MOS 6502 ran the NES, the Apple II and the Commodore 64. This emulates it in Python, one instruction at a time, so you can watch what it does.

Heavily inspired by the tiny8 project.

Run it

The built-in assembler turns the .asm file into bytes, then the debugger takes over.

python main.py program.asm

The debugger A text UI in curses.

  • Step through the program instruction by instruction
  • Registers, flags and the program counter update live
  • Zero page memory shown as a hex dump
  • The listing highlights the line being executed
Thumbnail of 8bit 6502 CPU Emulator | Python

Watch the devlog. 992 views.

8bit 6502 CPU Emulator | Python

Watch on YouTube