Skip to content

A virtual machine translator which translates compiled Jack code into Hack Assembly; implemented in Python.

Notifications You must be signed in to change notification settings

joshbroughton/hack-VM-translator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 

Repository files navigation

What is this project?

A virtual machine transator which translates Hack VM language into Hack assembly code. Completed as part of the nand2tetris part 2 course on Coursera. The Hack software architecture is designed similarily to Java, in which programs written in the high-level language (Jack) are compiled to an intermediary virtual machine code before being translated down to Hack assembly and finally assembled into hack machine code.

To translate a <filename>.vm file or folder containing .vm files into hack assembly, run:

python3 vm_translator.py <relative_path_to_filename>.vm or python3 vm_translator.py <relative_path_to_folder>

The folder may contain other files; the translator will only load .vm files. The output is a single .asm file.

To run test scripts, launch the nand2tetris CPU Emulator, available in the tools directory from the nand2tetris website.

About

A virtual machine translator which translates compiled Jack code into Hack Assembly; implemented in Python.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages