Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tairasu/hack-assembler
Hack Assembler written in Rust
https://github.com/tairasu/hack-assembler
assembler hack nand2tetris nand2tetris-assembler rust
Last synced: about 1 month ago
JSON representation
Hack Assembler written in Rust
- Host: GitHub
- URL: https://github.com/tairasu/hack-assembler
- Owner: tairasu
- License: mit
- Created: 2024-05-02T06:23:44.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2024-05-04T14:46:27.000Z (8 months ago)
- Last Synced: 2024-10-12T20:41:17.829Z (3 months ago)
- Topics: assembler, hack, nand2tetris, nand2tetris-assembler, rust
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Nand2Tetris Assembler in Rust
A Nand2Tetris Assembler written in Rust! This assembler is designed to translate assembly language from the Nand2Tetris course (`.asm` files) into binary code (`.hack` files), allowing you to run your Hack assembly programs on the Hack hardware platform.
## Getting Started
### Prerequisites
Before you can use this assembler, you need to have Rust installed on your machine. If you don't have Rust installed, you can download it from [the Rust website](https://www.rust-lang.org/tools/install).
### Building the Assembler
To build the assembler, you will use Cargo, Rust's package manager and build system. Simply follow these steps:
1. Clone this repository to your local machine using Git:
```sh
git clone [email protected]:tairasu/hack-assembler.git
```2. Navigate into the project directory:
```sh
cd hack-assembler
```3. Build the project using Cargo:
```sh
cargo build --release
```
The `--release` flag builds the assembler in release mode, which optimizes the binary for performance.### Running the Assembler
After building the assembler, you can use it to convert `.asm` files to `.hack` binary files.
To run the assembler, use the following command:
```sh
./rust-assembler
```Replace `` with the path to your `.asm` file. The assembler will generate a `.hack` file in the same directory as your `.asm` file.
## Examples
Assuming you have an assembly file named `Max.asm` in your current directory, you can assemble it into a binary file named `Max.hack` with the following command:
```sh
./rust-assembler Max.asm
```## License
Distributed under the MIT License. See `LICENSE` for more information.
## Acknowledgments
- This project is inspired by the Nand2Tetris course, and it's dedicated to everyone involved in creating and maintaining this resource.