<<< Passing Arguments on the Stack | Index | PASCAL-style and STDCALL calling conventions >>> |
For example,
add3nums PROC NEAR32 C
Here, add3nums is the first line of procedure declaration.
Calls to add3nums should be made similar to a C function call, that is,
caller pushes parameters into the stack in the reverse order (right-to-left)
calling the function
popping the stack to clean up those pushed arguments.
; example of __cdecl
push arg3
push arg2
push arg1
call function
add sp,12 ; effectively pop; pop; pop;
Function return values are returned in the EAX register.
<<< Passing Arguments on the Stack | Index | PASCAL-style and STDCALL calling conventions >>> |