Chapter
3.
Instruction
Set
CPE
CPI
3-16
CALL
IF
PARITY
EVEN
Parity
is
even if the
byte
in
the accumulator has an even number
of
one bits. The parity flag
is
set to one
to
indicate this
condition.
The CPE and CPO instructions are useful for testing the parity
of
input data. However,
the
IN
instruction does not set any
of
the condition flags. The flags can
be
set
without
altering the data
by
adding
OOH
to the
contents
of
the accumulator.
The
CPE
instruction combines functions
of
the J
PE
and PUSH instructions. CPE tests the setting
of
the parity
flag.
If the flag
is
set to one,
ePE
pushes the
contents
of
the program
counter
onto
the stack and then jumps
to the address specified by the
ClPE
instruction. If the flag i, set to zero, program execution simply continues
with the next sequential instruction.
Opcode Operand
CPE
address
Although the use
of
a label
is
more
common,
the address may also
be
<,pccified
as
a number or an expression.
1 1 1
Cycles:
States:
Ad
dressi
ng:
Flags:
Example:
0
1 1
0
0
low addr
high
addr
3 or 5
(2
or 5 on 8085)
11
or
17
(9
or 18 on 8085)
immediate/register indirect
none
For the sake
of
brevity, an example
is
given for the CALL instruction
but
not for each
of
its closely related
variants.
COMPARE
IMMEDIATE
CPI
compares the
contents
of
the second instruction byte with the
contents
of
the accumulator and sets the zero
and carry flags to indicate the
result. The values being compared remain unchanged.
The zero flag indicates equality.
hlo
carry indicates that the
contents
of
the accumulator are greater than the
immediate data; a carry indicates
that
the
accumulator
is
less than the immediate data. However, the meaning
of
the carry flag
is
reversed when the values have different signs or one
of
the values
is
complemented.
Op co de
Operand
CPI
data