I'm trying, unsuccessfully, to call printf
from an assembly program as follows:
section .rodata
preffix: db "calc >",0
preffix_length: equ $-preffix
section .text
align 16
global main
extern printf
main:
push preffix
push preffix_length
call printf
ret
But I keep getting segmentation fault.
I'm writing in Linux (ubuntu) for NASM assembly 80x86.