[arch-general] system call numbers on amd64
Hello arch users! I am running Arch64: [mickraus@gandalf lib]\$ uname -m x86_64 Looking into /usr/include/asm/unistd.h, it uses unistd_64.h on AMD64. According to this file the _exit syscall has number 60. But on my machine I have to use syscall 1 instead, as listed in unistd_32.h. Here is an example code for nasm (the version in extra repo is far deprecated by the way, had to compile a newer version by myself): ; tiny.asm BITS 64 GLOBAL _start SECTION .text _start: mov eax,1 mov ebx,42 int 0x80 This works. But changing the 1 to 60 breaks. Build procedure: [mickraus@gandalf elf]\$ nasm -f elf64 tiny.asm [mickraus@gandalf elf]\$ gcc -s -Wall -nostdlib tiny.o [mickraus@gandalf elf]\$ ./a.out; echo $? 42 What is my error here? Kind regards, Michael Krauss
participants (1)
-
Michael Krauss