开发者

Integer Overflow IA 32

开发者 https://www.devze.com 2022-12-12 01:51 出处:网络
How does overflo开发者_开发问答w work in ia-32? For instance, what would happen to the following code? What flags would it throw?

How does overflo开发者_开发问答w work in ia-32?

For instance, what would happen to the following code? What flags would it throw?

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

Thanks!


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消