beautypg.com

Cmp syntax, Description, Operation – Intel Extensible Firmware Interface User Manual

Page 794

background image

Extensible Firmware Interface Specification

19-20

12/01/02

Version 1.10

CMP

SYNTAX:

CMP[32|64][eq|lte|gte|ulte|ugte] R

1

, {@}R

2

{Index16|Immed16}

DESCRIPTION:

The CMP instruction is used to compare Operand 1 to Operand 2. Supported comparison modes are
=, <=, >=, unsigned <=, and unsigned >=. The comparison size can be 32 bits (CMP32) or 64 bits
(CMP64). The effect of this instruction is to set or clear the condition code bit in the Flags register
per the comparison results. The operands are compared as signed values except for the CMPulte
and CMPugte forms.

OPERATION:

CMPeq: Flags.C <= (Operand 1 == Operand 2)

CMPlte: Flags.C <= (Operand 1 <= Operand 2)

CMPgte: Flags.C <= (Operand 1 >= Operand 2)

CMPulte: Flags.C <= (Operand 1 <= Operand 2) (unsigned)

CMPugte: Flags.C <= (Operand 1>= Operand 2) (unsigned)