flat assembler
Message board for the users of flat assembler.
Index
> Windows > Floating point division problem |
Author |
|
LocoDelAssembly 10 Jan 2013, 04:02
cinvoke printf, fmt, result, result+4
|
|||
10 Jan 2013, 04:02 |
|
TmX 10 Jan 2013, 08:23
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. |
|||
10 Jan 2013, 08:23 |
|
Athlon64 10 Jan 2013, 11:13
cinvoke printf, fmt, dword [result], dword [result+4]
|
|||
10 Jan 2013, 11:13 |
|
Tomasz Grysztar 10 Jan 2013, 12:21
Code: include 'win32ax.inc' Code: cinvoke printf, fmt, double [result] |
|||
10 Jan 2013, 12:21 |
|
TmX 10 Jan 2013, 13:31
Thanks Tomasz, works like a charm.
BTW, why is double needed in the cinvoke part? Is C's double the equivalent of qword? |
|||
10 Jan 2013, 13:31 |
|
Tomasz Grysztar 10 Jan 2013, 14:00
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. |
|||
10 Jan 2013, 14:00 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.