Possible Duplicate:
about assembly CF(Carry) and OF(Overflow) flag
I'm trying to see if carry occurs after adding two unsigned dwords.
like this:
add edx, eax ; edx will hold the numeric value
wait ; not really needed
jc bad ; jmp to bad if carry bit is set
jo bad ; jmp to bad if overflow bit is set (Yes for signed)
However, neither the overflow flags or carry flags are set accordingly. For testing purposes I do make sure that the addition will result in a value too big for 32bit reg. (after adding, the values wrap around)
How do I check if the two numbers added together will result in overflow?