flat assembler
Message board for the users of flat assembler.
Index
> Main > Using cinvoke printf |
Author |
|
klavs.pr 26 Mar 2011, 15:54
Not sure, but isn't floating point numbers always at least 64bit long?
|
|||
26 Mar 2011, 15:54 |
|
revolution 26 Mar 2011, 23:25
'%f' and '%lf' both expect a qword floating point number. Change your line to this and you will see the result.
Code: cinvoke printf, f4, dword[varq], dword[varq+4] |
|||
26 Mar 2011, 23:25 |
|
madmatt 27 Mar 2011, 13:55
the printf function only accepts 64bit floats so you'll have to store it as a double:
Code: fld [vard] fstp [vartempq] |
|||
27 Mar 2011, 13:55 |
|
vua72 09 Apr 2011, 18:09
madmatt wrote: the printf function only accepts 64bit floats so you'll have to store it as a double: Thanks, where I can read about this? |
|||
09 Apr 2011, 18:09 |
|
madmatt 09 Apr 2011, 21:18
vua72 wrote:
To read more about printf (also scroll down to 'format specifications'): http://msdn.microsoft.com/en-us/library/wc7014hz.aspx A little better printf example: Code: proc MAIN local mydouble:QWORD, myfloat:DWORD mov [myfloat], 3.141 fld [myfloat] fstp [mydouble] cinvoke printf, "fp number %f", double [mydouble] endp _________________ Gimme a sledge hammer! I'LL FIX IT! |
|||
09 Apr 2011, 21:18 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.