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.
只有一个存储字节指令,所以我不明白为什么同时存在加载字节和加载字节无符号......
我试图寻找它,但找不到任何有用的东西。
MIPS 寄存器为 32 位宽。当您将单个 8 位字节从内存加载到其中一个寄存器中时,您必须决定是否对其进行符号扩展。因此有两个加载指令。存储时,没有这样的歧义。
加载示例:
.data variable: .byte 0x80 .text lb $t0, variable lbu $t1, variable
此代码运行后,t0将为0xffffff80(-128) 和t1( 0x00000080128)。
t0
0xffffff80
t1
0x00000080