Subject: Re: Assembly hello world help..?
To: None <sudog@sudog.com>
From: Brett Lymn <blymn@baesystems.com.au>
List: netbsd-help
Date: 05/29/2001 16:26:02
According to sudog@sudog.com:
>
>Isn't that something other than a simple "-1" like what write claims
>to return in write(2)?
>
Yes, the actual error number is encoded into the return so that
errno() can pick it out and tell you what went wrong. The write
library call would return -1 but there is a little bit of code twixt
user call and syscall that would do this.
Unless I am wildly wrong, it looks like you got an E2BIG - your
argument list is too long which probably means that your crafting of
the stackframe for the system call is not quite correct.
>any particular reason why this sort of banging around wouldn't work?
>Is int 0x80 the wrong one?
>
Absolutely no reason at all - when it comes down to it a compiler is
just a simplified user interface to the assembler which is just a
simplified interface to the binary instruction stream. As long as you
do all the right things the processor will not be able to tell a hand
crafted syscall from a compiler generated one.
--
===============================================================================
Brett Lymn, Computer Systems Administrator, BAE SYSTEMS
===============================================================================