64 bit Calling convention

Started by lesliedellow, May 31, 2009, 01:51:48 AM

Previous topic - Next topic

lesliedellow

Does anybody know whether 64 bit Pelles C observes the usual 32 bit calling convention used in Windows - i.e. that arguments are pushed onto the stack, starting with the right most argument?

EDIT
Ok, I've found the answer to that question; it uses fastcall. But then the next question is, how does it cope with venerable C functions such as printf, or scanf, which have varying numbers of parameters?

Pelle

Pelles C uses the same calling convention on X64 as documented by Microsoft - basically fastcall, but extra arguments are stored on the stack (with a 'mov', not 'push').

See MSDN - "Calling Convention for x64 64-Bit Environments":
http://msdn.microsoft.com/en-us/library/ms794533.aspx
/Pelle