i try write simple assemble program with printf function. I compile it nasm -f elf 64
and link using gcc
. After run i see segmentation fault
. What is wrong?
[Bits 32]
extern printf
global main
section .data
hello:
db "Hello", 0xa, 0
section .text
main:
push hello
call [printf]
add esp, 4
mov eax, 1
mov ebx, 0
int 80h