3-198
INSTRUCTION SET REFERENCE
FICOM/FICOMPCompare Integer
Description
These instruction compare the value in ST(0) with an integer source operand and sets the condi-
tion code flags C0, C2, and C3 in the FPU status word according to the results (refer to table
below). The integer value is converted to extended-real format before the comparison is made.
These instructions perform an unordered comparison. An unordered comparison also checks
the class of the numbers being compared (refer to FXAMExamine in this chapter). If either
operand is a NaN or is in an undefined format, the condition flags are set to unordered.
The sign of zero is ignored, so that 0.0 = +0.0.
The FICOMP instructions pop the register stack following the comparison. To pop the register
stack, the processor marks the ST(0) register empty and increments the stack pointer (TOP) by 1.
Operation
CASE (relation of operands) OF
ST(0) > SRC:C3, C2, C0
<
000;
ST(0) < SRC:C3, C2, C0
<
001;
ST(0) = SRC:C3, C2, C0
<
100;
Unordered:C3, C2, C0
<
111;
ESAC;
IF instruction = FICOMP
THEN
PopRegisterStack;
FI;
Opcode
Instruction
Description
DE /2
FICOM m16int
Compare ST(0) with m16int
DA /2
FICOM m32int
Compare ST(0) with m32int
DE /3
FICOMP m16int
Compare ST(0) with m16int and pop stack register
DA /3
FICOMP m32int
Compare ST(0) with m32int and pop stack register
Condition
C3
C2
C0
ST(0) > SRC
0
0
0
ST(0) < SRC
0
0
1
ST(0) = SRC
1
0
0
Unordered
1
1
1