News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

AMD64 GAS Documtentation ?

Started by DarkWolf, December 24, 2007, 12:54:37 AM

Previous topic - Next topic

DarkWolf

I have an AMD Athlon X2, would anyone know where to find information for 64 bit assembly ?

This is an Xubuntu box so I am looking for GAS documentation.
I am not that worried about dual-core just yet, I can deal with that later.
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

farrier

DarkWolf,

Look at the fasm, flatassembler.net  Open source, liberal license, very powerful!

Actively developed and supported 32/64 bit assembler for DOS, Windows, Linux and other nixes, Solaris, and other.

hth,

farrier
It is a GOOD day to code!
Some assembly required!
ASM me!
With every mistake, we must surely be learning. (George...Bush)

drhowarddrfine


DarkWolf

I see a IA-64 section in that link but the only AMD section I saw was for 3D Now.
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

DarkWolf

--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

Ghirai

No, ia64 reffers to Intel Itanium architecture, whereas amd64 reffers to the x86-64 architecture (Intel's implementation name was EMT64T, now Intel 64 afaik).
Most likely you would want the amd64 docs.

So IA-64 != AMD64 :bg

I'd add that you would normally find Itanium CPUs in enterprise-grade servers, not in desktops.
MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html

DarkWolf

I asked because the only 64 bit info I could find in drhowarddrfine's link was Intel's.

Trial and error, I can't even get a pop()/push() instruction to work on an AMD64 X2

Has anyone else tried Gas assembly on an AMD64 ?
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

MichaelW

There doesn't appear to be very many things that are x86-64 specific.

http://sourceware.org/binutils/docs-2.18/as/i386_002dDependent.html#i386_002dDependent

The ability to select a 64-bit word size only for the ELF object file format would seem to be a serious impediment to x86-64 development for Windows.
Quote
--32 | --64
Select the word size, either 32 bits or 64 bits. Selecting 32-bit implies Intel i386 architecture, while 64-bit implies AMD x86-64 architecture.

These options are only available with the ELF object file format, and require that the necessary BFD support has been included (on a 32-bit platform you have to add enable-64-bit-bfd to configure enable 64-bit usage and use x86-64 as target platform).

Edit:

Perhaps not, it looks like objcopy may be able to convert between object file formats.

eschew obfuscation

DarkWolf

That's more complicated than what I was hoping to find.

If I could get Gas to compile the source converting the obj code might be an idea, but I am having trouble getting it to compile on this machine.

I am not sure where my difficulty lies, am I using a 32 bit Gas on a AMD64 machine ?
Man page says there is a IA-64 switch but I can't find that section in the man page.
There are x86_64 scripts listed in the binutils package for ld (linker)

Ah Ha,
Found more information in the info page for as.
There is a --64 switch for the i386 verison that will assemble for x86_64 arch.

I'll have to check it out more.
--
Where's there's smoke, There are mirrors.
Give me Free as in Freedom not Speech or Beer.
Thank You and Welcome to the Internet.

Ghirai

Maybe you would like to give nasm a try?
http://nasm.sourceforge.net

It's somewhat 'nicer' than GAS :U
MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html

drhowarddrfine

Not to go OT but I much rather prefer GAS to Nasm.

Ghirai

MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html

drhowarddrfine

I was afraid you would ask that but it's been a long time since I compared.  One is that I can seamlessly work between my OS, all the gcc languages and assembly.  If you bring up the syntax issue then it's a non-issue for me.  I have zero problems with it.

Ghirai

Good for you, GAS syntax annoys me pretty bad.

I like NASM because of the syntax, and because it outputs in quite a few formats:

Quote    bin       flat-form binary files (e.g. DOS .COM, .SYS)
    aout      Linux a.out object files
    aoutb     NetBSD/FreeBSD a.out object files
    coff      COFF (i386) object files (e.g. DJGPP for DOS)
    elf32     ELF32 (i386) object files (e.g. Linux)
    elf       ELF (short name for ELF32)
    elf64     ELF64 (x86_64) object files (e.g. Linux)
    as86      Linux as86 (bin86 version 0.3) object files
    obj       MS-DOS 16-bit/32-bit OMF object files
    win32     Microsoft Win32 (i386) object files
    win64     Microsoft Win64 (x86-64) object files
    rdf       Relocatable Dynamic Object File Format v2.0
    ieee      IEEE-695 (LADsoft variant) object file format
    macho     NeXTstep/OpenStep/Rhapsody/Darwin/MacOS X object files

Also last time i checked GAS docs were pretty thin, might have changed though.

Sorry for the OT, just having a conversation, i don't intend to start an assembler flamewar :bg
MASM32 Project/RadASM mirror - http://ghirai.com/hutch/mmi.html

drhowarddrfine

I'm sorry you need all that.  a.out is all I need.   :toothy