I'm trying to do a Simple Hello World app using C++ inline asm. something along these lines
I've tried all sorts of variations on this, but none of them seem to work.Code:#include <windows.h> void main() { char* msg = "Hello World"; char* cap = "A Message"; // MessageBox(0,msg,cap,0); //This is what the asm should do __asm { mov ebx, msg mov ecx, cap push 0 push ecx push ebx push 0 call MessageBoxA } }
I am getting a message box, but rather than saying "Hello World" it says "Unhandled excaption in Tests.exe: 0xC0000005: Access violation." I've stepped through the code and it raises it on the call MessageBoxA line, what am I doing wrong that causes the computer to make such a strange spelling mistake?




Reply With Quote