This is a group assignment that will generally be done during class time. The goal is to identify (largely in pseudocode form) what instructions are generated by different IR tree nodes.
Working in groups,
extend Muncher.java
to cover the
expressions and statements needed to generate MIPS code for MiniJava. This
will mean writing code for munchMove
, munchStm
,
and munchExp
.
Note: generating executable code requires register allocation. For this assignment, assume that identifying temporaries for sources/destinations of instructions is adequate, and that a temporary is always mapped to a register.
Muncher.java
), the
conditional jump instructions (CJUMP), and the expressions (CALL or
BINOP). See the distributed CJUMP.java
and BINOP.java
files (in the project files for AS4,
specifically in
the Tree folder
) for the meanings of these
numbers. Some instructions may have multiple modes depending on whether
the argument is computed or a constant.