In: Computer Science
How to write fill.asm code (hack assembly)
These are the steps you need to follow:-
1.Use a plain text editor to write the first assembly program. You can do it by loading and editing the supplied mult/Mult.asm file.
2. Use the supplied Assembler (in either batch or interactive mode) to translate your program. If you get syntax errors, go to step 1. If there are no syntax errors, the assembler will produce a file called mult/Mult.hack, containing binary instructions written in the Hack machine language.
3. Use the supplied CPU Emulator to load, and then test, the translated Mult.hack code. This can be done either interactively, or batch-style using the supplied Mult.tst script. If you get run-time errors, go to step 1.
4. Repeat steps 1–3 for the second program (Fill.asm), working in the fill directory. Implementation tip: If you’re struggling with the Fill.asm program’s “smooth user experience” logic, implement it first without this logic and get that working. Then, work on adding this logic. At the worst, you’ll lose 10 points for not having this logic working.
Note:- Debugging tip:- The Hack language is case-sensitive. A common error occurs when one writes, say, @foo and @Foo in different parts of the program, thinking that both labels are treated as the same symbol. In fact, the assembler treats them as two different symbols. This is a nasty, difficult-to-detect bug.