ret, retn, retf - how to use them

前端 未结 3 1014
你的背包
你的背包 2020-12-07 16:12

I have the following asm code:

; int __stdcall wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPWSTR lpCmdLine, int nShowCmd)
_wWinMain@16 proc near
         


        
3条回答
  •  佛祖请我去吃肉
    2020-12-07 16:17

    In the mnemonic ret N, N is the size of parameters on the stack. In this case it is 4 * 4 = 16 (10h) for 4 DWORDs.
    But this only applies to calling conventions when the callee is responsible for stack cleanup. In case of cdecl convention the ret should be without any numbers, as the caller is responsible for stack cleanup.

提交回复
热议问题