ZiLOG Z8 User Manual page 162

Hide thumbs Also See for Z8:
Table of Contents

Advertisement

Z8 Microcontrollers
Instruction Descriptions and Formats
CP
Compare
CP dst, src
Instruction Format:
Operation:
dst - src
The source operand is compared to (subtracted from) the destination operand, and the appropriate flags are set
accordingly. The contents of both operands are unaffected.
Flags:
C:
Cleared if there is a carry from the most significant bit of the result. Set otherwise indicating a borrow.
Z:
Set if the result is zero; cleared otherwise.
S:
Set if result bit 7 is set (negative); cleared otherwise.
V:
Set if arithmetic overflow occurs; cleared otherwise.
D:
Unaffected
H:
Unaffected
Note:
Address modes R or IR can be used to specify a 4-bit Working Register. In this format, the source or destination
Working Register operand is specified by adding 1110B (EH) to the high nibble of the operand. For example, if
Working Register R12 (CH) is the destination operand, then ECH will be used as the destination operand in the Op
Code.
Example:
If Working Register R3 contains 16H and Working Register R11 contains 20H, the statement:
sets the C and S Flags, and the Z and V Flags are cleared.
12-22
CP R3, R11
Op Code: A2 3B
ZiLOG
CP
COMPARE
UM001601-0803

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Z8 and is the answer not in the manual?

Questions and answers

Table of Contents