News:

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

newbie question ( decimal to float )

Started by RedGhost, June 06, 2005, 05:08:11 AM

Previous topic - Next topic

RedGhost

hello, i have a decimal say 45, and i want to convert that to 45.0f for a parameter, but i am lost on how to, i've really done no work with floats in masm, in c you could do a quick typecast (float)#

- thanks in advance

Mirno

Look up the "fild" instruction, it loads an integer from memory, and pushes it onto the FPU register stack.

Mirno

raymond

Then you can store it into a REAL4, REAL8 or REAL10 memory variable with:

fstp mem_var

If you want more info on the use of the FPU, you may want to take a look at:

http://www.ray.masmcode.com/index.html#fputut

Raymond
When you assume something, you risk being wrong half the time
http://www.ray.masmcode.com

RedGhost