
SQUARE BRACKETS PATCH for the 4023 by Liz Deal
Superscript-II and Superbase can’t print square brackets, the
backslash character, the up-arrow and backarrow characters.
Neither can Basic. The fault is in the 4023 in text mode, not in
the software. The chip has wrong codes in wrong places.
Patching the problem is fairly simple, if the programs allow to
be modified. Unfortunately the programs I just mentioned
cannot be modified easily. The lack of square brackets in
Superscript is not serious, but it is a big problem in Superbase.
After all, all formulas use square brackets, and I find it distract
ing to get graphic symbols where square brackets are supposed
to go. Also, the wonderful set of Superbase instructions con
tained on the Leighfield/Northrup disk need square brackets
rather badly.
So, I wrote a patch that can be loaded into bank 15 and it
works with all three programs, so long as the printer is in the
text mode (normal Superscript/Superbase setting). The code will
work in Basic, for lower case program listings, for instance. In
addition, since you have control of the machine in Basic, you
can switch my patch in and out, as you change the printer mode.
You will NOT be able to switch the patch in and out in Superbase
and Superscript, since these programs are protected. In the rare
event of you actually switching the printer to the upper
case/graphic mode, my code will fail. In Superscript the backar
row also will not print as it is a control character, but it does
print in Basic.
In any case, the routine is on my UTILITIES#2 disk. It should
be loaded and initialized before loading Superscript or Super
base. The address to turn the patch on is 1644, to turn it off -
1647 in bank 15 ($f0680):
BLOAD"+CIOUT.F0680",D1,B15:BANK 15:SYS 1644
From now, until the machine is reset, the patch is active.
Superscript-II people can attach this to the PRE-SUPER-
SCRIPT (rCeybounce fix) program by inserting a Basic line early
in the loader, which does the same thing. Then when PRE-* is
run, this routine will also load in and be initialized.
This patch does not work in SUPERSCRIPT-III. Obviously
this program changes the vector at the beginning of its run, so
at the moment there isn’t a thing we can do.
The disk will include several other locations which may be
better for Basic environment. In all cases, the ON address is the
same as the loading address displayed in the filename, and the
OFF address is the loading address plus 3 bytes. Hence, you can
put this code in various places, including the cartridge expan
sions. Machine code people can modify it further, as there is
only one fixed address in the code, the patch itself.
CBM 6400 PRINTER CODES
Unlike other CBM printers, 6400 uses no secondary address.
All printer commands are sent via the 2 DIP switches or ESCape
codes. The list of the codes in the manual is confusing at best.
Example: to set absolute horizontal tab, you’re to print, and now
I quote exactly, ESC HT n. So I tried it:
chr$(27)"HT50" and it certainly did not set any tabs at
position 50.
Looking through the numerous examples in the manual
makes it clear that some of those commands aren’t what they
look like. There is a list on page 27 which gives the values for
things like HT, and there is a list on page 36 which gives the
values for all codes which are not on page 27. Both lists are in
hex. The first one shows the hex values in parenthesis, like this
ESC (1BH). This is the same as $1B which is decimal 27. The
second one shows things in binary and hex. Hex numbers are
closest to the actual table, use that. First hex digit is above the
table, second hex digit is to the left. So, for instance, in the CBM
table, "3" is $33 and "a" is $41. And control character HT is
$09, control character DC1 is $11, control character CS is $8D
and so on.
Armed with a little hex to decimal converter, you can write
any commands to the printer you wish. You may want to fix one
bug, on page 27, CR or carriage return is $0D (13 decimal), not
$0C. So how do you set absolute horizontal tab? Once the file
is opened, say file #7, you’d print:
PRINT #7, chr$(27)chr $(9) chr $(50).
Watch it. Many settings are of the N-l variety, so when you
say, for instance, that you want the horizontal motion index to
be 6, the printer interprets it as 5.
Programs such as Superscript handle all controls for you. But
to access the printer yourself, you need to have a table of all
commands. The table at the end of this article shows the ESC
codes to follow PRINT#7, statement.
Putting some of the features together, this little routine will
print in "bit-graphic" mode a square. The method can be used
to dump hi-res pictures. A 320 pixels wide screen takes a full
13-inch paper.
10 es$= chr$(27): hm$ = chr$(31):vm$= chr$(30)
20 cr$=chr$(13):hf$=chr$(es$+"u":rem try half linefeeds
30 open 4,4:print#4,es$"%"cr$;es$"2";cr$;
40 print#4,es$hm$chr$(6);es$vm$chr$(3);:rem tight
vmi,hmi
50 tb $ = "...............................":rem 24 dots
60 sd$=". .":rem dot 22-spaces dot
70 print#4,tb$;hf$ :rem top line
80 for j = l to Ien(tb$)-2
90 print#4,sd$;hf$:next j :rem middle lines
100 print#4,tb$;hf$ :rem bottom line
110 print#4,es$hm$chr$(12)es$vm$chr$(9):rem normal
vmi,hmi
120 close 4
PRINTING SEVERAL USER-CHARACTERS W/4023
Your 4023 manual shows how to build user character, some
thing of your own. Then they hint that multiple characters can
be sent if you play with carriage return without a linefeed. What
they don’t tell you is that their instructions are doomed to failure.
Nothing works. I normally turn on the diagnostics to see why
nothing works, and find that what the printer tells me is a
catch-22 situation. I cannot send a second defined character until
I terminate a line. I cannot terminate a line before redefinition.
But I read TPUG magazine and therein was a solution.
(Ranjan Bose, The 1526/MPS 802 Printer, TPUG Magazine,
issue 24, page 21). It turns out that the 4023 book is wrong, no
great surprise really. The solution is simple - instead of sending
eight bytes to the printer, send 9. The ninth byte should be a
binary zero, CHR$(0) in BASIC. Actually, ten bytes need to go
there, the last being a carriage return (important for Machine
Code, but in BASIC if a line is terminated by NO semicolon,
the return character goes out to the bus).
6
Northwest Computer News
Comentarios a estos manuales