PARSE64

Developer(s): Michael DiRienzo
Date: 1990
Type: Program
Platform(s): TS 2068
Tags: 64 Column

PARSE64 prints text 64 characters to a line on the ordinary TS2068 screen. The text goes in the string S$, preceded by CHR$ column + CHR$ line and followed by CHR$ 255, and RANDOMIZE USR 65250 prints it. Lines run from 0 to 23 and columns from 0 to 31, and text wraps to the left edge after the 64th column. The demo fills the screen with the alphabet in capitals and lower case and the digits.

Michael J. DiRienzo explains in the Mike’s Notebook column of September 1990 that, instead of the usual 768 bytes for 96 characters, the character set uses half as many: each eight-byte definition holds one character in its left four bits and another in its right four bits. The routine works out which half it needs and prints only bits 4–7 or 0–3.

Program Analysis

  • Line 1 DIMensions S$ to the longest text plus 3, as the column requires.
  • Lines 5–30: the demo.
  • Lines 9800–9900: loader. CLEAR 64862, POKE 557 bytes into 64863–65419 with a checksum of 39831, then RUN.
  • The code looks at the first variable in the variables area and returns at once unless it is the character array S$, which is why line 1 must DIMension it before anything else. It then reads the column and line and writes half-width characters into the display file, appearing to keep a flag for whether the next one goes in the left or right half of a cell.

Notable Techniques

  • Two 4-pixel-wide characters per definition halve the font to 384 bytes.
  • Position, text and terminator are passed in one string, so no POKEs are needed between calls.

Potential Issues

  • The code is not relocatable, and S$ must be the first variable the program creates.

Typed in from the Mike’s Notebook column on RMG Enterprises’ monthly RMG UPDATES disk for September 1990, where the program exists only as a listing in the column’s text. The DATA total matches the checksum in line 9830. It was tokenized for tape and tested in ZEsarUX.

Related Articles

The following bit of machine code will allow you to print any text string using a clean, fast 64 column character set.
Occasionally I have a need to print text in 64 column format. Most print methods in common use resort to...

Related Content

Image Gallery

Source Code

    1 DIM S$(67)
    5 FOR N=0 TO 23
   10 LET line=N: LET column=0
   20 LET S$=CHR$ column+CHR$ line+"ABCDEFGHIJKLMNOPQRSTUVWXYZ-abcdefghijklmnopqrstuvwxyz-1234567890"+CHR$ 255: RANDOMIZE USR 65250
   30 NEXT N: PAUSE 0: STOP 
 9800 CLEAR 64862: LET t=0
 9810 FOR n=64863 TO 65419
 9820 READ a: POKE n,a: LET t=t+a
 9830 NEXT n: IF t<>39831 THEN PRINT "Data Error! Recheck DATA lines": STOP 
 9840 RUN 
 9850 DATA 0,0,0,0,2,2,2,2,0,2,0,0,80,85,7,5,7,5,0,0,44,125,98,52,123,35,0,0,98,162,64,176,160,208,0,0,34,65,65,65,65,34,0,0,0,82,34,119,34,82,0,0,0
 9860 DATA 0,0,7,0,32,64,0,1,1,2,2,4,36,0,0,54,82,82,82,82,98,0,0,39,81,18,33,65,118,0,0,71,84,86,113,17,22,0,0,55,65,97,82,84,36,0,0,50,85,37,83,81,102,0,0,0,0,34,0,34,4,0,0,0,16,39,64,39,16,0,0,2,69,33,18,32,66,0,0,98,213,213,183,133,117,0,0,99,84,100,84,84,99,0,0,103,84,86,84,84
 9870 DATA 103,0,0,115,68,100,69,69,67,0,0,87,82,114,82,82,87,0,0,21,21,22,21,21,101,0,0,69,71,71,69,69,117,0,0,98,85,85,85,85,82,0,0,98,85,85,101,71,67,0,0,99,84,82,97,81,86,0,0,117,37,37,37,37,35,0,0,85,85,85,87,87,37,0,0,85,85,37,34,82,82,0,0,118,20,36,36,68,118,0,0,67,65,33,33,17,19,0,0,32
 9880 DATA 112,32,32,32,32,15,0,48,70,97,39,69,119,0,0,64,99,84,84,84,99,0,0,16,50,85,87,84,51,0,0,16,35,117,37,37,35,6,0,66,96,82,82,82,81,0,0,36,5,38,38,37,37,64,0,32,37,39,39,37,21,0,0,0,98,85,85,85,82,0,0,0,99,85,85,85,99,65,0,0,51,68,66,65,70,0,0,32,117,37,37,37,19,0,0,0,85,85,87,87
 9890 DATA 37,0,0,0,85,85,37,85,83,6,1,2,114,20,34,66,113,0,4,34,34,33,34,34,36,0,6,89,175,13,15,9,6,0,42,75,92,126,254,211,192,1,6,0,9,237,91,95,253,213,58,97,253,245,203,255,50,97,253,94,35,86,35,122,230,7,15,15,15,131,95,122,230,248,246,64,87,229,225,126,35,229,254,255,32,11,225,241,50,97,253,209,237,83,95,253,201,205,38,255
 9900 DATA 24,232,213,6,8,79,33,98,253,22,0,214,32,95,203,59,235,41,41,41,25,209,213,203,65,32,5,126,230,240,24,9,126,203,39,203,39,203,39,203,39,245,58,97,253,203,71,32,6,26,230,15,18,24,14,241,203,63,203,63,203,63,203,63,245,26,230,240,18,241,235,182,119,235,35,20,16,201,209,58,97,253,203,71,32,7,60,230,129,50,97,253,201,28,237,83,95,253,230,128,50,97,253,201

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