suppose we use the addl instruction to perform the equivalent of the C expression "t=a+b",where a,b,t are variables of type int,then the conditional code will be set according to the following C expression:
CF: (unsigned t) < (unsigned a) Unsigned Overflow
ZF: (t==0) Zero
SF: (t<0) Negative
OF: (a<0 == b<0) && (t<0 != a<0) Signed Overflow
Quted from a computer system textbook.
- CF is the carry flag.
- ZF is the zero flag.
- SF is the sign flag.
- OF is the overflow flag.
i can't figure out why these C expressions have the effect mentioned above.for example,why the expression (t<0) will set the SF flag?? t<0 is either true,or false(since the textbook only told the type of these variables),but why the sign flag has been set?I'm really confused,please help..thanks!