0% found this document useful (0 votes)
72 views1 page

Macro Expansion of Second Version of PUTC

This document summarizes the expansion of the second version of the PUTC macro. It shows the code fragment with a call to the PUTC macro. Given that 4 prior calls have occurred, the global counter &GCNT is 4. The macro expansion then shows the code generated by replacing the PUTC call, including incrementing &GCNT to 5 for the next expansion. Temporary variables like SAVE5 are also generated as needed.

Uploaded by

Mohamed Med
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
72 views1 page

Macro Expansion of Second Version of PUTC

This document summarizes the expansion of the second version of the PUTC macro. It shows the code fragment with a call to the PUTC macro. Given that 4 prior calls have occurred, the global counter &GCNT is 4. The macro expansion then shows the code generated by replacing the PUTC call, including incrementing &GCNT to 5 for the next expansion. Temporary variables like SAVE5 are also generated as needed.

Uploaded by

Mohamed Med
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Macro Expansion of Second Version of PUTC

Using the same code fragment as for the first version of PUTC,
. . .

JEQ NEXT
DUMPX PUTC (LINE,X), =X'04'
NEXT STA LAST

. . .

for the sake of illustration assume that 4 prior macro calls for
PUTC have occurred before the macro facility encounters this
code fragment, so the value of the global set variable &GCNT has
incremented to 4. Then the expansion in this case will be

. . .

JEQ NEXT
.DUMPX PUTC (LINE,X), =X'04'
DUMPX STA SAVE5
LDCH LINE,X
J LOOP5
SAVE5 RESW 1
LOOP5 TD =X'04'
JEQ LOOP5
WD =X'04'
LDA SAVE5
NEXT STA LAST

. . .

Note that the in expanding the call, the macro facility incremented
the value of &GCNT from 4 to 5.

You might also like