Intel 8XC196K Series User Manual page 443

Table of Contents

Advertisement

8XC196K x , J x , CA USER'S MANUAL
Mnemonic
C
The carry flag is set to indicate an arithmetic carry from the MSB of the ALU or the state of
the last bit shifted out of an operand. If a subtraction operation generates a borrow, the
carry flag is cleared.
C
0
1
Normally, the result is rounded up if the carry flag is set. The sticky bit flag allows a finer
resolution in the rounding decision.
C ST
0 0
0 1
1 0
1 1
N
The negative flag is set to indicate that an operation generated a negative result. It is
correct even if an overflow occurs. For all shift operations and the NORML instruction, the
flag is set or cleared to equal the most-significant bit of the result, even if the shift count is
zero.
ST
The sticky bit flag is set to indicate that, during a right shift, a "1" has been shifted into the
carry flag and then shifted out. This bit is undefined after a multiply operation. The sticky
bit flag can be used with the carry flag to allow finer resolution in rounding decisions. See
the description of the carry (C) flag for details.
V
The overflow flag is set to indicate that the result of an operation is too large to be
represented correctly in the available space.
For shift operations, the flag is set if the most-significant bit of the operand changes during
the shift.
For divide operations, the quotient is stored in the low-order half of the destination
operand and the remainder is stored in the high-order half. The overflow flag is set if the
quotient is outside the range for the low-order half of the destination operand. (Chapter 3,
"Programming ConsiderAtions," defines the operands and possible values for each.)
Instruction Quotient Stored in:
DIVB
DIV
DIVUB
DIVU
VT
The overflow-trap flag is set when the overflow flag is set, but it is cleared only by the
CLRVT, JVT, and JNVT instructions. This allows testing for a possible overflow at the end
of a sequence of related arithmetic operations, which is generally more efficient than
testing the overflow flag after each operation.
Z
The zero flag is set to indicate that the result of an operation was zero. For add-with-carry
and subtract-with-borrow operations, the flag is never set, but it is cleared if the result is
other than zero. Therefore, the zero flag indicates the correct zero or non-zero result for
multiple-precision calculations.
A-4
Table A-2. Processor Status Word (PSW) Flags
Value of Bits Shifted Off
< ½ LSB
≥ ½ LSB
Value of Bits Shifted Off
= 0
> 0 and < ½ LSB
= ½ LSB
> ½ LSB and < 1 LSB
Short-Integer
Integer
Byte
Word
Description
V Flag Set if Quotient is:
< –128 (81H) or > +127 (7FH)
< –32768 (8001H) or > +32767 (7FFFH)
> 255 (0FFH)
> 65535 (0FFFFH)

Advertisement

Table of Contents
loading

Table of Contents