And again.

this one works:

fld float2

fld float1
fcomip st,st(1)
fstp st
jz is_equal
jc is_less
is_more:


I found this solution, working with all cpu's

FLD float2

FCOMP float1
FNSTSW AX
SHR AH,1
JC is_less
is_more:


Many thanks !!!

Regards,
Nordwind64
Posted on 2003-11-02 14:58:55 by Nordwind64
First, I would not suggest using the no-wait FNSTSW in this sequence. You might get the content of the Status Word before the comparison instruction is completed and the Status Word updated. Use the FSTSW variant.

Second, if you transfer part of the Status Word to the Flag register (as shown in the tutorial with the FCOM instruction), you can easily branch to possibilities other than less or more, such as equal or erroneous parameters.

You should not disregard that last possibility and take appropriate action in case of error. (This part would be very difficult to implement when trying to use the CPU for the comparison of floats!!)

Raymond
Posted on 2003-11-02 21:25:33 by Raymond
Thanks again !

now I use the FSTSW variant.

Regards,
Nordwind64
Posted on 2003-11-03 23:43:41 by Nordwind64