From: Eric K. <ek...@rz...> - 2002-01-09 23:50:29
|
"Benjamin Kalytta" <bk...@we...> wrote: > What's the advantages of using fastcall calling convention? The most important advantage is that you can use MinGW to build WinNT/2000/XP drivers. > I think the advantage is that all arguments passed to function via cpu > register. This is faster than accessing the stack. But mingw's > implementation is a real joke, it's slower than using cdecl convention. The > other point is, the fastcall implementation in mingw is wrong. Use the '-O3' option with gcc and you will see some nice assembler code without any 'bells and whistles'. > Should be: > argument 1: eax > argument 2: edx > argument 3: ecx > argument 4: stack ->right to left order like pascal convention > argument x: stack+x > This is wrong! Microsoft defines fastcall as: argument 1: eax argument 2: ecx argument 3: stack ->right to left order like pascal convention argument x: stack+x Regards, Eric Kohl |