frogger:
jal teechar
jal update_frog
lw $t0,game_indicator
li $t0, 0
Okay, this is the function. I have teechar and update_frog functions completely written and working. I understand the first two bullets but not sure on the last two. How would i write the last two bullets in MIPS?
HERE IS FUNCTION Instructions:
Write a MIPS function frogger that takes no arguments, and returns a character (to make testing easier). It does the following:
Here is my code:
frogger:
jal teechar
jal update_frog
Sorry I am just having trouble thinking about how to do this :(
For the sake of a global variable, either you have to pass the arguement or use a special purpose register. Since you have specified the function takes no args, you will have to reserve a register to hold the value of c whenever frogger is called, which would then read the value from that register.
Its not a clean solution from the high level programming language, but you are in assembly right now and might as well get your hands dirty!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With