Zilog Z8F0130 User Manual
Page 22

eZ8
™
CPU Core
User Manual
UM012820-0810
Architectural Overview
7
Zero Flag
For arithmetic and logical operations, the Zero (Z) flag is 1 if the result is
0. Otherwise, the Zero flag is 0. If the result of testing bits in a register is
00h
, the Zero flag is 1; otherwise, the Zero flag is 0. Also, if the result of
a rotate or shift operation is
00h
, the Zero flag is 1; otherwise, the Zero
flag is 0.
Sign Flag
The Sign (S) flag stores the value of the most-significant bit of a result
following an arithmetic, logical, rotate or shift operation. For signed num-
bers, the eZ8 CPU uses binary two’s complement to represent the data
and perform the arithmetic operations. A 0 in the most significant bit
position (Bit 7) identifies a positive number; therefore, the Sign flag is
also 0. A 1 in the most significant position (Bit 7) identifies a negative
number; therefore, the Sign flag is also 1.
Overflow Flag
For signed arithmetic, rotate or shift operations, the Overflow (V) flag is 1
when the result is greater than the maximum possible number (>127) or
less than the minimum possible number (<–128) that can be represented
with 8-bits in two’s complement form. The Overflow flag is 0 if no over-
flow occurs. Following logical operations, the Overflow flag is 0.
Following addition operations, the Overflow flag is 1 when the operands
have the same sign, but the result has the opposite sign. Following sub-
traction operations, the Overflow flag is 1 if the two operands are of
opposite sign and the sign of the result is same as the sign of the source.
Following rotation operations, the Overflow flag is 1 if the sign bit of the
destination operand changed during rotation.
Decimal Adjust Flag
The Decimal Adjust (D) flag is used for Binary-Coded Decimal (BCD)
arithmetic operations. Because the algorithm for correcting BCD opera-
tions is different for addition and subtraction, this flag specifies the type
- Z8F0131 Z8F0230 Z8F0231 Z8F0430 Z8F0431 Z8F043A Z8F0830 Z8F0831 Z8F083A Z8F1232 Z8F1233 Z8F0113 Z8F011A Z8F0123 Z8F012A Z8F0213 Z8F021A Z8F0223 Z8F022A Z8F0411 Z8F0412 Z8F0413 Z8F041A Z8F0421 Z8F0422 Z8F0423 Z8F042A Z8F0811 Z8F0812 Z8F0813 Z8F081A Z8F0821 Z8F0822 Z8F0823 Z8F082A Z8F0880 Z8F1621 Z8F1622 Z8F1680 Z8F1681 Z8F1682 Z8F2421 Z8F2422 Z8F2480 Z8F3221 Z8F3222 Z8F3281 Z8F3282 Z8F4821 Z8F4822 Z8F4823 Z8F6081 Z8F6082 Z8F6421 Z8F6422 Z8F6423 Z8F6481 Z8F6482 Z8FS021A ZMOT1AHH Z8FS040B ZMOT0BHH ZMOT0BSB Z8FMC04 Z8FMC08 Z8FMC16