2.2.22 (1) CMP (B)
CMP (CoMPare)
Compare
Operation
Rd – (EAs), set or clear CCR
Assembly-Language Format
CMP.B
<EAs>, Rd
Operand Size
Byte
Condition Code
H: Set to 1 if there is a borrow at bit 3;
otherwise cleared to 0.
N: Set to 1 if the result is negative; otherwise
cleared to 0.
Z: Set to 1 if the result is zero; otherwise
cleared to 0.
V: Set to 1 if an overflow occurs; otherwise
cleared to 0.
C: Set to 1 if there is a borrow at bit 7;
otherwise cleared to 0.
I
UI
H
U
N
Z
V
C
—
—
↕
—
↕
↕
↕
↕
Description
This instruction subtracts the source operand from the contents of an 8-bit register Rd (destination
register) and sets or clears the CCR bits according to the result. The destination register contents
remain unchanged.
Available Registers
Rd:
R0L to R7L, R0H to R7H
Rs:
R0L to R7L, R0H to R7H
Operand Format and Number of States Required for Execution
Notes
Instruction Format
1st byte
2nd byte
3rd byte
4th byte
Immediate
CMP.B
#xx:8, Rd
A
rd
IMM
2
Register direct
CMP.B
Rs, Rd
1
C
rs
rd
2
No. of
States
Addressing
Mode
Mnemonic
Operands
72