September 2017
Beginner to intermediate
290 pages
6h 58m
English
The stdcall calling convention is almost identical to cdecl in that parameters are passed on to the stack in the same manner--the rightmost is pushed first and leftmost is pushed last. The only difference is that the caller does not have to take care of stack cleanup:
macro stdcall procName, [args]{ if ~args eq reverse push args end if common call procName}
Let's consider a simple example that uses both the calling conventions:
cdecl_proc: push ebp mov ebp, esp ; body of the procedure mov esp, ebp pop ebp, retstdcall_proc: push ebp mov ebp, esp ; body of the procedure mov esp, ebp pop ebp ret 8 ; Increments the stack pointer by 8 bytes after ; return, thus releasing the space occupied ; by procedure parametersmain: ccall ...
Read now
Unlock full access