An implementation of a hack assembler in C++.
  • Assembly 97.6%
  • C++ 2.2%
  • CMake 0.2%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
lejulien 4afdcd1660 Cleanup the project
* Add .cache to gitignore (for the nlohmann::json library)
* Fix the project name
* Update the readme
2026-06-03 10:17:03 +02:00
asm-samples asm-samples: remove heavy .hack files 2026-06-02 11:21:46 +02:00
.gitignore Cleanup the project 2026-06-03 10:17:03 +02:00
CMakeLists.txt Cleanup the project 2026-06-03 10:17:03 +02:00
LICENSE Initial commit 2026-05-19 13:43:47 +00:00
main.cpp Add symbol support 2026-06-02 15:59:28 +02:00
README.md Cleanup the project 2026-06-03 10:17:03 +02:00
symbols.json Add predefined symbols in a json 2026-05-19 19:25:49 +02:00

hack-assembler

An implementation of a hack assembler in C++, based on the project 6 of the nand2tetris course.

Compilation

cmake -S . -B build
cmake --build build

Usage

cat <input_file.asm> | ./hack-assembler > ./out/<output_file.hack>

Testing

In order to check the assembler, you can generate the .hack files from the asm-samples directory. And test those within nand2tetris CPU emulator.

References

License

This project is under the WTFPL License. See LICENSE for details.