<div dir="ltr"><div dir="ltr">On Sat, Jul 13, 2024 at 5:20 PM Aron Insinga <<a href="mailto:aki@insinga.com">aki@insinga.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div>
On 7/13/24 13:36, Paul Winalski wrote:<br>
<blockquote type="cite">
<div dir="ltr">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.
<div class="gmail_quote">
<div><br>
</div>
<div>-Paul W.<br>
</div>
</div>
</div>
</blockquote>
<br>
<br>
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).<br>
<br>
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):<br>
<a href="http://www.bitsavers.org/pdf/mit/rle_pdp1/memos/PDP-1_MIDAS.pdf" target="_blank">http://www.bitsavers.org/pdf/mit/rle_pdp1/memos/PDP-1_MIDAS.pdf</a><br>
p 10 in the document says:<br>
<blockquote>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.<br>
</blockquote>
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):<br>
<a href="https://bitsavers.org/pdf/dec/pdp1/PDP-1_Macro.pdf" target="_blank">https://bitsavers.org/pdf/dec/pdp1/PDP-1_Macro.pdf</a><br>
p 19 in the document says:<br>
<blockquote><img src="cid:ii_190b1ed727511da20051" alt=""> <br></blockquote></div></blockquote><div>Those two quotes from the documentation are saying the same thing. The MACRO quote says the process is this:</div><div><br></div><div>1. Evaluate the expressions in the argument list of the macro.</div><div><br></div><div>2. Substitute these values for the dummy symbols in the macro.</div><div><br></div><div>3. Process the resulting text exactly the same way as non-macro input to the assembler.</div><div><br></div><div>4. Place the resulting binary machine words into the object file.</div><div><br></div><div>Steps (1) and (2) match what the Midas text says. Steps (3) and (4) are conventional processing of assembler input.</div><div><br></div><div>There is nothing unusual here. MACRO is decidedly NOT treating the macro calls as higher-level entities. It is doing simple text substitution and then treating it as it would any other input.<br></div><div><br></div><div>-Paul W. <br></div></div></div>