Well, guys and gals, we have attempted to bring Daisy into the 21st century, by making better use of RAM and faster I/O operations.
In order to retain all Daisy’s features in the process of optimization, we have broken it out into four specialized routines, which Loads and Executes rapidly.
We still use some virtual memory, but we incorporate RAMDISK as much as possible, like for storing menus. Then, instead of waiting for a file to LOAD from disk, we only wait for a bank to switch, from Home to Dock and back, again!
Of course, Zillion has some faster and larger replacements for the Z80 chip, but they require a modified Operating System. So, we limit ourselves to the Z80 chip, LKDOS, and RAMDISK.
Our new and new and improved version of Daisy in matched to our 9 pin printer, M1109 by Brother.
We wrote “stymn.B6”, in order to bring out the best features of our printer, and we wish to now consider how the Busy signal is handled on the printer channel #3. The 2068 looks at the printer port 127 for a busy signal, IN 127 :
3 IF IN 127 = 229 THEN RETURN
4 GO TO PI
Note, that GO TO PI is a way of saving memory, when all we need is GO TO 3, and we check that printer be idle, before sending any control codes, OUT PO, so, say, to the printer :
GO SUB PI: OUT PO, so (where we have po=127 and zo=27.)
Also note, that my 9 pin printer has IN 127 = 102, when it is BUSY, different from the 24 pin printer! But, the way it is coded, we are looking for printer idle, all the way !
For our 9 pin printer, we use our Print Style Menu to select among Pica, Elite, and Italic, after specifying Condensed, Enlarged, and Double-Strike. Then, we “set” the printer, by sending all the selected information out Port 127 by frequent use of GO SUB PI … . After the BEEP, we can ESCAPE to either the Format Menu or the Function Menu.
Making use of the pre-selected parameters, the matrix printer follows all our wishes, regarding print chain to print out Daisy documents with.
By GO SUB il, we mean to PAUSE and read the keyboard for input and PRINT our selection (where we have il=2550.)
2550 GO SUB sq: PAUSE oo: LET z=CODE INKEY$-CODE "o": PRINT #RND;z: RETURN
With sq=2576, we call the Bill’s SQuawk routine.
As discussed above, the Print Style menu, ps.C1, is loaded as a Screen String.
Print Style Menu FIRST select print mods (4-7) (1) Pica (80 CPL) (2) Elite (96 CPL) (3) Italic (80 CPL) NEXT select print style (1-3) (4) Condensed (1.6 times CPL) (5) Enlarged (half CPL) (6) Double-Struck (same CP0 (7) None (reset) (8) Format menu (9) Function menu LX= TB= QQ= LL=
8001 LET con=oo: LET enl=oo: LET dst=oo
8002 ON ERR RESET : GO SUB il+oi: RANDOMIZE USR m1: LOAD "ps.C1"SCREEN$
8003 LET c=od+ps: INPUT ;: PRINT AT oe,oa;" ";AT of,oa;" ";AT og,oa;" ";AT c,oa;"█";AT ot,og;lx;" ";AT ot,oq;tb;" ";AT ou,og;qq;" ";AT ou,oq;ll;" ";AT ok,oa;(" " AND NOT con)+("█" AND con);AT ol,oa;(" " AND NOT enl)+("█" AND enl);AT om,oa;(" " AND NOT dst)+("█" AND dst);AT on,oa;(" " AND z-og)+("█" AND z=og): LET xo=lx: LET lo=ll
8004 GO SUB il: IF z<oa OR oi<z THEN INPUT ;: GO TO k8+od
8005 IF og<z THEN GO TO k8+m1+op
8006 IF z<od AND ps=z THEN GO TO k8+ou
8007 IF z<od THEN LET ps=z
8008 IF pr=oa AND z=og THEN LET con=oo: LET enl=oo: LET dst=oo: GO TO k8
8009 IF pr=oa AND z=od AND ps-oc THEN LET con=NOT con
8011 IF pr=oa AND z=oe AND ps-oc THEN LET enl=NOT enl
8014 IF pr=oa AND z=of THEN LET dst=NOT dst
8016 GO TO k8+oc
8020 IF pr=oa THEN ON ERR GO TO k8+ob: LET lx=(CODE "P" AND (ps=oa OR ps=oc))+(CODE "£" AND ps=ob)+(CODE "8" AND (con AND ps=oa))+(CODE ":" AND (con AND ps=ob)): LET qq=INT (lx/ob): LET lx=(lx AND NOT enl)+(INT (lx/ob) AND (enl AND ps-oc)): LET qq=(qq AND NOT enl)+(INT (qq/ob) AND (enl AND ps-oc)): LET tb=INT (0.5*(lx-ll))
8021 IF pr=ob THEN LET lx=(CODE "T" AND (ps=oa OR og<z))+(CODE "b" AND ps=ob)+(CODE "S" AND (con AND ps=oa))+(CODE "B" AND (con AND ps=ob)): LET qq=INT (0.5*(lx+oa))
8023 GO SUB k8+ou+of
8024 CLS : PRINT AT oj,oc;"One Moment Please-"''TAB oc;"Printer is setting . . . ": GO SUB mt: BEEP oa/od,zo: GO TO k8+ob
8026 LET ma=INT (0.5+lx*lo/xo): GO SUB k8+ou+oh: BEEP oa/ob,ov: RETURN
8028 CLS : PRINT AT oj,ob;"KeyIN LINE Length"''TAB ob;lx;"=Max ";ma;"=Match Margins": INPUT "INPUT LINE Length : ";ll: LET ll=(ll AND ll<=lx)+(lx AND lx<ll): LET tb=INT (0.5*(lx-ll+oa)): CLS : RETURN
8031 IF pr-oa THEN RETURN
8034 GO SUB PI: OUT po,os: GO SUB PI: OUT po,zo: GO SUB PI: OUT po,t8: GO SUB PI: OUT po,zo: GO SUB PI: OUT po,m1+oo: GO SUB PI: OUT po,oo: GO SUB PI: OUT po,zo: GO SUB PI: OUT po,t5+oc: GO SUB PI: OUT po,ou: GO SUB PI: OUT po,zo: GO SUB PI: OUT po,t7+ob
8035 IF ps=oc THEN GO SUB PI: OUT po,zo: GO SUB PI: OUT po,t5+ob: RETURN
8036 LET NNN=(ps-oa)+con*od+dst*oq+enl*CODE " "
8037 GO SUB PI: OUT po,zo: GO SUB PI: OUT po,t3+oc: GO SUB PI: OUT po,NNN: RETURN
8115 ON ERR RESET : IF z=oh THEN GO TO fm+oj
8116 GO TO fm
Well, guys, what can we say about Bill Jones’ suite of Word Processors, that goes by the name of Daisy ?
First, Daisy was conceived and implemented in the days of expensive RAM and slow peripherals.
Second, Daisy is still marvelous, for getting so much performance out of the little TS2068 computer.
Last, Daisy can be customized (“matched”), so as to mobilize the best features of whatever 9 or 24-pin printer be in use.
So, Daisy is a fine example of programming in BASIC, using Virtual Memory. Today, “memory is Cheap!”
Referring to the first article in this series, Winter of 1994, any necessary customization is limited to DOS conversion, “stymn.B6”, and “ps.C1” .
Assuming that we have gotten over the DOS hurdle, we are so familiar with printer matching, controlling, and styling, as to be able to write our own “stymn.B6” and “ps.C1”
Bill wrote “stymn.B6”, in order to bring out the best features of his 24-pin printer, and we wish to consider how the BUSY signal is handled on the printer channel #3. The 2068 looks at the printer port 127 for a busy signal, IN 127 :
8080 IF IN 127 = 253 THEN GOTO bu
8082 RETURN
where Bill has bu = 8080.
Now, when the printer is busy, Bill has IN 127 = 253, and he checks for Printer Busy by GOSUB bu …..
Actually, Bill checks, that PRINTER is IDLE, before sending any control codes, OUT po, zo, say, to the printer:
GO SUB bu: OUT po,zo
(where we have bu=8080, po=127, and zo=27.)
Mr. Earl Kielgass of Tempe, AZ uses the same CPI cable for both 9-pin and 24-pin printers. He wonders why it works for one but not for the other. Well, IN 127 returns different values for 9-pin than 24-pin printers. His Word Processor is Tasword, and, between 9-pin and 24-pin printers, there may be many such differences in the CPI interfaces.
For the 24-pin Printer, Bill uses his Print Style Menu to select among Pica, Elite, Micron, and Compressed style, after specifying Script, Expanded Height, Italics, and Underline. Then, he “sets” the printer, by sending all the selected information out PORT 127 by frequent use of GO SUB bu … . After the BEEP, he can ESCAPE to either the Format Menu or the Function Menu.
Remember, at program LOAD, we pressed 3, 2, 1, y, y. and y ? Well, in so doing, we committed ourselves to assigned values for pr of 0, 1, or 2. pr=0 is for the 2040 printer. pr=2 indicates daisy wheel printer. But, pr=1 gives us the matrix printer, where all the variable selections come alive.
By GO SUB il, Bill means to PAUSE and read the keyboard for input (where we have il=2550
2550 PAUSE oo: LET t$=INKEY$: IF t$=" " THEN GO TO il
With sq=2576, Bill calls the Squawk routine
2576 INK og: BEEP os/oj, VAL "40": RETURN
As discussed above the print style menu, ps.C1 is LOADed as a SCREEN$ string. It’s contents should be printed below:

8001 LET it=oo: LET com=oo: LET exp=oo: LET und=oo: LET scrp=oo
8002 RANDOMIZE USR ml: LOAD "ps.Cl"SCREEN$ : LET c-oe+ps: PRINT AT of,ot;" ";AT og,ot;" ";AT oh,ot;" ";AT oi,ot;" ";AT c,ot;"@"; AT os,og;lx;" ";AT os,op;tb;" ";AT ot,og;qq;" ";AT ot,op;ll;" "; AT ok,oc;(" " AND scrp=oo)+("@" AND scrp=oa);AT ol,oc;(" " AND e xp=oo)+("@" AND exp=oa);AT om,oc;(" " AND it-oo)+("@" AND it=oa) JT on,oc;(" " AND und=oo)+("@" AND und=oa): LET px=ps: LET xo=l x: LET px=ps: LET lo=ll
8003 GO SUB sq: GO SUB il: IF z=oo OR z<oi THEN GO TO VAL "8003"
8004 IF z=oi OR z=oo THEN GO TO VAL "8114"
8005 IF pr>oa THEN LET lx=(84 AND ps<ob)+(VAL "98" AND ps=ob)+( VAL "126" AND ps>ob): LET qq=INT (lx/ob+oa/ob)
8006 IF pr=oa THEN LET lx=(VAL "80" AND ps(ob)+(VAL "96" AND ps nob)+(VAL "120" AND ps=oc)+(VAL "137" AND ps>oc): LET qq=INT lx/ob+oa/ob)
8012 IF pr=oa AND z=oe THEN LET serp=NOT scrp: GO TO VAL "8002"
8014 IF pr=oa AND z=of THEN LET exp=NOT exp: GO TO VAL "8002"
8016 IF pr=oa AND z=og THEN LET it=NOT it: GO TO VAL "8002"
8018 IF pr=oa AND z=oh THEN LET und=NOT und: GO TO VAL "8002"
8020 IF z<oe THEN LET ps=z
8021 IF pr=ob THEN LET lx=(VAL "84" AND ps=oa)+(VAL "98" AND ps=ob)+(VAL "124" AND ps=oc)+(VAL "137" AND ps=od): LET qq=INT (lx/ob+oa/ob): GO SUB VAL "8026": GO TO VAL "8002"
8022 IF pr=oa THEN LET lx=(VAL "80" AND ps=oa)+(VAL "96" AND ps=ob)+(VAL "120" AND ps=oc)+(VAL "137" AND ps=od): LET qq=INT (lx/ob+oa/ob): GO SUB VAL "8026"
8024 CLS : PRINT AT oj, oc "One Moment Please-"''TAB oc;"Printer is setting. . .": GO SUB mt: GO SUB VAL "8050": BEEP oa/od,zo: GO TO VAL "8002"
8026 LET ma=INT (oa/ob+lxllo/xo): GO SUB VAL "8028": BEEP oa/ob, ov: RETURN
8028 CLS : PRINT AT oj, ob;"Key in Line Length"''TAB ob;lx;"=Max ";ma;"=Match Margins": INPUT "Input Line Length ";ll: LET tb=INT ((lx-ll)/ob+oa/ob): CLS : RETURN
8030 REM * The Dot Matrix Printer Control*
8031 IF pr<>oa THEN RETURN
8034 GO SUB bu: OUT po.os: GO SUB bu: OUT po,zo: GO SUB bu: OUT po,VAL "119": GO SUB bu: OUT po,oo: GO SUB bu: OUT po,zo: GO SUB bu: OUT po,VAL "87": GO SUB bu: OUT po,oo; GO SUB bu: OUT po,zo GO SUB bu: OUT po.VAL "45": GO SUB bu: OUT po,oo: GO SUB bu: 0 UT po;zo: GO SUB bu: OUT po,VAL "53"
8036 GO SUB bu: OUT po,VAL "27": GO SUB bu: OUT po,VAL "120": GO SUB bu: OUT po,oa: GO SUB bu: OUT po,VAL "27": GO SUB bu: OUT p o,VAL "107": GO SUB bu: OUT po,oo
8038 IF ps=oa THEN GO SUB bu: OUT po,zo; GO SUB bu: OUT po,t8
8040 IF ps=ob THEN GO SUB bu: OUT po,zo: GO SUB bu: OUT po,VAL "77"
8042 IF ps=oc THEN GO SUB bu: OUT po,zo: GO SUB bu: OUT po,VAL "103"
8043 IF ps=od THEN GO SUB bu: OUT po,zo: GO SUB bu: OUT po,t8: GO SUB bu: OUT po,zo: GO SUB bu: OUT po,op
8044 RETURN
8052 IF exp=oa THEN GO SUB bu: OUT po,VAL "27": GO SUB bu: OUT po,VAL "119": GO SUB bu: OUT po,oa.
8054 IF it=oa THEN GO SUB bu: OUT po,VAL "27": OUT po,VAL "52"
8056 IF und=oa THEN GO SUB bu: OUT po,VAL "27": GO SUB bu: OUT po,VAL "45": GO SUB bu: OUT po,oa
8058 IF scrp=oa THEN GO SUB bu: OUT po, VAL "27": GO SUB bu: OUT po, VAL "120": OUT po,oa: GO SUB bu: OUT po, VAL "27": GO SUB bu: OUT po,VAL "107": GO SUB bu: OUT po,od:
8060 RETURN
8080 IF IN 127=253 THEN GO TO bu
8082 RETURN