- Bison version 3.7.6
- Flex version 2.6.4
Run make
command.
Run ./compiler [Filename]
.
The output will be stored in [filename].out
.
- We use
$s1
as the base refrence of our local variables. - We use
$s0
as the base refrence of our global variables. - S registers are callee preserved.
- We use
JALR
for function calls. Return address is stored in$ra
. - We use
$t
registers for computation purposes. These registers are caller preserved.
- We use stack for the calculations and storing variables.
- return value
- return address (go to caller)
- preserved registers value (
$s[0-1]
) - local variables (including args)
First the caller put the input arguments on top of stack. and then calls the callee. The callee then stores the return address. Before returning, the callee brings the stack pointer on return value.