Hey all...

I'm trying to implement floating point numbers and reals in a library I'm writing but I'm having a bit of difficulty (UNIX platform)... What I am trying to do is create a structure in memory which stores 64 bit numbers (integers or floats) and I don't have any good resources to read on how to do this in assembler... I use and need to be able to use libc calls such as printf(), and have everything work with them but I can't even get a very simple example to work:



dbl dq 12032.34f
msg db "%f",0xA,0
ccall printf, msg, dbl

I always get this as output:

0.000000

Can anyone explain why? I would think that FASM would be storing the float in a proper format, but am I missing something?

John
Posted on 2003-03-07 08:45:34 by coogle
Try ccall printf, msg, dword ,dword
Posted on 2003-03-07 08:51:43 by Tomasz Grysztar
Coogle,

You can check this example:

http://www.asmcommunity.net/board/showthread.php?s=&postid=71184.msg71184

Regards,

Vortex
Posted on 2003-03-07 09:07:13 by Vortex
Am I correct in my understanding that the reason why I need to provide two parameters in this form is to pass 64 bits (qword)? i.e.

printf, msg, HI dword, LO dword

or is there another reason? Also, does this process also work for 64 bit integers (doubles)?


ccall printf, msg, dword ,dword

John
Posted on 2003-03-07 12:32:45 by coogle