Visit the Nand2Tetris website: http://nand2tetris.org/
The Nand to Tetris course explores key computer science concepts including operating systems, compilers, virtual machines, assemblers, and logic gates. This implementation is built in Go.
The course overview picture from Nand to Tetris
The Assembler translates assembly language code (*.asm
) into machine code (*.hack
).
For further reading, check out these articles:
- English: Medium Article
- Japanese: Zenn Article
How to run assembler on the example:
cd ./assembler
go run . ../examples/Pong/Pong.asm
The VM Translator converts Virtual Machine code (*.vm
) into assembly code (*.asm
).
cd ./vm
go run . ../examples/Pong
The Compiler converts code written in the Jack language (*.jack
) into VM code (*.vm
). The Jack language is a straightforward programming language developed by the creators of Nand to Tetris.
cd ./compiler
go run . ../examples/Pong
Note: The current version of the compiler does not implement operator precedence as this feature is not covered in the Nand to Tetris course. I may add this feature later when I have more time.