!pr2
Using the PRT Command...............................Bill Morgan

New users of the S-C Macro Assembler have asked for examples of how to use some of the customizing features.  For example, just now I had a call from a gentleman who needed to know how to set up the PRT vector to turn on his printer and send the special control strings it requires.

It happens that I had the same problem just a few weeks ago.  I just picked up an OkiData 92 printer, which I am quite happy with, except for a couple of small warts.  Setting Elite spacing (12 characters/inch, 8 lines/inch) on that printer requires these hex codes:  9C 9B B8.  The catch is that 9C, which corresponds to Control-backslash.  I can't type CTRL-\ on my Apple II+!  Besides, by the time I type in the commands to turn on the printer, set Elite mode, and set a left margin, I have entered 15 keystrokes.  That's too many for my lazy, dyslexic fingers, so I came up with a PRT command to do the whole job.

The addresses in this routine are set up for the 40-column Version 1.1 Language Card assembler.  If you are using another version, check to make sure that the patch space is indeed all zeroes.  All $D000 versions of the assembler have some blank space before $E000.  If you are using a $1000 version, look to see if there is some space available between the end of the assembler and the beginning of the Symbol Table and set PATCH.SPACE to that address.  You will also have to set PRT.VECTOR to $1009.

Here are the exact steps to use this patch:

!lm+5
Start the assembler.

$C083 C083
$D01C:0 D0 0 F8

$AA60.AA61

LOAD S.PRT

ASM

$D01C:0 0 0 0
$C080

BSAVE <assembler>,A$D000,L$XXXX
!lm-5

The $AA60.AA61 line gives you the length that you will need to use for the BSAVE command.  Substitute the filename of the version you use for <assembler> in the above command.

If you are using Version 1.0 of the assembler, things are a little different.  You should omit the $D01C entries in the above commands, delete lines 1090 and 1100, and add this line to the program:

     1125        .TA $800
Then, after the assembly, install the patch with $DF00<800.81EM and $D009: 4C 00 DF.  These extra steps are necessary because Version 1.0 lacks the ability to override memory protection during assembly.

Lines 1270-1290 are where you should install the codes your printer needs.
