Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Fpu Operations

1 view
Skip to first unread message

Simon Bale

unread,
Jul 2, 1997, 3:00:00 AM7/2/97
to

Please could someone take a look at the code I have attached and tell me
what I would need to do to output the result of the fpu operation to the
display. Could you also send some code demonstrating this.

Thanks
--
___________________________________________

Simon Bale

Simon...@btinternet.com
___________________________________________


fpu.asm

James Shaw

unread,
Jul 3, 1997, 3:00:00 AM7/3/97
to

"Simon Bale" <Simon...@btinternet.com> wrote:

>Please could someone take a look at the code I have attached and tell me
>what I would need to do to output the result of the fpu operation to the
>display. Could you also send some code demonstrating this.

>.MODEL SMALL
>.386
>.STACK 100h
>.DATA

>fp Dd 25E0
>store dd ?

>.CODE

>start:
> mov ax,@data
> mov ds,ax
> fld fp
> fsqrt
> fst store

This should really be fstp, otherwise once you've called it a few (8)
times, the fpu stack will overflow.

>done:
> mov ah,4ch
> mov al,0
> int 21h
>END start

Displaying fp numbers is tricky - searh the web, or use printf() from
C.

Jim

0 new messages