pgubook-readers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Pgubook-readers] exit.s on amd64? 0x3c.


From: Guillaume Yziquel
Subject: Re: [Pgubook-readers] exit.s on amd64? 0x3c.
Date: Sat, 02 Jan 2010 00:48:59 +0100
User-agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090707)

Cian a écrit :
Hi Guillame,

Hi Cian.

On Fri, Jan 1, 2010 at 3:48 PM, Guillaume Yziquel
<address@hidden> wrote:

Googling around, I found:
       http://www.vikaskumar.org/amd64/sample.htm

Looks like a nice resource, note the links to the x86-64 ABI docs at
http://www.x86-64.org/documentation.html - these are worth reading.

Yes. Already read them (though not in full detail). They are indeed worth reading.

The thing that I'd like to know is the following:

-1- The syscall numbers are different. Where do you get the list of syscall
numbers?

Under Linux, you should find these via /usr/include/sys/syscall.h.
Note that you may need to follow a couple of #include redirections
from there. For example, on my Ubuntu 8.10 Intrepid install the actual
list of 64bit syscalls is in /usr/include/asm/unistd_64.h, which ends
up getting included (via a somewhat circuitous route) into
sys/syscall.h.

'locate unistd.h | grep x86_64' has also been rather useful on Debian.

-2- Would you believe useful to include a few info in PGU for amd64? (How to
make syscalls, where to find the syscalls numbers, etc...)

I think this would be (increasingly) useful.

Indeed.

However, I'd like to point out something that happens with the power.s code in th PGU book, page 59. I just typed the same code litterally, and I get:

as power.s -o power.o
power.s: Assembler messages:
power.s:14: Error: suffix or operands invalid for `push'
power.s:15: Error: suffix or operands invalid for `push'
power.s:18: Error: suffix or operands invalid for `push'
power.s:21: Error: suffix or operands invalid for `push'
power.s:22: Error: suffix or operands invalid for `push'
power.s:26: Error: suffix or operands invalid for `pop'
power.s:59: Error: suffix or operands invalid for `push'
power.s:82: Error: suffix or operands invalid for `pop'
make: *** [power.o] Erreur 1

It seems that as doesn't like at all stuff like pushl as popl.

Is it because I'm on amd64? If so, how can I deal with it?

All the best,

Guillaume Yziquel.

--
     Guillaume Yziquel
http://yziquel.homelinux.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]