gpt4 book ai didi

assembly - 在MIPS中,有符号加法、无符号加法、有符号减法和无符号减法有什么区别?

转载 作者:行者123 更新时间:2023-12-04 05:54:00 25 4
gpt4 key购买 nike

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/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com