NO

Author Topic: 64 bit Calling convention  (Read 3554 times)

lesliedellow

  • Guest
64 bit Calling convention
« 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?
« Last Edit: May 31, 2009, 12:15:48 PM by lesliedellow »

Offline Pelle

  • Administrator
  • Member
  • *****
  • Posts: 2266
    • http://www.smorgasbordet.com
Re: 64 bit Calling convention
« Reply #1 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
/Pelle