On Tuesday 02 March 2004 20:15, ari wrote:
> [EMAIL PROTECTED] said this stuff:
> > Finally I came up with the simplest ASM program that reproduces the
> > error. 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.
>
> .text
> .global _start
> _start:
>         pushl   $8
>         pushl   $0
>         movl    $1, %eax
>         int     $0x80

With this suggestion, it always returns 0 instead of 1.
Shouldn't pushl place 4 bytes on the stack? It translates into the instruction 
0x6A (pushes only one byte).
BTW, when I assemble it with as(1), there is always an extra instruction after 
my code, and it's a different one each time (and it's always one that 
effectively does nothing). Who ordered that? Is it because of alignment 
constraints in the ELF file?


_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to