MIPS 中应该保留哪些寄存器?

发布于 2024-10-20 06:42:56 字数 49 浏览 7 评论 0原文

在MIPS中,哪些寄存器应该保留在堆栈上以防止数据丢失。 (TSAV-RA 寄存器)

in MIPS which registers should be preserved on stack to prevent data loss. (T-S-A-V-RA REGISTERS)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

天生の放荡 2024-10-27 06:42:56

根据我的 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文