我尝试在我的asm代码中使用printf,但我得到Segmentation fault(core dumped)
这是我的代码:
section .data
msg db "current char is %d", 0x0a, 0x00
section .text
global main
extern printf
main:
push rbp
mov rbp, rsp
push 123
push msg
xor rax,rax
call printf
mov rsp, rbp
pop rbp
mov rax, 1
mov rbx, 0
int 0x80
BTW我用:
nasm elf64 file.asm
然后
gcc file.o
我会喜欢任何帮助或建议。感谢。