flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Found bug in the 'cinvoke (fastcall)' macro |
Author |
|
madmatt 22 Jul 2014, 16:51
I'm pretty sure this is a bug in the 'invoke (fastcall)' macro, in that the first three parameters don't get loaded properly. You can download the code below. This code should compile in a stock fasmw17121 folder.
_________________ Gimme a sledge hammer! I'LL FIX IT! |
|||||||||||
22 Jul 2014, 16:51 |
|
revolution 22 Jul 2014, 18:11
Which invoke call are you referring to? There are 8 in total in the example you posted.
|
|||
22 Jul 2014, 18:11 |
|
revolution 22 Jul 2014, 21:47
MS has this to say:
If parameters are passed via varargs (for example, ellipsis arguments), then essentially the normal parameter passing applies including spilling the fifth and subsequent arguments. It is again the callee's responsibility to dump arguments that have their address taken. For floating-point values only, both the integer and the floating-point register will contain the float value in case the callee expects the value in the integer registers. |
|||
22 Jul 2014, 21:47 |
|
madmatt 22 Jul 2014, 22:46
revolution wrote: MS has this to say: Damn, for a minute there I thought my post was deleted. That is a strange case, I thought all function calls were equal in 64bit. Sounds like you would need some kind of switch to let the cinvoke (fastcall) macro know about varargs functions. _________________ Gimme a sledge hammer! I'LL FIX IT! |
|||
22 Jul 2014, 22:46 |
|
revolution 22 Jul 2014, 22:58
vinvoke anyone?
For my code the only time I use cinvoke is with vararg calls so "fixing" cinvoke would be a suitable solution. But perhaps others use cinvoke also for other calls? Of course as an interim fix you can just remove the 'float' keyword. |
|||
22 Jul 2014, 22:58 |
|
madmatt 22 Jul 2014, 23:42
Quote: Of course as an interim fix you can just remove the 'float' keyword. Wish I would've thought of that, works like it should now. |
|||
22 Jul 2014, 23:42 |
|
Tomasz Grysztar 23 Jul 2014, 12:59
revolution wrote: For my code the only time I use cinvoke is with vararg calls so "fixing" cinvoke would be a suitable solution. But perhaps others use cinvoke also for other calls? |
|||
23 Jul 2014, 12:59 |
|
madmatt 23 Jul 2014, 16:34
Your fix seems to be working. good work!, Tomasz.
|
|||
23 Jul 2014, 16:34 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.