78
tional pitch, condensed print, expanded print, boldface, em-
phasized, and the underlining. Line 40 cancels the superscripts
and the subscripts. Line 50 sets the line spacing to l/6 inch, and
line 60 sets the left-aligned printing. Then, line 70 ends the
macro definition. This printer will remember this macro until
the power is turned off or until a new macro is defined. A macro
can hold up to 16 bytes (characters) of information. The one that
we defined contains thirteen.
Now that you have defined a macro, let’s see how to use it.
This program will print one line using several printing features.
Then it “calls” the macro in line 60. When line 80 prints the
style is “plain vanilla” because the macro has reset it.
10 LPRINT CHR$(2'7);"Q";CHR$(40);
20 LPRINT CHR$(27);"af';CHR$(2>;
30 LPRINT CHR$(27);"-1";
40 LPRINT CHR$(27>;"h";CHR$(l);
50 LPRINT "TESTING ABCD"
60 LPRINT CHR$(27>;"t";CHR$(l);
;; g;I?INT "TESTING ABCD"
TIES-b I INI: AIBC::ll2 _.__.,_-.-,.. - _.-..... - -.... - ..-..,. “___I-.......-...
lIZ.S'T 1: IG AECI?
n Reading a hex dump
We’ve seen how to make a hex dump in Chapter 1, but it’s not
really clear what we can do with one. We need a little
background first.
The BASIC in some computers changes ASCII codes before
they send them to the printer. If you run into problem because
of this, try this hex dump to check the ASCII codes.
First turn off the printer and run the following program. Hold
down both the Paper Feed key and Mode key and turn on the
printer.
10 FOR I=0 TO 255
20 LPRINT CHR$(I);
30 NEXT I
40 LPRINT
50 END