Intel 80286 Computer Accessories User Manual


 
THE
80286
INSTRUCTION SET
CMP-Compare
Two
Operands
Opcode
Instruction Clocks
3C
db
CMP AL,db
3
3D
dw
CMP
AX,dw
3
80
17
db
CMP eb,db
3,mem=6
38
Ir
CMP eb,rb
2,mem=7
83
17
db
CMP eW,db
3,mem=6
81
17
dw
CMP eW,dw
3,mem=6
39
Ir
CMP eW,rw
2,mem=7
3A
Ir
CMP rb,eb
2,mem=6
38
Ir
CMP rW,ew
2,mem=6
FLAGS MODIFIED
Overflow, sign, zero, auxiliary carry, parity, carry
FLAGS UNDEFINED
None
OPERATION
Description
Compare immediate byte from AL
Compare immediate word from
AX
Compare immediate byte from
EA
byte
Compare byte register from
EA
byte
Compare immediate byte from
EA
word
Compare immediate word from
EA
word
Compare word register from
EA
word
Compare
EA
byte from byte register
Compare
EA
word from word regisler
CMP
subtracts the second operand from the first operand, but it does not place the result anywhere.
Only the flags are changed by this instruction.
CMP
is
usually followed by a conditional jump instruc-
tion.
See
the
"]cond"
instructions in this chapter for the list of signed and unsigned flag tests provided
by the
80286.
'.
If
a word operand
is
compared to an immediate byte value, the byte value
is
first sign-extended.
PROTECTED MODE EXCEPTIONS
#GP(O) for an illegal memory operand effective address in the CS, DS, or ES segments; #8S(0) for an
illegal address in the
SS
segment.
REAL ADDRESS MODE EXCEPTIONS
Interrupt
13
for a word operand at offset
OFFFFH.
8-33