Comparative assembler function parameters into the stacking order

1, C language function parameters into the stack in reverse order, i.e. a function call, the first push rightmost parameters, restore the stack pointer by the caller.

 

2, Pascal and C language function conventions agreed on the contrary, it provides parameters are passed from left to right and restore the stack by the callee.

 

3, __stdcall which is a function call. Parameters onto the stack order __stdcall function of the way from right to left, Pascal is the default invocation, typically used win32 API, the stack is empty themselves upon exit.

    __stdcall is the pushing of the parameters in the order of C language (right to left), but the C language difference is that it is cleared by the callee parameters from the stack, so it's compiled files are smaller than _cdecl.

    __stdcall is the default Windows API function calling convention, VB, VFP, also adopted this convention.

    __cdecl is the default method calls the C language used for the memory stack parameters is transmitted to the caller to maintain. Call implementation of variable parameters can only use this method. Is the default call parameters of MFC.

    __Fastcall function registers are used to pass parameters embodiment, VC compiled function will be added after the "@" prefix in front of the function name, the number of bytes after the function name with "@" and parameters.

Guess you like

Origin www.cnblogs.com/alhope/p/11778464.html