Install and build ZeroPage

Set up the host compiler and build a C64 program from a fresh checkout.

Jump to a section

Install the tools

Download and unpack Zig 0.16.0 and install 64tass 1.60.3243. Put the directories containing the two executables on your shell's PATH. Zig builds the host compiler and provides its parser. 64tass assembles the emitted 6502 assembly. Install VICE for x64sc and the optional c1541 disk utility. Zig downloads · 64tass downloads · VICE downloads

Terminal
zig version
64tass --version
git clone https://github.com/ReadyOS-C64/ZeroPageLang.git
cd ZeroPageLang
zig build
./zig-out/bin/zp64c tools

zig build installs zp64c under zig-out/bin/. To use an assembler outside PATH, set ZEROPAGE_64TASS=/absolute/path/to/64tass. Tool overrides · Dependency reference

Compile and run

The compiler starts at export fn main() void. The c64 import provides the machine-facing API. .{} is an empty argument tuple for the formatter.

hello.zp64
const c64 = @import("c64");

export fn main() void {
    c64.console.clear();
    c64.console.print("HELLO FROM ZEROPAGE\n", .{});
    c64.vic.border = 5;
}
Terminal
mkdir -p build
./zig-out/bin/zp64c compile examples/hello.zp64 -o build/hello.prg
x64sc -autostart build/hello.prg

The default image loads at $0801. A BASIC line runs SYS 2061, entering the compiled program at $080d. Expect a greeting and a green border. On hardware, put the PRG on a disk or compatible storage device, load it, and enter RUN.

Set up the test tools

zp64c compile emits a PRG plus .asm, .labels, and .zpmap.json sidecars. Use the assembly to see the generated 6502 instructions, VICE labels to set breakpoints, and the map to inspect section ownership. zp64c asm emits assembly without running 64tass.

Terminal
zig build test
zig build emu-test
zig build e2e

The unit suite checks the compiler and runner. The Peddle host suite executes the generated machine code and includes test6502 assertions. The end-to-end suite compiles the demos and uses Bash, Perl, and c1541 to check build and disk artifacts. Full VICE automation uses an external harness. Testing and VICE setup · CLI and sidecars