Skip to main content

Prerequisites

The Intel 4004 Toolkit is built with Zig. You’ll need to install Zig before building the project.
1

Install Zig

Download and install Zig from ziglang.org. The toolkit works with current Zig versions.Verify your installation:
zig version
2

Clone the repository

Get the source code:
git clone <repository-url>
cd intel-4004-toolkit
Replace <repository-url> with the actual repository URL for this project.
3

Build the toolkit

Run the Zig build command:
zig build
This compiles both the assembler and emulator. The executables will be placed in zig-out/bin/:
  • 4004-assembler - The assembler
  • 4004-emulator - The emulator
4

Verify the build

Check that the executables were created:
ls zig-out/bin/
You should see both 4004-assembler and 4004-emulator.

What gets built

The Zig build system creates two executable programs:

4004-assembler

Converts .4004 assembly files into executable binaries that can run on the emulator.

4004-emulator

Runs compiled 4004 programs with virtual I/O devices for interactive programs.

Build options

The standard Zig build options are available:
# Build with optimizations
zig build -Doptimize=ReleaseFast

# Build for a specific target
zig build -Dtarget=x86_64-linux

Next steps

Now that you have the toolkit built, continue to the quickstart guide to assemble and run your first Intel 4004 program.

Build docs developers (and LLMs) love