Enlarged Character Modes

Publication: LISTing Newsletter
Date: May 1991
Pages: 11-12

Enlarged Character Modes – 2068

The ability to print characters larger than normal size, easily and rapidly, could substantially enhance the text and graphical displays of many programs. I created the following machine code routine, and associated procedures, with this ability in mind. The routine allows printing of three enlarged character modes from BASIC…

Regular Characters, Mode 2 Characters, Mode 1 Chars, Mode 3 Chars (printed samples)
Regular Characters, Mode 2 Characters, Mode 1 Chars, Mode 3 Chars (printed samples)
                         MAXIMUM
MODE HIEGHT x WIDTH    CHAR/LN
================================
  1      1   x   2        16
--------------------------------
  2      2   x   1        31
--------------------------------
  3      2   x   2        16
--------------------------------

Printing these character modes from BASIC will entail creating and SAVEing a two line BASIC program (which includes machine code in a REM statement) Then, you can either MERGE it with an existing program or create a new program around it. With these two lines resident in a program you ‘Print’ the enlarged modes using the following procedure…

POKE 23728,line
POKE 23729,column
POKE 23723,mode
RANDOMIZE USR FN a()
REM "char string"

…Just POKE the values for the mode you desire, and the line and column at which you want printing to start, into the appropriate addresses. Then call the MC routine using the RANDOMIZE USR statement followed directly by a REM statement with your string enclosed in qoutes. You can think of this procedure as a hypothetical BASIC statement…

PRINT MODE n; AT ln,cl;"string"

Line and column values are the same as normally used but when referring to the enlarged modes you are specifying the start position for the upper, leftmost portion of the character. For instance; if line=2, column=2, mode=3, and string=”XTEST”…

XTEST printed in mode 3 at line 2, column 2
XTEST printed in mode 3 at line 2, column 2

To create the routine, input the loader program below and RUN it…

1 REM xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
2 DEF FN a()=PEEK 23635+256*PEEK 23636+5
10 LET x=0: LET sum=0
14 ON ERR GO TO 70
20 INPUT a$
22 LET dec=VAL a$
30 POKE FN a()+x,dec
35 PRINT a$;";";
40 LET x=x+1
50 LET sum=sum+dec
60 GO TO 20
70 ON ERR RESET
75 PRINT ,,,,
80 PRINT "Sum=";sum

Transcription note: Lines 35 and 75 are corrected from the printed page: a semicolon in the quotes of line 35 and four commas in line 75.

…it is waiting for you to input the decimal code listing; do so very carefully, you would not want to do it twice.

033;176;092;126;033;175;092;254;
007;040;008;254;015;040;004;203;
134;024;002;203;198;042;085;092;
001;004;000;009;062;034;190;035;
040;002;024;250;229;033;177;092;
078;006;000;033;000;064;009;229;
033;176;092;126;230;007;111;062;
000;038;000;006;005;203;037;203;
023;016;250;103;193;009;229;033;
176;092;001;000;008;126;225;254;
008;056;006;254;016;056;001;009;
009;034;173;092;225;229;126;001;
000;061;197;254;144;056;008;006;
112;144;193;001;088;255;197;006;
032;144;111;062;000;006;003;203;
037;203;023;016;250;103;193;009;
229;033;171;092;126;225;254;001;
040;114;024;002;024;207;062;008;
050;172;092;229;126;087;030;000;
033;171;092;126;254;003;122;040;
123;006;002;042;173;092;197;001;
000;001;009;193;114;035;115;043;
058;172;092;254;001;040;037;254;
005;032;031;120;254;002;032;026;
229;033;175;092;203;070;225;197;
032;009;001;224;007;167;237;066;
193;024;007;001;224;000;167;237;
066;193;016;202;034;173;092;225;
035;058;172;092;061;050;172;092;
032;169;033;175;092;203;070;042;
173;092;040;012;001;000;007;167;
237;066;024;004;024;065;024;140;
001;031;007;167;237;066;017;171;
092;026;254;003;032;001;035;034;
173;092;225;035;062;034;190;200;
024;228;024;133;006;004;033;000;
000;203;063;203;029;203;045;016;
248;006;004;203;063;203;028;203;
044;016;248;084;093;033;171;092;
126;254;001;040;009;024;219;006;
008;197;229;126;024;214;042;173;
092;114;035;115;043;001;000;001;
009;034;173;092;225;035;193;016;
232;042;173;092;001;254;007;167;
237;066;034;173;092;225;035;062;
034;190;200;024;145;120;120;120;
120;120;120;

Sum=34865

When you’ve entered the last decimal code, input an “s”; the program wil respond by printing a value called ‘Sum’. It should equal 34865, if it doesn’t you will have to reinput the code. If you got the correct value, delete program lines 10 through 80 and SAVE the remaining lines. With line 1 and 2 still resident in the computer you are ready to experiment with the procedure I outlined earlier for generating the enlarged characters. But before you do…

You will notice that a manual or automatic attempt at LISTing the line 1 REM statement causes a spurious error report. This occurs because the MC code contains values that the system uses for color code markers. This causes annoying interference with program development and editing. Luckily we can curcumvent the problem by doing the following…

1. LIST 2
2. POKE 23660,30
3. Avoid the following…
a. LIST
b. LIST 1
c. Moving the edit cursor onto line 1

Also; a few words of caution: I included no error trapping in the mc routine. Line and column values out of range could be disastrous, mode values other than 1-3 default printing to mode 2. Wrap around printing was not explicitly designed into the code. Mode 1 will usefully exhibit this behavior, the others will not.

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.