Hello arch users!

I am running Arch64:
[EMAIL PROTECTED] 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:

[EMAIL PROTECTED] elf]\$ nasm -f elf64 tiny.asm
[EMAIL PROTECTED] elf]\$ gcc -s -Wall -nostdlib tiny.o
[EMAIL PROTECTED] elf]\$ ./a.out; echo $?
42

What is my error here?


Kind regards,
Michael Krauss

Reply via email to