Processor Flags; Carry Flag - ZiLOG Z8 Series User Manual

Table of Contents

Advertisement

Processor Flags

The Flag Register
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).
Note:
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.
UM001604-0108
informs about the current status of Z8
(FCh)
Register FCh (Flags)
Flag Register (Read/Write)
D7 D6 D5 D4 D3 D2 D1 D0
Figure 133. Z8 Flag Register
®
CPU. The flags and their
Figure
133.
User Flag (F1)
User Flag (F2)
Half Carry Flag (H)
Decimal Adjust Flag (D)
Overflow Flag (V)
Sign Flag (S)
Zero Flag (Z)
Carry Flag (C)
®
Z8
CPU
User Manual
144
Instruction Set

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Z8 Series and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Z8 cpu

Table of Contents