English
Language : 

Z86E3016PSG Datasheet, PDF (225/348 Pages) Zilog, Inc. – Z86E3016PSG
Z8 CPU
User Manual
207
IRET changes the value of the Sign Flag when the Flag Register saved in
the Stack is restored.
Overflow Flag
For signed arithmetic, Rotate, and Shift operations, the Overflow Flag (V)
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 set to 0 if no
overflow occurs.
Following logical operations the Overflow Flag is set to 0.
IRET changes the value of the Overflow Flag when the Flag Register
saved in the Stack is restored.
Decimal Adjust Flag
The Decimal Adjust Flag (D) is used for BCD arithmetic. Because the
algorithm for correcting BCD operations is different for addition and sub-
traction, this flag specifies what type of instruction was last executed so
that the subsequent Decimal Adjust (DA) operation 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.
IRET changes the value of the Decimal Adjust Flag when the Flag Regis-
ter saved in the Stack is restored.
Half Carry Flag
The Half Carry Flag (H) is set to 1 whenever an addition generates a carry
bit 3 (Overflow) or a subtraction generates a borrow 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 nor-
mally access this flag.
UM001602-0904
Instruction Set