2.4.3.2 Logical Operations
The PARITY/OVERFLOW FLAG finds use as a parity indicator for logical and
rotate operations.
The number of "1" bits in
a
byte are counted and an
odd number sets the flag to "0" -- odd parity.
If the total is even,
the parity flag is set to
"1".
Also, when inputting a byte from an I/O
device,
certain
input instructions affect the parity flag to indicate
the parity of the incoming data.
2.4.4 Half-Carry Flag (H)
The carry and borrow status between accumulator bits
3
and 4 during an
8-bit arithmetic operation affects the condition of the HALF-CARRY FLAG.
The Decimal
Adjust Accumulator
instruction
(DAA)
uses this flag to
correct the result of a packed BCD add or subtract operation.
This flag
is set according to the following table.
H
o
2.4.5 Zero Flag (Z)
ADD
There is a carry from
bit :3 to bit 4.
There i.s no carry from
bit :3 to bit 4.
SUBTRACT
There is no borrow from
bit 4.
There is a borrow from
bit 4.
If the result when executing an appropriate instruction is 0,
the
ZERO
FLAG is set..
The ZERO FLAG is always "1" if the resulting byte in the
accumulator is 0 \.Jhen performing an 8-bi t arithmetic operation.
A non-O
result resets the flag.
When performing block-compare
(search)
instructions,
a subtract
is
performed without affecting the accumulator contents.
The Z flag is set
to a "1"
if an equivalence is found between the accumulator value and
the memory location pointed to by the contents of the register pair
HL.
The ZERO FLAG
jLndicates the complemented state of specific bits when
testing a bit in a memory location or register.
If the result of B -, 1 is 0 when inputting or outputting a byte between
a memory location and I/O device using a block I/O instruction, the ZERO
FLAG is set,
otherwise it is reset.
Also when using the input
instruction INP r
I'
the ZERO FLAG :is set to indicate a 0 byte input.
100-0123-001
2-5
Need help?
Do you have a question about the MSC 8009 and is the answer not in the manual?