I am trying to learn ASM, and want to try a few things combined with C++. The ASM part is done in a naked function. But whenever I call the function (empty) the application crashes in the next function. What should I do in the naked function to make it work, do I need to pop esp or something? An example could be helpfull.
_declspec(naked) void asmfunc()
{
_asm
{
}
}
int _tmain(int argc, _TCHAR* argv[])
{
i = 1;
asmfunc();
cout << i << endl; // <-- crash
system("pause");
return 0;
}