Pelles C forum

C language => Expert questions => Topic started by: lesliedellow on May 31, 2009, 01:51:48 AM

Title: 64 bit Calling convention
Post by: lesliedellow on May 31, 2009, 01:51:48 AM
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?
Title: Re: 64 bit Calling convention
Post by: Pelle on May 31, 2009, 12:36:16 PM
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 (http://msdn.microsoft.com/en-us/library/ms794533.aspx)