News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Simple example of FPU.

Started by Farabi, August 31, 2005, 09:55:29 AM

Previous topic - Next topic

Farabi

Here is the example how to use FPU spesific for OpenGL.


;Generate a Float number from integer

IntegerToFloat proc Number:dword

push Number
fild dword ptr[esp]
fstp dword ptr[esp]
pop eax

ret
IntegerToFloat endp ; Return Value is eax=real4 format of Number


Dont use this function on the realtime calculation. fild function can cause the light disable.

Check also fsub, fadd and fmul. Dont use fisub, fadd, fimul.
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

PBrennick

Farabi,
Thank you for this information.  Every little bit helps me as I try to learn this stuff and advice is always appreciated.

Stay well,
Paul
The GeneSys Project is available from:
The Repository or My crappy website

Farabi

#2
Whoops I think Im just made the newbie run by that long code.
CHeck the attachment and see the function have name FLxxxxxx. Dont forget to put this on your code.


.elseif uMsg==WM_CREATE
invoke Phase1


Macro can be lot easier.

[attachment deleted by admin]
Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"

Farabi

Those who had universe knowledges can control the world by a micro processor.
http://www.wix.com/farabio/firstpage

"Etos siperi elegi"