在vs2017下简单验证__stdcall调用时的出入栈方式,win32平台,Release,关闭帧变量的生成。
-
- void __stdcall test()
测试函数:
void __stdcall test()
{
return;
}
汇编代码:
调用者:
-
- int __stdcall test()
测试函数:
int __stdcall test()
{
return 1;
}
汇编代码:
调用者:
对于int类型来说,使用eax保存返回值。
-
- int __stdcall test(int a)
测试函数:
int __stdcall test(int a)
{
return a;
}
汇编代码:
调用者:
调用者将参数入栈。
函数返回时恢复栈。
-
- int __stdcall test(int a, int b)
测试函数:
int __stdcall test(int a, int b)
{
return a + b;
}
汇编代码:
调用者:
最后一个参数先入栈,第一个最后入栈。
函数返回时恢复栈。