mips汇编问题
有谁知道CPU如何确定哪个寄存器应该接收指令产生的结果?
有人吗???
does anyone know how the CPU determines which register should receive the result produced by an instruction?
anyone???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
这取决于指令。许多指令将目标寄存器作为参数,而其他指令则定义了结果存储位置的行为。例如ADD指令:
$s + $t的结果存入$d
这是完整的参考
That would depend on the instruction. Many instructions take the destination register as an argument, and others have defined behavior as to where a result is stored. For example, the ADD instruction:
The result of $s + $t is stored into $d
Here is the full reference
它被编码在指令中。例如,“add”采用 dest、op1、op2,并且 dest = op1+op2。
请参阅有关 MIPS 架构的维基百科页面
It's encoded in the instruction. For example, "add" takes dest, op1, op2 and does dest = op1+op2.
See Wikipedia's page on MIPS architecture
对于添加或配音等基本指令,您需要定义它所在的寄存器。 mul 和 div 指令将值放入 hi 和 lo 寄存器中。
For basic instructions like an add or a dub you need to define the register it goes into. mul and div instructions put values in hi and lo registers.