Very simple Hello world with nasm. I successful assembly it with nasm.exe main.asm -f win32 -o main.obj and linking it with gcc.exe -fno-use-linker-plugin -o main.obj output.exe
It runs ok, it prints on the screen and then the program crashes (output.exe has stopped working). It seems I made some stuff on the stack but I can't find the error. Is it ok if I pass parameters on the stack (stdcall)? It should, because it prints ok but..
Here's the code
section .data
msg db "Hello, world!", 0
section .text
global _main
extern _printf
_main:
push msg
call _printf
xor eax, eax
ret
Platfor: win8.1 x64, Intel CPU, NASM 2.11, GCC latest version