This project involves building an assembler that translates Hack assembly language (.asm
files) into Hack binary code (.hack
files). The assembler is a critical component of the Nand2Tetris course, bridging the gap between low-level symbolic language and executable binary code.
- First Pass: Builds a symbol table for labels.
- Second Pass: Generates binary code for each instruction.
- Input:
Prog.asm
(Hack assembly file) - Output:
Prog.hack
(Hack binary file)
Existing output files are automatically overridden.
-
Clone the Repository
Clone the repository from the provided URL. -
Run the Assembler
Translate an.asm
file into a.hack
file by running the assembler. -
Test the Output
Use the CPU Emulator to load the generated.hack
file and verify its execution.