Comment Comment by pavehawk2007 A and T are "caller saved", meaning that if I want their value after I make a function call, I, the caller, must save the registers. So,li t0, 10 call somefunc # Must consider t0 destroyed here unless we save it firstThe saved registers are different li s0, 10 call somefunc # Can consider s0 = 10 here.However, if we use the s registers, we have to make sure we put it back the way we found it. So, before li s0, 10, I need to save the old value of s0. parent pavehawk2007 5 years ago
li t0, 10 call somefunc # Must consider t0 destroyed here unless we save it first
The saved registers are different li s0, 10 call somefunc # Can consider s0 = 10 here.
However, if we use the s registers, we have to make sure we put it back the way we found it. So, before li s0, 10, I need to save the old value of s0.