CDECL vs STDCALL

Here’s some ASM code:

  • In CDECL convention we push into stack and at the end of the function call we keep things ordered by restoring our stack pointer to the previous position, before we pushed

  • in STDCALL, used by Windows, we don’t care about keeping things ordered, since this thing is delegated to the function we’re calling

We may also have different operations (PUSH vs MOV) when we use different compilers, such as Visual Studio C++ and GNU Compiler