Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/teleivo/hack-assembler

Assembler for the Hack assembly language https://www.nand2tetris.org/project06
https://github.com/teleivo/hack-assembler

assembler hack nand2tetris

Last synced: 1 day ago
JSON representation

Assembler for the Hack assembly language https://www.nand2tetris.org/project06

Awesome Lists containing this project

README

        

# Hack Assembler (nand2tetris)

Hi 😁 this is one of my learning projects, an assembler for the Hack assembly language.
The language is defined in https://www.nand2tetris.org/project04. The assembler project itself is
documented in https://www.nand2tetris.org/project06.

https://www.nand2tetris.org is an amazing course 🤩 !

## Quickstart

To run the assembler once do

```go
go run cmd/assembler/main.go testdata/Add.asm
```

otherwise build the above into a binary 😄 .

The machine code is written as text instead of binary as that is what was required in
https://www.nand2tetris.org/project06.

## Tests

I added ample tests written in Go for the parsing and translation logic. The machine code generated
by this repos assembler is identical to the machine code generated by
https://www.nand2tetris.org/project06 for the given sample programs. There might of course still be
bugs. Please let me know if you find one 😅 .

## Resources

* https://www.nand2tetris.org - you can find the Nand2Tetris course on coursera
* https://interpreterbook.com - is an amazing book I went through before Nand2Tetris from which I
remembered some bits about a possible structure and readable tests