Compare commits

..

1 Commits

Author SHA1 Message Date
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
3 changed files with 10 additions and 3 deletions

1
.gitignore vendored
View File

@@ -1,3 +1,4 @@
out out
hack-assembler hack-assembler
build build
.cache

View File

@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.18) cmake_minimum_required(VERSION 3.18)
set(NAME "hack-assembly") set(NAME "hack-assembler")
project(${NAME} CXX) project(${NAME} CXX)
set(CMAKE_CXX_STANDARD 17) set(CMAKE_CXX_STANDARD 17)

View File

@@ -1,6 +1,6 @@
# hack-assembler # hack-assembler
An implementation of a hack assembler in C++. An implementation of a hack assembler in C++, based on the project 6 of the [nand2tetris course](https://www.nand2tetris.org/https://b1391bd6-da3d-477d-8c01-38cdf774495a.filesusr.com/ugd/44046b_89a8e226476741a3b7c5204575b8a0b2.pdf).
## Compilation ## Compilation
@@ -12,9 +12,15 @@ cmake --build build
## Usage ## Usage
```bash ```bash
g++ -o hack-assembler main.cpp
cat <input_file.asm> | ./hack-assembler > ./out/<output_file.hack> 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](https://nand2tetris.github.io/web-ide/cpu/).
## References
- [nand2tetris course](https://www.nand2tetris.org/)
## License ## License
This project is under the WTFPL License. See [LICENSE](LICENSE) for details. This project is under the WTFPL License. See [LICENSE](LICENSE) for details.