Skip to content

NES with ca65

Alternative local tools for this machine’s assembly lessons.

This guide uses ca65. For the recommended Asm198x workflow and available browser lessons, use the main setup guide.

Install the alternative tools

macOS

1. Install Homebrew (if needed)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

2. Install cc65 Toolchain

brew install cc65

This includes ca65 (assembler), ld65 (linker), and cc65 (C compiler).

3. Install FCEUX Emulator

brew install --cask fceux

4. Verify Installation

ca65 --version && ld65 --version

Windows

1. Download cc65

Download the Windows snapshot from cc65.github.io.

Extract to a folder like C:\cc65 and add C:\cc65\bin to your PATH.

2. Download FCEUX

Download FCEUX from fceux.com.

3. Verify Installation

ca65 --version

Linux

1. Install cc65 (Debian/Ubuntu)

sudo apt install cc65

Or build from source for the latest version: github.com/cc65/cc65

2. Install FCEUX

sudo apt install fceux

3. Verify Installation

ca65 --version && ld65 --version

Building Your Code

NES builds typically use a two-step process - assemble then link:

ca65 game.asm -o game.o
ld65 -C nes.cfg game.o -o game.nes

Then run in FCEUX:

fceux game.nes

You'll need a linker config file (nes.cfg) - this is covered in the curriculum.