Putcsave Putcloop: Problems With The First Version of PUTC

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Problems with the First Version of PUTC

The PUTC macro definition given as a first example has a severe


flaw in that it can only be used once in any given assembly
language program. If it was used a second time, the labels
PUTCSAVE and PUTCLOOP would get generated again in the
expansion of PUTC in its second location, which in turn would
cause a "duplicate label" error when the expanded code is passed
on to the assembler.

System Variables

To correct for this problem, two additional types of macro "system


variables" are provided to go with the & prefixed variable names
of the prototype statement:

1. Set Variables - & prefixed variables that can be "set" by


the SET directive (with limited arithmetic capability); e.g.
&GCNT.

2. System Qualifiers - $ prefixed symbols with a value that


is automatically adjusted to a new value each time a macro
expansion (not necessarily the same macro) occurs; e.g.,
$LOOP. $ is expanded to $AA for the 1st macro
expansion, $AB for the 2nd and so forth.

You might also like