This project is an implementation of the Hack VM Translator, as suggested in Chapter 7 of the book The Elements of Computing Systems. The translator is designed to convert a stack-based VM code written in the Hack VM language into Hack Assembly files that can be further converted into binary thats executed on the Hack computer architecture.
To translate your Hack VM code, follow these steps:
-
Build the translator:
go mod tidy go build -v -o vm-translator
-
Run the translator on your input Hack VM code file (e.g., File.vm):
./vm-translator file/path/File.vm
For more details on the specifications of the Hack VM Machine, you can refer to the official book chapter lecture here, which covers the core concepts and design of the Hack VM language.