Skip to content

markjamesm/HackAssembler

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hack Assembler

A machine language assembler for the 16-bit Hack assembly language, implemented as part of the Nand2Tetris course. The assembler takes a .asm file and outputs a .hack file which can be loaded into the Hack computer.

Successful comparison of compiled Pong.hack test program to the official Hack Assembler's output:

Successful comparison of Pong.hack

Instructions

  1. Place your .asm file into the same directory as the hack assembler.
  2. Run the hack assembler and pass Filename.asm as a command-line argument (e.g.: Pong.asm).
  3. The assembler will compile the resulting .hack file to the same directory as the assembler, in the format: Filename.hack (e.g.: Pong.hack).
  4. The resulting file can then be loaded into the Hack computer or tested using the steps below.

Testing

Load the compiled .hack file into the Hack Computer's online assembler and compare the results to the built-in example programs.

For convenience, three test asm files (Max.asm, Rect.asm, and Pong.asm) used by the online assembler are copied from the HackAssemblyFiles folder to the build directory when the project is compiled.

About

Machine language assembler for the Hack Assembly language.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages