Re: A92: Question about flags...


[Prev][Next][Index][Thread]

Re: A92: Question about flags...




Benoit,

The overflow condition flag (V) is set if the instruction resulted
in an overflow... that is to say, if the most significant bit (MSB)
was changed by an instruction such as ASL, ASR, LSL, or LSR
this flag is cleared when an instruction such as AND, EOR, NOT, OR,
MOVE, MUL, TST, or CLR is executed.

The carry condition flag (C) will have the SAME VALUE as the extend
condition flag (X) when an NEG, ADD, SUB, ASl, ASR, LSL, or LSR
is executed. Additionally the carry condition flag will be set
if SUB "borrows" from ANY bit during the subtraction.

The extend condition flag (X) is set if ADD generats a "carry"
when adding two MSBs.  That is to say, the result is bigger
than what can be stored, so for example, two words added together
might need a longword to store the sum.  In that case, the X bit
would be set.  The extend condition flag (X) is also set if
SUB borrows from the MSB.

This flag is undefined when AND, EOR, NOT, OR, MOVE, CLR, CMP,
DIV, MUL, or TST is executed.
The contents will be the same a the zero flag (Z) when a NEG
instruction is executed.
The contents will be the same as the LAST bit shifted out of
the operatnd with the ASL, ASR, LSL, and LSR instructions.

Hope this helps.

-Kevin Van Vecthen
kevinvv@usa.net