how do i write assembly code in amd64

Lyle Miller lm101ml at bellsouth.net
Fri Jan 4 14:40:42 PST 2008


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?

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


More information about the freebsd-amd64 mailing list