<<< PASCAL-style and STDCALL calling conventions | Index | Calling Conventions Summary >>> |
The C_style_procedure_call.asm sample demonstrates standard entry into procedure used in high-level programming language C.
Stack grows in the direction of the lower addresses.
Local variables exist on the stack while the procedure is excuting.
The address of the first parameter is defined as [ EBP + 8 ] .
Address of the first local variable, if it is reserved, is defined as [ EBP - 4 ], with the DWORD variable in mind.
C approach to passing parameters does not require procedure to restore stack volume occupied by its parameters.
Therefore, the caller is responsible for making this adjustment:
add esp, 12 ; destroy the pushed arguments, C-style calling convention
<<< PASCAL-style and STDCALL calling conventions | Index | Calling Conventions Summary >>> |