Talk:MACRO-10

Latest comment: 7 years ago by Steamerandy in topic Unique macro expansion

First thing I noticed is that the DEC-10 is not a mini computer. It is a 36 bit word mainframe. In some ways like the IBM 7094.

One of the great features of macro-10 was it macro implementation. A macro could be redefined and was only expanded during an expansion. If you used a macro within a macro the iner-macro is not expanded during the defining of the outer macro but during it's expansion. This feature was commonly used in generating corresponding tables.

You would define a list macro (I am rusty on the syntax)

define tabgen <
   item   s1,"string 1"
   item   s2,"string 2"
 ...
   item   sn,"string n"
>

define item(a,b) <
a:   ASZIIZ b
>
   tabgen
define item(a,b) <
   XWD 0,a   
>

The above generates a table of pointers pointing (second expansion of tabgen) to the strings generated by the first expansion of tabgen.

In other assemblers I have used the define of tabgen would cause an error as item has not been defined. It is trying to expand item in defining tabgen.

In macro-10 macros are not expanded during the defining of a macro. This seams to unique to macro.

— Preceding unsigned comment added by Steamerandy (talk

contribs) 08:48, 22 September 2014 (UTC)Reply

A start, at least edit

I've based this heavily on the corresponding MACRO-11 page, for which I beg the indulgence of that page's authors...

It has references and example code listings, but it needs more work on the first section - I'll try to add more about the actual macro facilities in the next few days. Please do chip in and add anything that you think would be useful!

I've changed the code a little from the specimen on Wolfram Rösler's page, since there's a defect, if not a bug, in the specimen: it's not good practice to simply call MONRT., since the user may always issue a CCONTINUE or CONTINUE command which would produce an error; it's much better for the instruction following a MONRT. to resume execution at a safe and sensible place. I've also added more profuse comments. Kay Dekker (talk) 17:51, 5 April 2009 (UTC)Reply

Unique macro expansion edit

It may be a bit hard to explain.

When a macro is defined it may include macros. When defined it is only text. Contained macros are only text.

When the macro is later used iner macros are expanded.

This means iner macros may be defined after a maco containing then. They may even be redefined between between the use of the outer macro containing them.

This was used in TOPS-10 to generate corosponding tables. Steamerandy (talk) 15:28, 23 November 2016 (UTC)Reply