CMP (CoMPare) (byte)
CMP
<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>
Immediate
CMP.B
#xx:8,Rd
A
rd
IMM
2
Register direct
CMP.B
Rs, Rd
1
C
rs
rd
2
Addressing
mode
Mnem.
Operands
1st byte
Instruction code
No. of
states
2nd byte
3rd byte
4th byte
67
<Operation>
Rd – (EAs); set condition code
<Assembly-Language Format>
CMP.B
<EAs>, Rd
<Examples>
CMP.B #H'E5, R1H
CMP.B R3L, R4L
<Operand Size>
Byte
<Condition Code>
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" if an overflow occurs;
otherwise cleared to "0."
C: Set to "1" if there is a borrow from bit 7;
otherwise cleared to "0."
I
H
N
Z
V
C
—
—
↕
—
↕
↕
↕
↕
Summary of Contents for H8/300 Series
Page 2: ...H8 300 Programming Manual...