|
|
|
|
|
In Mips/Codegen.java, line 85 |
|
Notice how a number of possible MOVE
tiles are tested for |
|
Two tiles starting at line 175 don’t
emit any code yet |
|
Fill these in |
|
What instruction do you need? Look in SPIM manual? |
|
How will you marshal the necessary
operands? |
|
Remember options of OPER, MOVE, LABEL –
consult book if you’re unsure of the difference |
|
Be sure to write a program that will
make use of these two tiles – to test if you’ve got it right |
|
|
|
|
|
|
|
In Mips/Codegen.java, at the end |
|
Read up on the calling convention… |
|
What series of instructions do you
require here? |
|
What might munchArgs be doing? |
|
Hints! |
|
Pass the static link in the result
register |
|
What arguments are passed in registers
– and which registers to use? |
|
Read manual, and look at
Mips/MipsFrame.java |
|
Pass additional arguments on the stack
– they go ABOVE the stack pointer of the current frame |
|
Remember space is allocated for all
arguments – even though the first four are passed in registers |
|
How is the system recording the maximum
number of arguments ever required in a fn call from this frame? |
|
|