On 7/13/24 13:36, Paul Winalski wrote:
Neither the VAX assembler nor the VAX MACRO
compiler treats macros as high-level entities. I know of no
assembler that would do such a thing.
This morning I would have agreed with you but I think I found a
counter-example. At MIT, there were 2 assemblers written for the
TX-0 and later ported and retargeted to the PDP-1: MACRO (which DEC
adopted) and then Midas (which MIT stayed with for the PDP-6 and
PDP-10).
The MIDAS assembler manual says that it copies characters from the
macro body into the source program (as we would expect to happen
today for a macro, as opposed to an inline procedure):
http://www.bitsavers.org/pdf/mit/rle_pdp1/memos/PDP-1_MIDAS.pdf
p 10 in the document says:
When a macro instruction is called, MIDAS reads out the
characters which
form the macro-instruction definition, substitutes the characters
of
the arguments for the dummy arguments, and inserts the resulting
characters into the source program as if typed there originally.
However, the DEC PDP-1 MACRO assembler manual says that a macro call
is expanded by copying the *sequence of 'storage words' and
advancing the current location (.) for each word copied* (although
it does replace labels with memory addresses):
https://bitsavers.org/pdf/dec/pdp1/PDP-1_Macro.pdf
p 19 in the document says: