A NES game built from scratch in 6502 Assembly.
Install the cc65 toolchain (assembler + linker) via Homebrew:
brew install cc65Verify the installation:
ca65 --version
ld65 --versionYou will also need an NES emulator to run the ROM:
- Mesen — Recommended. Excellent debugging tools including a PPU viewer, memory inspector, and disassembler.
- FCEUX — Another solid option with built-in debugging.
Install the cc65 toolchain using one of these methods:
Option A: Pre-built binaries (simplest)
- Download the latest Windows snapshot from cc65.github.io under "Windows Snapshot."
- Extract the zip to a folder (e.g.,
C:\cc65). - Add the
binfolder to your system PATH:- Search "Environment Variables" in the Start menu.
- Under "System variables," find
Path, click Edit, and addC:\cc65\bin.
Option B: Via MSYS2
pacman -S mingw-w64-x86_64-cc65Verify the installation:
ca65 --version
ld65 --versionFor an NES emulator on Windows:
If you are using Windows without make available, see the Building without Make section below.
mecha-man/
├── hello.asm # Assembly source code
├── nes.cfg # Linker configuration (memory layout for the ROM)
├── Makefile # Build automation
├── .gitignore
└── README.md
Build the ROM:
makeClean build artifacts:
make cleanIf make is not available (common on Windows), run the two build steps manually:
ca65 -o hello.o hello.asm
ld65 -o hello.nes -C nes.cfg hello.oStep 1 (ca65) assembles the source code into an object file. Step 2 (ld65) links the object file into a final .nes ROM using the memory layout defined in nes.cfg.
Open hello.nes in any NES emulator:
macOS:
open hello.nesThis opens the file with whatever application is associated with .nes files. You can also drag and drop hello.nes into your emulator window, or open it from the emulator's File menu.
Windows:
Double-click hello.nes if you have an emulator associated with the file type, or open it from the emulator's File > Open menu.
Expected output: White text reading "HELLO WORLD!" centered on a black background.
- Classic Game Programming on the NES by Tony Cruise — The book this project follows alongside.
- NESdev Wiki — Comprehensive NES hardware and programming reference.
- 6502 Instruction Set Reference — Complete reference for every 6502 CPU instruction.
- ca65 Users Guide — Documentation for the assembler.