At Thu, 17 Jul 2025 01:02:21 +0530 (GMT+05:30), Mohan <[email protected]> wrote: Subject: unix assembly programming > > is it common to use m4 with gas? are there examples > i can learn from or just general resources for unix asm > programming?
In my experience everyone doing assembly language programming in modern
Unix and Unix-like environments seems to use the C preprocessor for
anything macro-like. It's a very poor solution, but it does the basic
things cleanly enough and is terribly easy to integrate, and is
generally portable enough. It can be used to do a lot, e.g.:
https://github.com/WestfW/structured_gas
I'd somehow never heard of "gasp", but then again I've never used the
GNU assembler other than maybe once or twice to test if it could
assemble something I wrote. It looks useful.
My favourite macro assembler was MACRO-11, for the PDP-11 (my favourite
machine to write assembler for!). There's a version of it available in
ancient BSD archives, however it only knows PDP-11 op codes. DEC may
have had a version for VAX, but I only ever used PDP emulation on a VAX
for assembler -- I don't think I ever wrote any native VAX assembler. I
didn't really ever do a lot with it's macro capabilities, but I really
liked it overall.
I would emphatically NOT use m4 as a macro processor for assembler. I'm
sure it would work, and would be able to do "interesting" things, but I
think it's too general purpose and probably too finicky (too expressive)
to be actually useful in the things one might want it to do when writing
assembler.
--
Greg A. Woods <[email protected]>
Kelowna, BC +1 250 762-7675 RoboHack <[email protected]>
Planix, Inc. <[email protected]> Avoncote Farms <[email protected]>
pgpLvc8qQxdUR.pgp
Description: OpenPGP Digital Signature
