CS 327 Homework 4
- Due Date
- 4:00 pm Friday October 12
- Assignment Names
- hw4
- File Names
- ast.c error.c list.c pool.c sc.c testlexer.c codegen.c lexer.c parser.c reserved.c testparser.c ast.h codegen.h debug.h error.h lexer.h list.h parser.h pool.h reserved.h Makefile
Replace the stack code generator with one that generates arm assembly code.
Continue to print out the stack machine instructions, but preceded by a comment symbol, so that they document the arm instructions. Follow each of the commented stack instructions with arm instructions that implement them.
For labels, just print an actual label instead of the commented stack LBL instruction.
You will, of course, need to print a prologue and epilogue containing all of the assembly boilerplate that you need at the top and bottom, including the main function entry and exit code and the data and rodata sections.
Write the output into a .s file rather than a .sm file and make sure it assembles and runs.