MIPS 中应该保留哪些寄存器?
在MIPS中,哪些寄存器应该保留在堆栈上以防止数据丢失。 (TSAV-RA 寄存器)
in MIPS which registers should be preserved on stack to prevent data loss. (T-S-A-V-RA REGISTERS)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
根据我的 MIPS 参考表,以下寄存器是被调用者 -保存(必须由被调用函数保存),而其余的是调用者保存(不需要由被调用函数保存):
$s0 - $s7
(寄存器 16-23) 、保存的临时变量$gp
(寄存器28)、全局指针$sp
(寄存器29)、堆栈指针$fp
(寄存器30) )、帧指针$rp
(寄存器 31)、返回地址(注意,
$rp
被列为未保存在 备忘单的其他版本。)来源: 计算机组织和设计
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