Intel ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 4 REV 2.3 Manual page 76

Hide thumbs Also See for ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 4 REV 2.3:
Table of Contents

Advertisement

CMP—Compare Two Operands
Opcode
3C ib
3D iw
3D id
80 /7 ib
81 /7 iw
81 /7 id
83 /7 ib
83 /7 ib
38 /r
39 /r
39 /r
3A /r
3B /r
3B /r
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 (Jcc),
condition move (CMOVcc), or SETcc instruction. The condition codes used by the Jcc,
CMOVcc, and SETcc 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
Volume 4: Base IA-32 Instruction Reference
Instruction
CMP AL, imm8
CMP AX, imm16
CMP EAX, imm32
CMP r/m8, imm8
CMP r/m16, imm16
CMP r/m32,imm32
CMP r/m16,imm8
CMP r/m32,imm8
CMP r/m8,r8
CMP r/m16,r16
CMP r/m32,r32
CMP r8,r/m8
CMP r16,r/m16
CMP r32,r/m32
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
Description
Compare imm8 with AL
Compare imm16 with AX
Compare imm32 with EAX
Compare imm8 with r/m8
Compare imm16 with r/m16
Compare imm32 with r/m32
Compare imm8 with r/m16
Compare imm8 with r/m32
Compare r8 with r/m8
Compare r16 with r/m16
Compare r32 with r/m32
Compare r/m8 with r8
Compare r/m16 with r16
Compare r/m32 with r32
4:69

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the ITANIUM ARCHITECTURE - SOFTWARE DEVELOPERS MANUAL VOLUME 4 REV 2.3 and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Itanium architecture

Table of Contents