flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
LocoDelAssembly
cinvoke printf, fmt, result, result+4
![]() |
|||
![]() |
|
TmX
LocoDelAssembly wrote: cinvoke printf, fmt, result, result+4 Well, now the result is: 1.78705e-307 Anyway, I think you're right: C functions should be called with cinvoke, not invoke. |
|||
![]() |
|
Athlon64
cinvoke printf, fmt, dword [result], dword [result+4]
|
|||
![]() |
|
Tomasz Grysztar
Code: include 'win32ax.inc' Code: cinvoke printf, fmt, double [result] ![]() |
|||
![]() |
|
TmX
Thanks Tomasz, works like a charm.
![]() BTW, why is double needed in the cinvoke part? Is C's double the equivalent of qword? |
|||
![]() |
|
Tomasz Grysztar
Yes, the "double" in C means double precision floating point value, which is a 64-bit value.
In case of fasm's macroinstructions "double" means simply that there will be double push instruction - that the size of value is twice the size of stack unit. And since in Win32 the size of stack unit is 32 bits, the size of doubled one is 64 bits. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.
Website powered by rwasa.