![Intel ITANIUM ARCHITECTURE Manual Download Page 76](http://html.mh-extra.com/html/intel/itanium-architecture/itanium-architecture_manual_2073403076.webp)
Volume 4: Base IA-32 Instruction Reference
4:69
CMP—Compare Two Operands
Description
Compares the first source operand with the second source operand and sets the status
flags in the EFLAGS register according to the results. The comparison is performed by
subtracting the second operand from the first operand and then setting the status flags
in the same manner as the SUB instruction. When an immediate value is used as an
operand, it is sign-extended to the length of the first operand.
The CMP instruction is typically used in conjunction with a conditional jump (J
cc
),
condition move (CMOV
cc
), or SET
cc
instruction. The condition codes used by the J
cc
,
CMOV
cc
, and SET
cc
instructions are based on the results of a CMP instruction.
Operation
temp
SRC1
SignExtend(SRC2);
ModifyStatusFlags; (* Modify status flags in the same manner as the SUB instruction*)
Flags Affected
The CF, OF, SF, ZF, AF, and PF flags are set according to the result.
Additional Itanium System Environment Exceptions
Itanium Reg Faults NaT Register Consumption Abort.
Itanium Mem FaultsVHPT Data Fault, Nested TLB Fault, Data TLB Fault, Alternate Data
TLB Fault, Data Page Not Present Fault, Data NaT Page Consumption
Abort, Data Key Miss Fault, Data Key Permission Fault, Data Access
Rights Fault, Data Access Bit Fault, Data Dirty Bit Fault
Opcode
Instruction
Description
3C
ib
CMP AL,
imm8
Compare
imm8
with AL
3D
iw
CMP AX,
imm16
Compare
imm16
with AX
3D
id
CMP EAX,
imm32
Compare
imm32
with EAX
80 /7
ib
CMP
r/m8, imm8
Compare
imm8
with
r/m8
81 /7
iw
CMP
r/m16, imm16
Compare
imm16
with
r/m16
81 /7
id
CMP
r/m32,imm32
Compare
imm32
with
r/m32
83 /7
ib
CMP
r/m16,imm8
Compare
imm8
with
r/m16
83 /7
ib
CMP
r/m32,imm8
Compare
imm8
with
r/m32
38 /
r
CMP
r/m8,r8
Compare
r8
with
r/m8
39 /
r
CMP
r/m16,r16
Compare
r16
with
r/m16
39 /
r
CMP
r/m32,r32
Compare
r32
with
r/m32
3A /
r
CMP
r8,r/m8
Compare
r/m8
with
r8
3B /
r
CMP
r16,r/m16
Compare
r/m16
with
r16
3B /
r
CMP
r32,r/m32
Compare
r/m32
with
r32
Summary of Contents for ITANIUM ARCHITECTURE
Page 1: ......
Page 7: ...402 Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 199: ...4 192 Volume 4 Base IA 32 Instruction Reference FWAIT Wait See entry for WAIT ...
Page 352: ...Volume 4 Base IA 32 Instruction Reference 4 345 ROL ROR Rotate See entry for RCL RCR ROL ROR ...
Page 589: ...4 582 Volume 4 IA 32 SSE Instruction Reference ...
Page 590: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 Index ...
Page 591: ...Index Intel Itanium Architecture Software Developer s Manual Rev 2 3 ...
Page 603: ...INDEX Index 12 Index for Volumes 1 2 3 and 4 ...
Page 604: ......