These books present opposite approaches to designing a library of reusable Intel 8080 Assembly code:

- Macros: "Mastering CP/M" by Alan Miller, 1983

- Subroutines: "CP/M Assembly Language Programming" by Ken Barbier, 1983

· · Web · 1 · 2 · 3

im more of a subroutine guy, macros are too assembler-dependant.

but ill also preprocess assembly with m4 for include files and yes, occasional macros...

@goosey By the way, what Assembly toolchain do you use with m4? Which CPU do you target?

i have an 8080 cross assembler, asm80 that i maintain for unix and risc os
it is based on cpm's ASM.COM so no macros....

also the old motorola 68xx cross assemblers. their docs recommend m4 for macros/file inclusion which is where i got the idea

the internet assures me that i am insane to use m4.

@goosey Do you have an asm80 project site?

I'm another insane who uses m4 for Assembly macros

no git but the tarball and/or zip has full source

(the source is basically identical. RO version may have slightly better docs -- in an obscure RO hypertext format 😛)

when i get a week where my world isn't on fire I'd like to experment with sdf's gittea server but thats not this week.

i don't quite understand the hatred directed at m4. its a good solid generic macro processor. it's syntax is old-school but it's not that bad... gpp is a newish thing and not everybody has a seperate C preprocessor (or wants to fight it to make it not emit poundLINE lines!!!)

hatred for macros on general, OK I do get. macros are powerful and dangerous. but why people pick on m4 specifically?

@goosey Thanks!

Although m4 has a steep learning curve, for basic stuff it's not that bad. And m4's killer feature is its ubiquity.

Do you have any links to Motorola 68K cross-assembler documentation or other resources with examples of m4 Assembly macros?

for whatever reason I don't have anything for cross assembling m68k. 😢

all the 68k assembly ive done was either on a Sun 3 or a AT&T UNIX PC.

@goosey No problem, thanks anyway.

I found a microcontroller assembler that comes with an m4 macro package: The m4 source has plenty of examples of using m4 for Assembly macros:

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!