2

在 ia-32 中溢出是如何工作的?

例如,下面的代码会发生什么?它会抛出什么旗帜?

movl $0x1, %eax
addl $7fffffff, %eax

谢谢!

4

1 回答 1

2

If memory serves, addition sets the overflow flag is set when the sign bit changes without the carry bit being set. 1 + 0x7FFFFFFF would set overflow, clear carry, and clear zero.

于 2009-11-19T01:00:14.900 回答