0% found this document useful (0 votes)
51 views

A Final Version of PUTC Using System Qualifiers

This document discusses improving the PUTC macro to use system qualifiers to avoid naming collisions between different macro expansions. The improved macro prepends a $ symbol followed by an increasing letter to reserved symbols and labels for each expansion. For this example, the fourth expansion uses symbols and labels starting with $AE.

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)
51 views

A Final Version of PUTC Using System Qualifiers

This document discusses improving the PUTC macro to use system qualifiers to avoid naming collisions between different macro expansions. The improved macro prepends a $ symbol followed by an increasing letter to reserved symbols and labels for each expansion. For this example, the fourth expansion uses symbols and labels starting with $AE.

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

A Final Version of PUTC using System Qualifiers

Revisiting the PUTC macro using system qualifiers, an "even


better" construction might be:

MACRO
&INIT PUTC &CHAR, &DEV
&INIT STA $SAVE
LDCH &CHAR
J $LOOP
$SAVE RESW 1
$LOOP TD &DEV
JEQ $LOOP
WD &DEV
LDA $SAVE
MEND

This time, if 4 prior macro expansions have occurred, not


necessarily to PUTC and not necessarily using the $ system
qualifier, the $ system qualifier has been advanced through $AA,
$AB, $AC, and $AD, so for this expansion the code will be

. . .

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

⇒ Each macro expansion gets its own $ system qualifier,


whether or not it uses the $ system qualifier.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy