A machine language assembler for the 16-bit Hack assembly language, implemented as part of the Nand2Tetris course. The assembler takes a .asm file and outputs a .hack file which can be loaded into the Hack computer.
Successful comparison of compiled Pong.hack test program to the official Hack Assembler's output:
- Place your .asm file into the same directory as the hack assembler.
- Run the hack assembler and pass Filename.asm as a command-line argument (e.g.: Pong.asm).
- The assembler will compile the resulting .hack file to the same directory as the assembler, in the format: Filename.hack (e.g.: Pong.hack).
- The resulting file can then be loaded into the Hack computer or tested using the steps below.
Load the compiled .hack file into the Hack Computer's online assembler and compare the results to the built-in example programs.
For convenience, three test asm files (Max.asm, Rect.asm, and Pong.asm) used by the online assembler are copied from the HackAssemblyFiles folder to the build directory when the project is compiled.