In a course about C/C++ , I have the following assembly code named hello-x64.S :
.text
.global _start
_start:
movl $len,%edx
movl $msg,%ecx
movl $1,%ebx
movl $4,%eax
int $0x80
movl $0,%ebx
movl $1,%eax
int $0x80
.data
msg:
.ascii "Bonjour le monde!\n"
len = . - msg
I have executed as indicated with the lines :
as -o hello-x64.o hello-x64.S
ld -o hello-x64 hello-x64.o
./hello-x64
But in my case, I have the following error message.
Segmentation fault (core dumped)
Could someone explain to me why , please ?
Thank you