Hack with Sail
The hack ISA family has two profiles. hack16 is the canonical 16-bit nand2tetris baseline; hack32 is a 32-bit Verylogic extension. Both keep a 15-bit PC/address space and 32768-word ROM and RAM. The module surrounds their shared Sail semantics with an assembler, runnable programs, assertions, and regression tests.
Run it first
Clone the repository, open its root directory, and run:
A successful program ends with ASSERT PASS and a dump of architectural state. The tutorial explains the output and follows the same program through every toolchain stage.
Choose by goal
One program, end to end
The machine contract is split between shared model/core.sail, one self-contained model/profiles/<profile>.sail entry, and projects/<profile>.sail_project. Source translation belongs to the assembler; driver generation and native compilation belong to the executor; program discovery and command dispatch belong to workflow.
Suggested learning sequence
- Complete the tutorial and inspect
multiply.asm. - Read the ISA guide while following one profile entry into its included
model/core.sailand profile project. - Use Evolve Hack to choose and specify a modification at the correct layer.
- Enter Toolchain internals and follow the same source through the assembler.
- Finish with the execution and test workflow.