2.2.22 (1) CMP (compare) (byte) CMP
Operation
Rd − (EAs); set condition code
Assembly-Language Format
CMP.B <EAs>, Rd
Operand Size
Byte
Condition Code
I
H
N
Z
∆
∆
∆
— —
—
I:
Previous value remains unchanged.
H:
Set to 1 when there is a borrow from bit 3; otherwise cleared to 0.
N:
Set to 1 when the result is negative; otherwise cleared to 0.
Z:
Set to 1 when the result is zero; otherwise cleared to 0.
V:
Set to 1 when an overflow occurs; otherwise cleared to 0.
C:
Set to 1 when there is a borrow from bit 7; otherwise cleared to 0.
Description
This instruction subtracts an 8-bit source register or immediate data from an 8-bit destination
register and sets the condition code flags according to the result. The destination register is not
altered.
Instruction Formats and Number of Execution States
Addressing
mode
Mnem.
Immediate
CMP.B
Register direct
CMP.B
74
V
C
∆
∆
Instruction code
Operands 1st byte
#xx:8, Rd
A
rd
Rs, Rd
1
C
2nd byte
3rd byte
4th byte
IMM
rs
rd
No. of
states
2
2