I've got a question about macros, and I'd like to have my understanding checked.
Does a macro have this format:
.macro <name> <parameters>
<code>
.endmacro
(or equivalents)
and is it called like this:
.macroname <parameters>
Furthermore, does the assembler inline the macro code wherever the macro is called?
Macros replace the text before doing any assembly, so yes this is kind of like "inline".
I presume you're asking about ca65 but you didn't specify. Here's the manual page for macros, it has examples that should answer your questions:
http://www.cc65.org/doc/ca65-12.html
While I'm currently using ASM6, I would expect that there could only be a token's worth of difference between assemblers (I'd wager on it being mostly syntax).
Thank you for your response.
Macros aren't standard at all between assemblers.
It is any moment like this that I feel a renewed understanding of the well-known 'facepalm.' And yet, from the three assemblers that I've seen, the syntax for defining a macro is no more standard than the syntax for using a directive, or the list of directives that each assembler supports. Could you please inform me on what further differences there can be, so that I don't find myself talking bull like I just did?
There is no standard of any kind, on any level, across assemblers: period. You need to refer to the documentation that comes with the assembler you're using, and get familiar with it. If you change assemblers, you're almost certainly going to need to change syntaxes. This applies to nearly everything -- including operand syntax (but usually not opcodes). Get familiar with the tools you'll be using, and be patient (with yourself + the learning process); many of us here have been doing this for decades.