Next: TC-7 FAQ, Previous: TC-7 Given Code, Up: TC-7 [Contents][Index]
There is not much code to write:
Codegen
(src/target/mips/call.brg,
src/target/mips/move.brg):
complete some rules in the grammar of the code generator produced by
MonoBURG.
SpimAssembly::move_build
(src/target/mips/spim-assembly.cc):
build a move instruction using MIPS R2000 standard instruction set.
SpimAssembly::binop_inst
, SpimAssembly::binop_build
(src/target/mips/spim-assembly.cc):
build arithmetic binary operations (addition, multiplication, etc.)
using MIPS R2000 standard instruction set.
SpimAssembly::load_build
, SpimAssembly::store_build
(src/target/mips/spim-assembly.cc):
build a load (respectively a store) instruction using MIPS
R2000 standard instruction set. Here, the indirect addressing mode is
used.
SpimAssembly::cjump_build
(src/target/mips/spim-assembly.cc):
translate conditional branch instructions (branch if equal, if lower
than, etc.) into MIPS R2000 assembly.
strcmp
streq
print_int
substring
concat
Information on MIPS R2000 assembly instructions may be found in SPIM manual.
Completing the following routines will be needed during register allocation only (see TC-9):
Codegen::rewrite_program
(src/target/mips/epilogue.cc)