English
Language : 

Z86E3016PSG Datasheet, PDF (224/348 Pages) Zilog, Inc. – Z86E3016PSG
Z8 Family of Microcontrollers
User Manual
206
Carry Flag
The Carry Flag (C) is set to 1 whenever the result of an arithmetic opera-
tion 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.
Zero Flag
For arithmetic and logical operations, the Zero Flag (Z) is set to 1 if the
result is zero. Otherwise, the Zero Flag is cleared to 0.
If the result of testing bits in a register is 00h, the Zero Flag is set to 1.
Otherwise the Zero Flag is cleared to 0.
If the result of a Rotate or Shift operation is 00h, the Zero Flag is set to 1.
Otherwise, the Zero Flag is cleared to 0.
IRET changes the value of the Zero Flag when the Flag Register saved in
the Stack is restored. The WDT Instruction sets the Zero Flag to a 1.
Sign Flag
The Sign Flag (S) 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 pos-
itive 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.
Instruction Set
UM001602-0904