hack emulator

A nand2tetris Hack computer running in the browser.

Interactive demo โ†— jsr

The Hack computer is a 16-bit machine designed for the nand2tetris course. It has a CPU, ROM, RAM, a memory-mapped 512ร—256 monochrome screen, and a keyboard. Programs are written in Hack assembly and compiled to binary .hack files โ€” one 16-bit instruction per line. This emulator runs those binaries directly in the browser using a high-performance CPU simulation built with @r2/hack-emulator.

// programs

  1. life.hack

    Conway's Game of Life โ€” a cellular automaton where cells live, die, or reproduce based on their neighbours.

  2. lol.hack

    Fills the entire screen with a repeating pattern, demonstrating memory-mapped I/O.

  3. pixel.hack

    Draws a single pixel to the screen โ€” the simplest possible graphical program.