Programming/Calling conventions
From Sidvind
Contents |
[edit] x86
[edit] cdecl
- Keyword: (MSVC _cdecl, GCC cdecl)
- Compilers: Microsoft Visual C++, GCC
The cdecl calling convention is the standard convention for most x86 compilers. Arguments are pushed on the stack right to left. Return values are passed in EAX. The caller clean the stack.
[edit] Stdcall
- Keyword: MSVC __stdcall, GCC stdcall
- Compilers: Microsoft Visual C++, GCC
Like cdecl but the callee is cleaning the stack.
[edit] Fastcall
- Keyword: MSVC __fastcall, GCC fastcall
- Compilers: Microsoft Visual C++, GCC
The first two arguments are passed left to right in ECX and EDX. Remaining arguments are pushed onto the stack from right to left. The callee clean the stack.

