Z8 Microcontrollers
ZiLOG Instruction Descriptions and Formats
UM001601-0803 12-23
CP
COMPARE
Example:
If Working Register R15 contains 16H, Working Register R10 contains 20H, and Register 20H contains 11H, the
statement:
CP R16, @R10
Op Code: A3 FA
clears the C, Z, S, and V Flags.
Example:
If Register 34H contains 2EH and Register 12H contains 1BH, the statement:
CP 34H,12H
Op Code: A4 12 34
clears the C, Z, S, and V Flags.
Example:
If Register 4BH contains 82H, Working Register R3 contains 10H, and Register 10H contains 01H, the statement:
CP 4BH, @R3
Op Code: A5 E3 4B
sets the S Flag, and clears the C, Z, and V Flags.
Example:
If Register 6CH contains 2AH, the statement:
CP 6CH, #2AH
Op Code: A6 6C 2A
sets the Z Flag, and the C, S, and V Flags are all cleared.
Example:
If Register D4H contains FCH, and Register FCH contains 8FH, the statement:
CP @D4H, 7FH
Op Code: A7 D4 FF
sets the V Flag, and the C, Z, and S Flags are all cleared.