> Here it is:
> .text
> .global _start
> _start:
>       pushl   $0
>       movl    $1, %eax
>       int     $0x80
> I looked everywhere (Developer's handbook, Google, ...) to find the solution, 
> but all resources I consulted tell me this is the right way to do it.
> This program, however, always exits with 1 regardless of the value I push.
> Please, can someone tell me that I made a really stupid error? I'm already 
> pulling my hair out.

I sympathize. This has actually cost me quite some nerves as well, before
through some debugging and experimentation I found the answer:

The kernel expects the first argument 4 bytes below of the current stack
pointer, which means you have to put the int 80h call on its own label to
get it right. 

I usually use nasm (hate AT&T syntax, sorry),
should translate easily, something like:

        push 0
        mov eax, 1
        call syscall

        int 80h

should do the job.

Greetings, J.

[EMAIL PROTECTED] mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to