|
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 Overï¬ow 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 Overï¬ow Flag is set to 0 if no
overï¬ow occurs.
Following logical operations the Overï¬ow Flag is set to 0.
IRET changes the value of the Overï¬ow 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 ï¬ag speciï¬es 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 (Overï¬ow) 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 ï¬ag.
UM001602-0904
Instruction Set
|
▷ |