Which registers should be preserved in MIPS?
in MIPS which registers should be preserved on st开发者_JAVA技巧ack to prevent data loss. (T-S-A-V-RA REGISTERS)
According to my MIPS reference sheet, the following registers are callee-saves (have to be preserved by the called function) while the rest are caller-saves (aren't required to be preserved by a called function):
$s0 - $s7
(registers 16-23), the saved temporaries$gp
(register 28), the global pointer$sp
(register 29), the stack pointer$fp
(register 30), the frame pointer$rp
(register 31), the return address
(Note, $rp
is listed as not saved in other versions of the cheat sheet.)
Source: Computer organization and design
精彩评论