Calling Convention

A CallingConvention is a particular way of passing in parameters, saving registers, cleaning up the stack and restoring the stack, and sometimes even a means to translate errors or exceptions.

With stdcall calling convention, for example, the parameters get pushed onto the stack in right-to-left order, and the called routine is responsible for saving and restoring registers. Many MicrosoftWindows API calls use this calling convention.

With C calling convention, the parameters get pushed onto the stack in the same order as stdcall, but it's the caller that has to save and restore register values.

With fastcall, parameters use as many registers as possible (on IntelMachines?, these are the EAX, EBX and EDX registers) before considering putting things on the stack. DelphiLanguage uses this model by default.

-- RitchieAnnand


EditText of this page (last edited November 13, 2002) or FindPage with title or text search