#include <iostream>
#include <Windows.h>
using namespace std;
int main() {
const char* message = ("hi");
__asm {
print:
push ebp;
mov ebp, esp;
mov ebx, [ebp + 8]; <- First argument
push ebx;
call printf;
mov esp, ebp;
pop ebp;
ret;
mov eax, message;
push eax;
call print;
};
std::cin.get();
return (0);
};
I'm using an inline assembler obviously. I don't understand why this is an error, I've tried using leave instead of destroying the stack frame manually, no luck. I don't understand where I went wrong here.