func 在 R-Format 指令集中意味着什么?
我对汇编语言非常陌生。我正在阅读有关MIPS架构的内容,但我对寄存器格式(R-Format)的最后一个字段感到困惑。这是它的视觉表现, 谁能帮我解决第六个字段的含义以及我们如何计算它? 提前致谢。
I am very new to Assembly language. I was reading about MIPS architecture and I am stuck with the last field of the Register Format (R-Format). Here is its visual representation,
Can anyone please help me out with what does the sixth field means and how do we calculate it?
Thanks in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
正如描述中提到的,所有 R 类型指令(例如
ADD
、AND
、SLL
等)都有 6 个最高有效位 (= op)设置为 0,这意味着区分它们的唯一方法是查看 6 个最低有效位 (= funct)。换句话说,它们决定指令类型。也许一个例子会有所帮助:has:
编码将是:
例如,
XOR
(另一种 R 类型)指令函数是0b100110 = 0x26 = 38
。因此,您可以通过查找要编码的指令来“计算”它。(取自 MIPS 指令参考)。
As the description mentions all R-type instructions (e.g.
ADD
,AND
,SLL
and others) have the 6 most significant bits (= op) set to 0, that means the only way to distinguish between them is to look at the 6 least significant bits (= funct). In other words they determine the instruction type. Perhaps an example will help:has:
The encoding will thus be:
For e.g.
XOR
(another R-type) instruction funct is0b100110 = 0x26 = 38
. So you "calculate" it by looking up what instruction you want to encode.(taken from MIPS Instruction Reference).
从下表:
http://en.wikibooks.org/wiki/MIPS_Assembly/Instruction_Formats#Opcodes
几乎所有R-Type指令的操作码都是00,所以该函数选择ALU函数。
From following table:
http://en.wikibooks.org/wiki/MIPS_Assembly/Instruction_Formats#Opcodes
Almost All R-Type instruction's opcode is 00, so the funct select the ALU function.