YACC1 – Yet Another Custom CPU

YACC1

 

About:

Big update

after putting the YACC1 down for a few years, it was time to continue to make progress, this time working my intern Claude. During this cycle all CAD was moved from EAGLE/FUSION to KICAD. Claude took care of the conversion. The new GitHub location is https://github.com/ksr/YACC1-D

Inside the YACC1 repository

Everything for YACC1 lives in one GitHub repository, github.com/ksr/YACC1-D: the circuit boards, the microcode, the ROM, the operating system, the C compiler, the emulators, the tests and the documentation. It replaced a decade of scattered folders and backups in September 2026. Each board, program and document exists once, in its current version, and older revisions are kept but frozen.

The top-level folders:

  • hardware/ – the circuit boards, one folder per card: the backplane and bus, the two-board sequencer (logic and microcode memory), the ALU, the index-register cards, memory, I/O, video, CompactFlash and the bus tester. Each card keeps every revision side by side, in Eagle and in KiCad, with fabrication files (gerbers, BOMs, renders); older revisions sit in deprecated/ folders, and FABRICATED.md lists which revisions were actually built.
  • firmware/ – what runs inside the machine: the microcode generator (a C program that writes the sequencer’s EEPROM image), the monitor ROM with its loader and BIOS, and a Tiny BASIC.
  • os/ – Y1/OS, a disk operating system that boots from CompactFlash, with a shell, redirection and pipes, and dozens of commands, including an editor, sed, awk, an assembler, a disassembler and Kermit for file transfer.
  • software/ – tools that run on a Mac or PC: the YACC1 assembler, y1cc (a C compiler for YACC1), an instruction-level emulator, and a microcode-level emulator that steps the real microcode through models of each card.
  • embedded/ – Arduino firmware for the helper boards: the bus tester and the sequencer card’s microcode loader.
  • tests/ – automated tests for nearly everything: the compiler, the OS, the assembler, the microcode, and the bench tests that run on the real machine.
  • tools/ – scripts for loading microcode and programs over USB, writing CF cards, generating board files and BOMs, and checking the repository.
  • docs/ – the documentation: a theory of operation for every card, the instruction set, the microcode, the memory map, programming guides for the assembler, compiler, monitor and OS, and bring-up procedures.
  • media/ – photos of the boards.
  • archive/ – earlier generations of the design and superseded material, read-only, kept for history.

Where to start: the README for the overview, then ARCHITECTURE.md for how the CPU works, ISA-REFERENCE.md for the instruction set, docs/cards for any one board in depth, and BACKLOG.md for what is being worked on.

Original Description:

The YACC1-2020, provides the tools and resources to learn computer science starting from the basics of digital logic through to a fully working custom 8-bit CPU with a user defined instruction set, microcode generator, emulator, assembler, BASIC interpreter, and one day an operating system with filesystem, command line interpreter, and utilities. This first version named the YACC1 (Yet Another Custom CPU) uses basic 74xx TTL logic and whenever possible basic gates, no 74181 ALU, no FPGA (that would be cheating 🙂 ).

The project is currently under development as a personal project. The basic idea has been kicking around inside my head for years (47 years to be exact), but until recently never made it to the top of my list (I did make an attempt a few years back but life got in the way). Now I am exploring if this project might be interesting to others, perhaps as an educational tool or maybe just a fun project.

Here is a video of the machine in operation and some photos can be found in the media folder of the GitHub repository

Status (October 2026):

The machine today (October 2026) has these cards on its bus:

  • Bus board (backplane V2.0) with 8 slots.
  • Sequencer – a two-board set, the logic card and the microcode memory card mated together. The microcode is loaded into its EEPROM over USB from a Mac. The machine runs at 1 MHz and has been seen working at 6 MHz.
  • ALU card – boolean, compare, add/subtract and shift operations, and the accumulator.
  • Register cards – two cards with four 16-bit registers each, R0–R7 (R0 is the program counter, R1 the stack pointer). They can drive the data or the address bus.
  • Memory card – 52K of RAM, the 8K ROM (monitor and BASIC) at $E000, and two 16-bit temporary registers. Version 2.0, which adds a CompactFlash interface for the disk operating system, is designed and ready to order.
  • I/O card – the serial console (a 16550 UART at 38400 baud, over USB), 8-bit switches and LEDs, TIL311 hex displays and an LCD.
  • Video card – a 6845-based text display with its screen memory at $D000, in bring-up.
  • Bus test card (optional, highly recommended) – drives the bus by hand in test mode or monitors it in listening mode.
  • 16-byte switch ROM card – a program set on switches, used for the first bring-up; no longer needed.
  • 16-byte TTL RAM card – sixteen bytes of RAM built from TTL latches, used with the switch ROM for the first bring-up; no longer needed.

On the software side, the machine runs the monitor ROM and BASIC, and C programs compiled for it pass the same tests on the hardware as on the emulator. Y1/OS, the disk operating system, and the native C compiler run on the emulators today and move to the machine with the CompactFlash interface.

Firmware (October 2026):

  • Microcode – generated by a C program and loaded into the sequencer’s EEPROM over USB. The design review of 2026-09 found and fixed two bus fights and a carry fault; four instructions were added for the C compiler; and a shorter instruction fetch makes every instruction 2–3 steps faster (about 20% faster programs). The newest version is tested on the emulator and waiting to be loaded into the machine. (microcode guide)
  • Monitor ROM – examine and change memory and registers, run programs, an Intel-hex loader for programs sent from a Mac, BIOS entry points for programs, booting Y1/OS from CompactFlash, and a video driver. Running in the machine since 2026-09-23; the build with the video driver is ready to burn. (monitor guide)
  • BASIC – a Tiny BASIC in the ROM, working on the machine.
  • Arduino firmware – the sequencer card’s loader (Sequencer4: copies and verifies the microcode in under a minute at every power-up) and the bus tester’s command interpreter.

Software (October 2026):

  • Y1/OS – a disk operating system on CompactFlash: a shell with redirection and pipes, and dozens of commands, including the vi editor, sed, awk, an assembler, a disassembler, a C compiler and Kermit for file transfer. It runs on the emulators today and moves to the machine with the CompactFlash interface. (OS guide)
  • y1cc, a C compiler for YACC1 – a reference compiler in Python, the same compiler in C, and a nine-pass version that runs on YACC1 itself under Y1/OS. On the emulator the native compiler and assembler rebuild themselves byte for byte. C programs compiled for YACC1 pass the same tests on the machine as on the emulator. (compiler guide)
  • Assemblers – RC/asm (Michael H. Riley’s cross assembler with a YACC1 instruction table) on the Mac, and a native assembler written in YACC1 assembly that runs under Y1/OS. (assembler guide)
  • Emulators – an instruction-level emulator, and a microcode-level emulator that runs the real microcode through models of every card, step by step, and reports any two drivers fighting over the bus. (emulator guide)

Tools (October 2026):

  • Loading the machine – Python tools that load the microcode into the sequencer card and programs into memory through the monitor, write CompactFlash cards, and transfer files with Kermit.
  • Testing – one command rebuilds everything and runs the whole test suite (firmware, microcode, compiler, OS, assemblers, emulators); a bench suite runs the same tests on the real machine.
  • Circuit boards – every board has been converted from Eagle to KiCad, with a check that each conversion is connected exactly like the original. New boards (memory card 2.0, video 1.1) are generated, routed and checked by scripts; a design review of every card is in the repository.

What’s next:

  • Load the new microcode into the machine and run the bench tests (two stages).
  • Order memory card 2.0, which adds the CompactFlash interface, and boot Y1/OS on the real machine.
  • Bring up the video card, with its fixes, and burn the ROM that drives it.
  • Find out how fast the machine can run: it works at 1 MHz and has been seen running at 6 MHz.

Updates (blog) here:

YACC1-D GitHub repository

Motivation

Like many others back in the mid 1970s I had the opportunity to learn both computer programming and microcomputer hardware simultaneously. For me I started programming BASIC on a timeshare HP machine via a terminal located in the back of my math teacher’s classroom (he also taught computer programming) while at home I also dabbled with digital circuits. When Popular Electronics published the COSMAC ELF project I was hooked. Now I often wonder if for some students learning computer science the hardware experience feels too much like a magic box.Why One Page Computer?

Interested?

Now, finally after making some serious headway, I am exploring if this project might be interesting to others, perhaps as an educational tool or maybe just a fun project.

I am interested in speaking with:
High school Computer Science educators
Freshman and sophomore college educators
Electronics enthusiasts

If you fall into one of these categories or are just interested, please reach out to me at email – ken at cottageworker dot com

Check out more custom built CPUS at the Homebrew Computer Ring