← All notes

BIT4 Programmer's Manual

About this manual

BIT4 is a fantasy 4-bit computer that I designed and built from scratch in C#: its own CPU, ALU, banked RAM, character ROM, video unit, sprite engine and assembler, without any emulation framework. The long-term goal is to run it on real hardware with an Arduino and a TFT display.

This manual describes the machine as it is today. Use the buttons or the arrow keys to turn the pages.

PartDetail
CPU4-bit, stack-based, 2 registers (AX, BX)
ALUAND, OR, XOR, NOT, ADD, SUB, SHL, SHR, INC, DEC
Instructions38
RAM16 banks × 16 cells × 4 bits = 128 bytes
Character ROM4 pages × 16 glyphs, 4×5 pixels each
Display32×32 logical pixels, 16 CGA colors in 8×8 attribute cells
SpritesOne 4×5 sprite in bank 15, PSET or XOR drawing
InputPaged keyboard port, 4-bit random number port

Read how BIT4 was built →