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.
正如描述中提到的所有 R 类型指令(例如ADD
, AND
, SLL
和其他)的 6 个最高有效位 (= op) 设置为 0,这意味着区分它们的唯一方法是查看 6 个最低有效位 (= funct)。换句话说,它们决定指令类型。也许一个例子会有所帮助:
ADD $1, $2, $3
has:
op = 0 (as all R-type instructions)
rs = 2
rt = 3
rd = 1
shamt = 0
funct = 0x20 = 0b00000100000 = 32
因此,编码将是:
0000 0000 0100 0011 0000 1000 0010 0000
例如XOR
(另一种R型)指令函数是0b100110 = 0x26 = 38
。因此,您可以通过查找要编码的指令来“计算”它。
(取自MIPS指令参考 http://www.mrc.uidaho.edu/mrc/people/jff/digital/MIPSir.html).
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)