Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以我正在使用 SPIM 模拟器学习 MIPS,并且我一直在解决这个问题。
我想添加两个 64 位数字,它们存储在四个 32 位寄存器中。所以我添加了 LO 字节,然后添加了进位和 HI 字节。但是没有 adc/addc 命令,即带进位加法。
所以我必须在状态寄存器中添加进位位。但是,我究竟如何读取这个寄存器?
如果 $t0 是临时寄存器 1,那么保存进位标志的状态寄存器等价于什么?
我用谷歌搜索了很多我仍然找不到任何甚至使用状态寄存器的例子。
加 $t2 $t3 + $t4 $t5,得到 $t0 $t1
addu $t1, $t3, $t5 # add least significant word sltu $t0, $t1, $t5 # set carry-in bit addu $t0, $t0, $t2 # add in first most significant word addu $t0, $t0, $t4 # add in second most significant word
对于您问题的第二部分,没有状态寄存器。一个都没有。纳达。