IA-32 Assembly Language Reference Manual

Comparison Instructions

Compare Real (fcom)

fcom{ls}

Example

Compare stack element 0 with stack element 7. Condition codes contain the result: No compare=111, st 0 greater than st 7=000, st 0 less than st 7=001, equal compare=100.

fcom %st(7)

Compare Real and Pop (fcomp)

fcomp{ls}

Example

Compare stack element 0 with stack element 7. Condition codes contain the result: No compare=111, st 0 greater than st 7=000, st 0 less than st 7=001, equal compare=100, then pop the stack.

fcomp %st(7)

Compare Real and Pop Twice (fcompp)

fcompp

Example

Compare stack element 0 with stack element 1. Condition codes contain the result: No compare=111, st 0 greater than st 7=000, st 0 less than st 7=001, equal compare=100, then pop the stack twice.

fcompp

Integer Compare (ficom)

ficom{l}

Example

Integer compare stack element 0 with the contents of register ECX (with an offset of 2). Condition codes contain the result: No compare=111, st 0 greater than st 7=000, st 0 less than st 7=001, equal compare=100,

ficom 2(%ecx)

Integer Compare and Pop (ficomp)

ficomp{l}

Example

Integer compare stack element 0 with the contents of register ECX (with an offset of 2). Condition codes contain the result: No compare=111, st 0 greater than st 7=000, st 0 less than st 7=001, equal compare=100, then pop the stack.

ficomp 2(%ecx)

Test (ftst)

ftst

Example

Compare stack element 0 with the value 0.0. Condition codes contain the result: No compare=111, st 0 greater than st 7=000, st 0 less than st 7=001, equal compare=100,

ftst

Examine (fxam)

fxam	

Example

Report the type of object in stack element 0. FPU flags C3, C2, and C0 return the type:

Unsupported
000
NaN
001
Normal
010
Infinity
011
Zero
100
Empty
101
Denormal
110

fxam