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.

-Paul W.


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:

I am quite surprised.

[For those who may not know, the TX-0 was built at MIT Lincoln Lab in 1956 and, when it was no longer useful for their research, it was moved onto the campus where the model railroad club found it and started hacking.  DEC was spun off from Lincoln Lab, with the result that the PDP-1 was very similar to the TX-0, and an early PDP-1 was installed in the room on campus next to the TX-0.  But that was all before my time.]

- Aron