Skip to content

senhorsolar/hack-assembler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hack-assembler

A Hack assembler in OCaml. A program that translates assembly code for the Hack computer into its binary representation.

This is project 6 of the Nand to Tetris course.

To run the program, run the following

dune exec -- ./assembler.exe <filename>.asm

where <filename>.asm is the assembly file you wish to translate. The file <filename>.hack should be created.

To run the tests, run

dune runtest

Parsing/Lexing

The parsing library menhir, and the lexing library ocamllex, are used to extract the A-instructions, C-instructions, and Labels. It's probably overkill, but it was quite simple to setup after following chapter 10 of this book about functional programming in OCaml.

Dependencies

opam install base core menhir stdio

About

A Hack assembler in OCaml. A program that translates assembly code for the Hack computer into its binary representation.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors