Floating Point 
Author Message
 Floating Point

Can somebody point me in the direction of a good FPU tutorial?  I am
interested in the 8087 (or above) and I am using TASM.

I have tried the following:

P386N
IDEAL
Model small
Stack 200h

DATASEG
    myFloat dt 1.5
    myInteger dd 0
CODESEG
Start:
    fld [myFloat]
    fistp [myInteger]

    mov ax, 4C00h
    int 21h
END Start

But when I debug it, it says it is loading -2.4something. ?!!?

Thanks

David



Mon, 31 Dec 2001 03:00:00 GMT  
 Floating Point

Quote:
>    myFloat dt 1.5

use myFloat dd 1.5 instead. much less memory-consuming (tasm DOES store this
as
a float, be sure)

Quote:
>    fld [myFloat]

you forgot the finit.

fabian giesen
ryg/teklords



Mon, 31 Dec 2001 03:00:00 GMT  
 Floating Point

Quote:
> P386N
> IDEAL
> Model small
> Stack 200h

> DATASEG
>     myFloat dt 1.5
>     myInteger dd 0
> CODESEG
> Start:

here you must initialize your data segment..

    mov ds, ax

Quote:
>     fld [myFloat]
>     fistp [myInteger]

>     mov ax, 4C00h
>     int 21h
> END Start

Quad



Mon, 31 Dec 2001 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. An alternative to floating point (was Re: Floating point non-exactness)

2. IBM 370 Floating point to IEEE floating point

3. Getting a floating point number from a float-object

4. vax floating pont to unix floating point

5. fixed point vs floating point

6. code with fixed-point or floating-point

7. fixed point vs floating point

8. fixed point vs floating point

9. Floating Point vs Fixed Point

10. Type/Class Distinction (was: RE: Future floating point directions? [was Re: floating point in 2.0])

11. an if expression comparing a computed floating point value with a floating point constant fails when it shouldn't

12. need floating point conversion method

 

 
Powered by phpBB® Forum Software