MIPS program jr $ra instructions and stack handling

On function entry, ra holds the return address where our caller wants us to jump when we’re done. The function preamble saves it to the stack because the function body uses jal to make function calls. jal overwrites ra so we need to save/restore our own return address around that. When the function is complete we can restore the things we saved, then … Read more