- 论坛徽章:
- 0
|
原帖由 beepbug 于 2007-4-22 21:14 发表于 7楼
你看看CPU做加法如何判断溢出吧。
我学的早,过去是用的变形码。现在可能不同了。
汗~~~
你自己看
Intel 的文档:
- The ADD instruction performs integer addition. It evaluates the result for both signed
- and unsigned integer operands and sets the OF and CF flags to indicate a carry (overflow)
- in the signed or unsigned result, respectively. The SF flag indicates the sign of
- the signed result.
复制代码
AMD 的文档:
- This instruction evaluates the result for both signed and unsigned data types and sets the OF and CF
- flags to indicate a carry in a signed or unsigned result, respectively. It sets the SF flag to indicate the
- sign of a signed result.
复制代码 |
|