Transforms Hack Assembly into Hack Machine Language
Go to file
Collin J. Doering a3f12e21d1 Cabalized and modularized project
Additionally, added scaffolding for the future implementation of a test
suite, as well as TODO markers for documentation.

Signed-off-by: Collin J. Doering <collin.doering@rekahsoft.ca>
2015-06-16 18:33:26 -04:00
doc/examples Cabalized and modularized project 2015-06-16 18:33:26 -04:00
src Cabalized and modularized project 2015-06-16 18:33:26 -04:00
testsuite Cabalized and modularized project 2015-06-16 18:33:26 -04:00
.gitignore Cabalized and modularized project 2015-06-16 18:33:26 -04:00
Asmblr.cabal Cabalized and modularized project 2015-06-16 18:33:26 -04:00
LICENSE Cabalized and modularized project 2015-06-16 18:33:26 -04:00
README.md Cabalized and modularized project 2015-06-16 18:33:26 -04:00
Setup.hs Cabalized and modularized project 2015-06-16 18:33:26 -04:00

README.md

Hack Assembler in Haskell

Asmblr is a small Haskell program that transforms Hack Assembly into its machine language representation.

Features

  • Follows a similar structure to the implementation describe by the Nand to Tetris book
  • Faster then the implementation given with the Nand to Tetris course
  • Can read from stdin and write to stdout (if requested)
  • Uses open-source tools wherever possible

Building

Asmblr requires GHC and cabal to be built and can be done like so:

$ cabal configure
$ cabal build

Once built, the Asmblr executable will be in the dist/build/Asmblr folder, and can be run using cabal, or your shell. The Asmblr program can also be installed using cabal install. For more information on installing cabal packages and using cabal see its manual.

Tools

The creation of this software was made possible by the following open source tools and libraries.

  • Gnu Emacs, because there is no place like home; and no greater editor!
  • GHC, for compilation of Haskell code
  • Cabal, for building the project

License

This project is licensed under the GPLv3. Please see the LICENSE file for full details.

Issues

There are some minor issues that can be cleaned up in future releases. Namely, making error output more human readable, and a few minor optimization's.

  • Explicitly handle if input file dne or is unreadable
  • Explicitly handle if output file is un-writable
  • Create ParseException type to throw from parser and can be caught in Asmblr.defaultMain
  • Add ( "error description") throughout parsers to make error output more readable
  • Re-factor cInstrDest and cInstrAluOps to remove unneeded use of 'try' for optimization's sake
  • Write tests so that future changes don't break things (see folder testsuite)