
<
2
.75
7UGT U/CPWCN
+PUVTWEVKQP5GV
=L/2*
7/<:
Sign Flag
(S)
5
R/W
The Sign Flag stores the value of the most significant bit of a
result following an arithmetic, logical, rotate, or shift operation.
When performing arithmetic operations on signed numbers,
binary two’s-complement notation is used to represent and
process information. A positive number is identified by a
0
in
the most significant bit position (bit
7
); therefore, the Sign Flag
is also
0
.
A negative number is identified by a
1
in the most significant bit
position (bit
7
); therefore, the Sign Flag is also
1
.
The Sign Flag is not effected by
RESET.
Overflow
(V)
4
R/W
For signed arithmetic, rotate, and shift operations, the Overflow
Flag is set to
1
when the result is greater than the maximum
possible number (
>127
) or less than the minimum possible
number (
<−
128
) that can be represented in two’s-complement
form . The Overflow Flag is cleared to
0
if no overflow occurs.
Following logical operations the Overflow Flag is cleared to
0
.
The Overflow Flag is not effected by
RESET
.
Decimal
Adjust
Flag (D)
3
R/W
The Decimal Adjust Flag is used for
BCD
arithmetic. Since the
algorithm for correcting
BCD
operations is different for addition
and subtraction, this flag specifies what type of instruction was
last executed so that the subsequent Decimal Adjust (
DA
) oper-
ation can function properly. Normally, the Decimal Adjust Flag
cannot be used as a test condition.
After a subtraction, the Decimal Adjust Flag is set to
1
.
Following an addition it is cleared to
0
.
The Decimal Adjust Flag is not effected by
RESET
.
Half-
Carry
Flag (H)
2
R/W
The Half Carry Flag is set to
1
whenever an addition generates
a carry out of bit
3
(Overflow) or a subtraction generates a
“borrow into” bit
3
. The Half Carry Flag is used by the Decimal
Adjust (
DA
) instruction to convert the binary result of a previous
addition or subtraction into the correct decimal (
BCD
) result. As
in the case of the Decimal Adjust Flag, the user does not
normally access this flag.
The Half Carry flag is not effected by
RESET
.