Date: Tue, 8 Jan 2008 23:12:51 -0600 From: "Conrad J. Sabatier" <conrads@cox.net> To: Lyle Miller <lm101ml@bellsouth.net> Cc: freebsd-amd64 <freebsd-amd64@freebsd.org> Subject: Re: how do i write assembly code in amd64 Message-ID: <20080108231251.5669bd18@serene.no-ip.org> In-Reply-To: <477EB268.2090403@bellsouth.net> References: <d38327e0712221956t7b7ead72xda3f65e15a23b1a@mail.gmail.com> <Pine.LNX.4.64.0712222028270.32093@knuth.cs.hmc.edu> <20080104210751.GA18913@dragon.NUXI.org> <477EB268.2090403@bellsouth.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 04 Jan 2008 17:25:44 -0500 Lyle Miller <lm101ml@bellsouth.net> wrote: > David O'Brien wrote: > > On Sat, Dec 22, 2007 at 08:29:46PM -0800, Nate Eldredge wrote: > > > >> On Sun, 23 Dec 2007, zhang feng wrote: > >> > >>> i write asm32 code in linux.when i run the code in freebsd amd64, > >>> it cannt run. someone give me a help for coding asm64 in freebsd. > >>> > >> amd64 has a whole different instruction set than 32-bit x86, > >> > > > > Not true at all. 97% of the instructions are the same. What is > > different is the operand size and the C calling ABI. > > > > For the most part, code can be port by simple s/%e/%r/. > > > > > > look at some of the freebsd www documentation - handbooks and > articles: freebsd developers handbook? > freebsd architecture handbook? Precisely. See file:///usr/share/doc/en/books/developers-handbook/book.html#X86 (if you have the doc dist installed locally, or its counterpart on the FreeBSD website). This explains the differences in calling conventions between Linux and FreeBSD at the assembly coding level. > look at the under developers -> platforms -> amd64 project from > www.freebsd.org. > > look at some of the freebsd asm coding in the source tree: > cd /usr/src/sys > find . -name '*.[s|S]' -print | grep amd64 -- Conrad J. Sabatier <conrads@cox.net> "Procrastinate now; don't put it off." -- Ellen Degeneres
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080108231251.5669bd18>