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

init &char &dev: Macro Expansion of of PUTC (First Version)

The macro facility expands any uses of the PUTC macro in the code to its defined subroutine. For a code fragment using PUTC, the expansion would replace the PUTC instruction with code to load the character from the specified location into a register, compare it to the given value, and write the value if they are not equal, repeating in a loop until finished.

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)
59 views1 page

init &char &dev: Macro Expansion of of PUTC (First Version)

The macro facility expands any uses of the PUTC macro in the code to its defined subroutine. For a code fragment using PUTC, the expansion would replace the PUTC instruction with code to load the character from the specified location into a register, compare it to the given value, and write the value if they are not equal, repeating in a loop until finished.

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 of PUTC (first version)

Suppose that you have a code fragment utilizing PUTC as follows:

. . . &CHAR &DEV
&INIT
JEQ NEXT
DUMPX PUTC (LINE,X), =X'04'
NEXT STA LAST

. . .

Then the macro facility will apply the PUTC definition to produce
the expanded code:
. . .

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

. . .

Note that the parentheses around LINE,X are stripped


(parentheses are used to group comma separated items).

You might also like