add rd, rs, rt
addu rd, rs, rt
sub rd, rs, rt
subu rd, rs, rt
在MIPS中,有符号加法、无符号加法、有符号减法和无符号减法有什么区别?如果它们的结果相同,那么归类为使用有符号和无符号方法有什么意义?
最佳答案
u
只是意味着他们不会因溢出而陷入困境。
引自“MIPS32 Architecture For Programmers Volume II”:
The term "unsigned" in the instruction name is a misnomer; this operation is 32-bit modulo arithmetic that does not trap on overflow. This instruction is appropriate for unsigned arithmetic, such as address arithmetic, or integer arithmetic environments that ignore overflow, such as C language arithmetic.
关于assembly - 在MIPS中,有符号加法、无符号加法、有符号减法和无符号减法有什么区别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19544539/