| |
Compare two Operands
86/88 |
Y |
186 |
Y |
286 |
Y |
386 |
Y |
486 |
Y |
CMP destination, source |
Ovfl |
Y |
Dir |
N |
Int |
N |
Trap |
N |
Sign |
Y |
Zero |
Y |
Aux |
Y |
Prty |
Y |
Carry |
Y |
CMP compares two numbers by subtracting the source from the
destination and updates the flags. CMP does not change the source or
destination. The operands may be bytes or words.
------------------------------------ Timing ----------------------------------
OpCode Instruction 386 286 86
3C ib CMP AL, imm8 2 3 4
3D iw CMP AX, imm16 2 3 4
3D id CMP EAX, imm32 2
80/7 ib CMP r/m8, imm8 2/5 3/6 4/10+EA
81/7 iw CMP r/m16, imm16 2/5 3/6 4/10+EA
81/7 id CMP r/m32, imm32 2/5
83/7 ib CMP r/m16, imm8 2/5 3/6 4/10+EA
83/7 ib CMP r/m32, imm8 2/5
38/r CMP r/m8, r8 2/5 2/7 3/9+EA
39/r CMP r/m16, r16 2/5 2/7 3/9+EA
39/r CMP r/m32, r32 2/5
3A/r CMP r8, r/m8 2/6 2/6 3/9+EA
3B/r CMP r16, r/m16 2/6 2/6 3/9+EA
3B/r CMP r32, r/m32 2/6
------------------------------------ Logic -----------------------------------
Flags set according to result of
(destination - source)
See Also CMPS SCAS SUB TEST Flags |