Operating System Design :: Projects :: The Assembler
Problem
Write an Assembler program that translates programs written in the symbolic Hack assembly language into binary code that can execute on the Hack hardware platform built in the previous projects.
There are three ways to describe the desired behavior of your assembler:
- When loaded into your assembler, a Prog.asm file containing a valid Hack assembly language program should be translated into the correct Hack binary code and stored in a Prog.hack file.
- The output produced by your assembler must be identical to the output produced by the Assembler software.
- Your assembler must implement the translation specification given in Chapter 6, Section 2.
Chapter 6 includes a proposed, language-independent Assembler API, which can serve as your implementation's blueprint. You should build the assembler in two stages. First, write a basic assembler designed to translate assembly programs that contain no symbols. Next, extend your basic assembler with symbol handling capabilities, yielding the final assembler. The test programs are designed to support this staged implementation strategy and come in two versions: one that supports symbols and one that does not support symbols.