News:

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

More GAS

Started by MichaelW, February 10, 2008, 10:20:28 AM

Previous topic - Next topic

MichaelW

I recently had a chance to play with GAS again, and even though the macro system is still very weak, this time I managed to create some reasonably compact invoke macros. I used the as and ld from Binutils 2.18.50, available here, and the import libraries from a fairly recent distribution of MinGW. I assembled and linked from SciTE using these commands:

command.name.0.*.asm=Assemble
command.0.*.asm=as -v -alsm="$(FileName).lst" -o "$(FileName).o" $(FileNameExt)

command.name.1.*.asm=LinkCon
command.1.*.asm=ld "$(FileName).o" -e start -subsystem console -Lsearchdir"C:\MinGW\lib" -l kernel32 -l user32 -l gdi32 -l msvcrt -o "$(FileName).exe"

command.name.2.*.asm=LinkGui
command.2.*.asm=ld "$(FileName).o" -e start -subsystem windows -Lsearchdir"C:\MinGW\lib" -l kernel32 -l user32 -l gdi32 -l msvcrt -o "$(FileName).exe"


A recent reference is available here.

I made an effort to add quoted string support to the invoke macros, to create a frame macro to automate the stack frames, and several other things, but I could not make them work with the macro system as it currently is.

The attachment contains the macros and two test apps.

[attachment deleted by admin]
eschew obfuscation

drhowarddrfine

binutils is for AS.  If you are using GAS then macros are much better.  Macros in GAS.  Scroll down for that section.

EDIT:  Well, in fact, the '.macro' directive is available in AS, too. 

MichaelW

as.exe is the GNU Assembler. From the page you linked:

Assembling:
GAS:
as –o program.o program.s

And on the page, the GAS: GNU Assembler link is to a page titled "Using as".
eschew obfuscation

drhowarddrfine

Yes, you're right.  I had GCC on my mind.  I've been writing some assembly but compiling it all with gcc because it's interfacing some C stuff.  Plus, I'm stupider early in the morning.