وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

وو

وحید آنلاین . آرشیو وبلاگ وحیدمی دات آی آر . شرکت بیان. vahidmy.blog.ir

FCOMI

FCOMI 

Usage: FCOMI  src                                     Modifies flags: See table below.

Performs an unordered comparison of the contents of registers ST(0) and ST(i) and sets the status flags ZF, PF, and CF in the EFLAGS register according to the results. The sign of zero is ignored for comparisons, so that -0.0 is equal to +0.0.

Floating-Point Compare


FCOM mem32                    ; D8 /2                [8086,FPU]

FCOM mem64                    ; DC /2                [8086,FPU]

FCOM fpureg                   ; D8 D0+r              [8086,FPU]

FCOM ST0,fpureg               ; D8 D0+r              [8086,FPU]


FCOMP mem32                   ; D8 /3                [8086,FPU]

FCOMP mem64                   ; DC /3                [8086,FPU]

FCOMP fpureg                  ; D8 D8+r              [8086,FPU]

FCOMP ST0,fpureg              ; D8 D8+r              [8086,FPU]


FCOMPP                        ; DE D9                [8086,FPU]


FCOMI fpureg                  ; DB F0+r              [P6,FPU]

FCOMI ST0,fpureg              ; DB F0+r              [P6,FPU]


FCOMIP fpureg                 ; DF F0+r              [P6,FPU]

FCOMIP ST0,fpureg             ; DF F0+r              [P6,FPU]


FCOM compares ST0 with the given operand, and sets the FPU flags accordingly. ST0 is treated as the left-hand side of the comparison, so that the carry flag is set (for a 'less-than' result) if ST0 is less than the given operand.


FCOMP does the same as FCOM, but pops the register stack afterwards. FCOMPP compares ST0 with ST1 and then pops the register stack twice.


FCOMI and FCOMIP work like the corresponding forms of FCOM and FCOMP, but write their results directly to the CPU flags register rather than the FPU status word, so they can be immediately followed by conditional jump or conditional move instructions.


The FCOM instructions differ from the FUCOM instructions only in the way they handle quiet NaNs: FUCOM  will handle them silently and set the condition code flags to an 'unordered' result, whereas FCOM will generate an exception.


FPU Flags Affected

C1 Set to 0 if stack underflow occurred; otherwise, set to 0.

C0, C2, C3 Not affected.


Table  FCOMI/FCOMIP/ FUCOMI/FUCOMIP Results

Comparison Results ZF PF CF

ST0 >ST(i)                  0   0   0

ST0 <ST(i)                  0   0   1

ST0 =ST(i)                  1   0   0

Unordered*                 1   1    1


EXAMPLE: 

fcomi st3