Processor flags, Carry flag – Zilog Z86193 User Manual
Page 151

Z8
®
CPU
User Manual
UM001604-0108
Instruction Set
144
Processor Flags
The Flag Register
(FCh)
informs about the current status of Z8
®
CPU. The flags and their
bit positions in the Flag Register are displayed in
.
Z8 Flag Register contains six bits of status information which are set or cleared by CPU
operations. Four of the bits (C, V, Z, and S) can be tested for use with conditional Jump
instructions. Two flags (H and D) cannot be tested and are used for BCD arithmetic. The
two remaining bits in the Flag Register (F1 and F2) are available, but they must be set or
cleared by instructions and are not usable with conditional Jumps.
As with bits in the other control registers, the Flag Register bits can be set or reset by
instructions; however, only those instructions that do not affect the flags as an outcome of
the execution should be used (Load Immediate).
The Watchdog Timer (WDT) instruction affects the Flags accordingly: Z = 1, S = 0, V = 0.
Carry Flag
The Carry Flag (C) is set to 1 whenever the result of an arithmetic operation generates a
carry or a borrow the high order bit 7. Otherwise, the Carry Flag is cleared to 0.
Following Rotate and Shift instructions, the Carry Flag contains the last value shifted out
of the specified register.
An instruction can set, reset, or complement the Carry Flag.
IRET may change the value of the Carry Flag when the Flag Register, saved in the Stack,
is restored.
Figure 133. Z8 Flag Register
Note:
D7
D6 D5 D4 D3 D2 D1 D0
Flag Register (Read/Write)
Half Carry Flag (H)
User Flag (F1)
User Flag (F2)
Register FCh (Flags)
Overflow Flag (V)
Carry Flag (C)
Decimal Adjust Flag (D)
Zero Flag (Z)
Sign Flag (S)
- Z86233 Z86243 Z86733 Z86743 Z86C02 Z86C04 Z86C08 Z86C15 Z86C21 Z86C30 Z86C31 Z86C33 Z86C36 Z86C40 Z86C43 Z86C61 Z86C62 Z86C63 Z86C65 Z86C83 Z86C90 Z86C91 Z86C93 Z86C96 Z86E02 Z86E03 Z86E04 Z86E06 Z86E07 Z86E08 Z86E15 Z86E21 Z86E30 Z86E31 Z86E33 Z86E34 Z86E40 Z86E43 Z86E44 Z86E61 Z86E63 Z86E83 Z86K15 Z86L02 Z86L04 Z86L08 Z86L16 Z8E000 Z8E001 Z8PE003