Some basic trouble......
How do ADD and SUB update the OF and CF;
When does SUB set the OF to 1;
What is the meaning of OF ,when we make Addition or Substraction?
Posted on 2005-11-13 19:36:39 by iNeedSpeed
    You need to read this thread, then ask questions.  Ratch

Posted on 2005-11-13 22:55:51 by Ratch
Thank U!
Sorry, I could not connect to the page :sad:
Posted on 2005-11-14 03:32:49 by iNeedSpeed
  I just tried the link, and it connects fine.  Try again, or attempt it with another another ISP. Ratch
Posted on 2005-11-14 11:11:17 by Ratch
I think China's firewall are hardy.  ;)

Suppose I can operate only on one-byte operands.

Consider two values:

Value 1:  0111_1111
Value 2:  1111_1111

Basically, OF is set when the sign bit of the destination register does not match the expected sign. (-127) - 2 = -129 = 127 (truncated to 8 bits). We have signed overflow. However, -127 = 129 (unsigned 8 bits), so 129 - 2 = 127. There is no unsigned overflow (borrow).

The CF will be set if there is a carry out or a borrow in of the MSB (bit 7, sign bit).  The OF will be set when the carry out of bit 7 is NOT matched by a carry in from bit 6 OR a borrow in of bit 7 is NOT matched by a borrow out to bit 6.
Posted on 2005-11-14 11:48:59 by roticv
thank you for all my friends.
Posted on 2005-11-14 23:05:49 by iNeedSpeed