This is a virtual machine translator built in Rust. It converts Hack VM code to Hack assembly. This implements the Hack virtual machine. It translates memory access, arithmetic, branching and function VM commands to Hack assembly.
git clone https://github.com/youngancient/HackVM.gitcd HackVMcargo build --releasePass one or more .vm files as arguments (Max 10 args)
cargo run -- ./input/BasicTest.vm ./input/PointerTest.vmOR
cargo run -- "./input/BasicTest.vm" "./input/PointerTest.vm"Using the quotes "file_path" helps to prevent the user from mistakenly joining the two or more filepaths together while results in invalid file referencing.
If the input files are in the Root directory of this project, you can reference them directly:
cargo run -- BasicTest.vm PointerTest.vmThe Output .asm files will be created in the output/ directory which is automatically created if it does not exist.