Giter VIP home page Giter VIP logo

hack-assembler's Introduction

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.

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:

    git clone [email protected]:tairasu/hack-assembler.git
  2. Navigate into the project directory:

    cd hack-assembler
  3. Build the project using Cargo:

    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:

./rust-assembler <filepath>

Replace <filepath> 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:

./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.

hack-assembler's People

Contributors

tairasu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.