--- title: "Printer Driver" id: 55069 type: "computer_media" slug: "printer-driver" url: "http://localhost/computer_media/printer-driver/" markdown_url: "http://localhost/computer_media/printer-driver.md" published_at: "2024-06-14T01:24:05+00:00" modified_at: "2026-03-30T21:44:47+00:00" author: "David Anderson" featured_image: url: "http://localhost/wp-content/uploads/2019/02/20230809-041332.jpg" excerpt: "A parallel printer port installer that patches system channel tables, loads multiple machine code screen-dump routines, and walks you through every configuration option step by step." category: - name: "Archived Media" slug: "archived-media" taxonomy: "category" url: "http://localhost/category/archived-media/" post_tag: - name: "Downloadable" slug: "downloadable" taxonomy: "post_tag" url: "http://localhost/tag/downloadable/" - name: "TS 2068" slug: "ts2068" taxonomy: "post_tag" url: "http://localhost/tag/ts2068/" model: - name: "Timex/Sinclair 2068" slug: "ts-2068" taxonomy: "model" url: "http://localhost/model/ts-2068/" indiv: - name: "John Oliger" slug: "john-oliger" taxonomy: "indiv" url: "http://localhost/indiv/john-oliger/" - name: "Thornton Benson" slug: "thornton-benson" taxonomy: "indiv" url: "http://localhost/indiv/thornton-benson/" - name: "Tom Kalogerson" slug: "tom-kalogerson" taxonomy: "indiv" url: "http://localhost/indiv/tom-kalogerson/" genre: - name: "Printer" slug: "printer" taxonomy: "genre" url: "http://localhost/type/printer/" media_type: "Program" programmers: - name: "John Oliger" slug: "john-oliger" taxonomy: "indiv" url: "http://localhost/indiv/john-oliger/" - name: "Tom Kalogerson" slug: "tom-kalogerson" taxonomy: "indiv" url: "http://localhost/indiv/tom-kalogerson/" - name: "Thornton Benson" slug: "thornton-benson" taxonomy: "indiv" url: "http://localhost/indiv/thornton-benson/" download_url: "https://archive.org/download/timex-sinclair-software-archive/Printer%20Driver%20%281985%29%28John%20Oliger%29%28TS2068%29%28US%29%28Program%29.zip" mediadate: "1985" producer_company: - id: 10990 title: "John Oliger Co." type: "company" url: "http://localhost/company/john-oliger-co/" related_products: - id: 11563 title: "2068 Parallel Printer Port" type: "product" url: "http://localhost/product/2068-parallel-printer-port/" media_type_tags: "Printer" --- # Printer Driver This program is a software handler installer and user guide for the John Oliger Company’s parallel printer port interface for the TS2068. After loading a machine code block from tape, it patches the system’s CHANNEL table by poking four bytes starting at an address derived from system variables at 23631–23632, redirecting LPRINT, LLIST, PRINT #3, and LIST #3 through the new I/O port at 127 (7Fh). The installer lets the user choose from five screen-dump routines — Okidata, Olivetti PR2300, ASCII, Gemini 10X, and Gorilla/Banana — copying the appropriate machine code from loaded string arrays (x$, y$, z$, g$, w$) into RAM starting at address 24320. An optional carriage-return/line-feed toggle is also configurable via a POKE to system variable 23545, and the program can save itself back to tape before erasing the BASIC area with CLEAR and DELETE. *** ## Program Analysis ### Program Structure The program flows linearly through several distinct phases: splash screen and tape loading (lines 10–60), channel table patching (line 70), CR/LF option selection (lines 80–100), an extended multi-page user guide (lines 110–273), screen-dump routine selection and installation (lines 170–245), further informational pages (lines 250–330), and finally a self-save/self-erase sequence (lines 360–420). There are no subroutines; all branching is handled with `GO TO` for retries and sequential fall-through for the main path. ### Machine Code Loading and Channel Table Patching Line 60 loads a raw machine code block from tape with `LOAD ""CODE`. Line 70 then patches the system CHANNEL table to redirect printer output through the new hardware port: - `PEEK 23631 + PEEK 23632 * 256` reads the CHANS system variable (the base address of the channel table), then adds 15 to reach the printer channel entry. - Four consecutive POKEs write the bytes `11`, `91`, `0`, `91` into that entry, replacing the output and input routine addresses for the printer channel with pointers into the newly loaded machine code. This is a standard TS2068 technique for hooking BASIC I/O channels without modifying ROM, making LPRINT, LLIST, PRINT #3, and LIST #3 all route through the Oliger port at I/O address 127 (7Fh). ### CR/LF Configuration Line 90 pre-sets system variable 23545 to 0 (no auto line feed). Line 100 reads user input and, if “y” or “Y” is entered, POKEs CHR$ 10 (ASCII LF) into both address 23545 and position 30 of `z$`. This gives the installed driver a run-time flag controlling whether a line feed is appended after every carriage return — a common compatibility requirement between printer models. ### Screen-Dump Routine Selection Five machine code screen-dump routines are stored as string arrays pre-loaded alongside the CODE block. The user selects one by two-letter code, and the appropriate array is copied byte-by-byte into RAM starting at address 24320 using a `FOR`/`NEXT` loop with `CODE x$(n-24319)`: | Key | Routine | Array | Length (bytes) | | --- | --- | --- | --- | | OK | Okidata APA graphics | `x$` | 97 | | OL | Olivetti PR2300 ink jet | `y$` | 96 | | AS | ASCII character dump | `z$` | 60 | | GB | Gorilla/Banana | `g$` | 97 | | GE | Gemini 10X | `w$` | 141 | The selected routine is invoked at runtime via `RANDOMIZE USR 24320`. Invalid input causes a `BEEP` and a `GO TO 170` retry loop (line 245). ### Key BASIC Idioms - The variable `o` is initialized to 0 at line 10 and used throughout as a zero literal, saving token space in frequently repeated contexts such as `AT o,o`, `PAPER o`, and `POKE 23545,o`. - `PRINT #1;AT o,o;` at line 40 writes to the lower message area (stream 1) to display the copyright notice without disturbing the main display area. - Line 90’s `LET z$(30)=CHR$ o` pre-initializes element 30 of the ASCII dump string array before the INPUT check overwrites it conditionally — ensuring a defined default. - The `INPUT AT 1,o;` idiom at multiple lines positions the input prompt on line 1, column 0, keeping it out of the scrolling text area. ### Save and Self-Erase Sequence Line 400 handles the optional backup: it saves the BASIC program by name with `SAVE "Oli PRCODE" LINE 10` (auto-starting at line 10), then saves the 256-byte machine code block from address 23296 as a separate CODE file named `"prcd"`. After the save, it loops back to line 360 to re-display the exit prompt. Line 410 executes `CLEAR` to erase all BASIC variables and reclaim memory, and line 420 uses `DELETE ,` — a TS2068-specific command — to delete the BASIC program itself, leaving only the installed machine code and channel table changes resident in memory. ### Notable Anomalies - Line 340 uses the literal `0` in `INPUT AT 1,0;` rather than the variable `o` — a minor inconsistency with the rest of the program’s style, but functionally identical. - The word “parimeter” in line 120 is a misspelling of “parameter,” and “annoted” in line 250 is a misspelling of “annotated”; these are textual issues only and do not affect execution. - The screen-dump routine for Gorilla/Banana (line 235) is handled before the Gemini (line 240), but both are checked with cascading `IF` statements rather than a structured dispatch, which means all prior conditions are re-evaluated for each invalid input — a minor inefficiency. ## Source Code ``` 10 LET o=0: INK 5: PAPER o: BORDER 0: CLS 20 PRINT AT 5,o;" THE JOHN OLIGER CO. PARALLEL PRINTER PORT SOFTWARE HANDLER" 30 PRINT AT 12,o;"CODE LOADING...Leave recorder on" 40 PRINT #1;AT o,o;" \*1984 The John Oliger Co."'" All rights reserved" 50 INK o: PRINT AT o,o 60 LOAD ""CODE : INK 5 70 LET x=(PEEK 23631+PEEK 23632*256)+15: POKE x,11: POKE (x+1),91: POKE (x+2),o: POKE (x+3),91 80 PRINT AT 1,6;"STOP YOUR RECORDER": BEEP 1,1: PAUSE 45: CLS : PRINT ''"Some printers require a line feed after a carriage return, while others do not."'''"Please press now if your printer requires this line feed inserted, or only if your printer doesn't need it or you don't know."'''"(If your printer prints on top of previous printing, later, youcan reload this program and thenselect the ""y"" option)" 90 POKE 23545,o: LET z$(30)=CHR$ o 100 INPUT " or only";a$: IF a$="y" OR a$="Y" THEN POKE 23545,10: LET z$(30)=CHR$ 10 110 CLS : PRINT " The software to control the printer with the LPRINT, LLIST, PRINT #3, and LIST #3 has been stored in the printer buffer of your TS2068 computer, and the changes to the CHANNEL table have been made for you." 120 PRINT '" The LPRINT command is used as with the TS2040 printer...same applies to the LLIST command. LPRINT TAB works up to a max. column of 255, as will the AT statement's column parimeter. The comma can be used in LPRINT statements to tab out to the next 16 column field, but it will give you problems if used many times and then using a TAB or AT command. (A CR would probably be inserted before the new text printed with the AT or TAB)" 130 INPUT AT 1,o;" for more...";a$ 140 CLS : PRINT " The COPY command will still do a screen dump to the 2040 printer. To dump the screen to your full size printer enter RANDOMIZE USR 24320. So far thissoftware supports HI-RES screen dumps via this USR call only forthe OKIDATA printers supporting APA graphics, the OLIVETTI PR2300 ink jet printer, the Gem-ini 10X, and the Gorilla/Banana." 150 PRINT '" If your printer is not one of those shown above, There is one more screen copy routine that will send the screen to your printer as a file of ASCII characters. All non-ASCII chars will be printed in this routine as a space. While this routine is NOT a HI-RES dump, it WILL work with ALL printers." 160 INPUT AT 1,o;" for more.";a$ 170 CLS : PRINT '" Select the screen copy routinethat you desire to be accessed via the RANDOMIZE USR 24320 command." 180 PRINT ''" KEY IN:" 190 PRINT '" for the Okidata"''"
    for the Olivetti"''" for an ASCII dump"''" for the Gemini 10X"''" for Gorilla/Banana" 200 INPUT AT 1,o;"
      ??";a$ 210 IF a$="OK" OR a$="ok" THEN FOR n=24320 TO 24415: POKE n,CODE x$(n-24319): NEXT n: GO TO 250 220 IF a$="OL" OR a$="ol" THEN FOR n=24320 TO 24414: POKE n,CODE y$(n-24319): NEXT n: GO TO 250 230 IF a$="AS" OR a$="as" THEN FOR n=24320 TO 24379: POKE n,CODE z$(n-24319): NEXT n: GO TO 250 235 IF a$="GB" OR a$="gb" THEN FOR n=24320 TO 24415: POKE n,CODE g$(n-24319): NEXT n: GO TO 250 240 IF a$="GE" OR a$="ge" THEN FOR n=24320 TO 24459: POKE n,CODE w$(n-24319): NEXT n: GO TO 250 245 BEEP .5,20: GO TO 170 250 CLS : PRINT " It is hoped that hi-res screendumps for other printers will beincluded on this tape in the future. If you own another brandprinter capable of hi-res graph-ics, write a screen copy routinefor it in mc, and don't mind sharing your software with otherusers of this port, please send a copy to The John Oliger Co forpossible inclusion on this tape in the future. Fully annoted assembly listings are included in the Oliger Printer I/F User Manual to show you how these work and use as examples." 260 PRINT " No payment can be made for useof your routine, but you WILL be credited for writing it. I would like to thank Ray Kingsleyof SINWARE for writing 99.9% of the ASCII character screen dump." 270 INPUT AT 1,o;" for more...";a$ 272 CLS : PRINT '" I would like to thank Tom Kalogerson for his Gemini 10X high resolution screen dump. I'm sure all of you Gemini own- ers will appreciate Tom's work on this software for your printer." 273 PRINT '" Thanks also to Thornton E. Benson for his work on the Gorilla/Banana high resolution screen dump. With the price of the Banana what it is today, there are bound to be many peo- ple very appreciative of Thorn- ton's labors. Also, because the Banana is manufactured by Pro- writer, it is possible this dumpmay work on some of the other Prowriter printers." 274 INPUT " for more...";a$ 280 CLS : PRINT " The hardware for the Oliger Parallel Printer Port is I/O mapped at port 7Fh (127d) and only bit 4 of the port is read back as a ""Printer Ready"" signalwhich is low if the printer is ready for data (the ""READY"" LED on the port will also be lit at this time) or high if the printer is NOT ready or ""BUSY""." 290 PRINT '" USER DEFINEABLE characters areprinted on the printer as thier normal ON POWER UP characters (A-U), and the block graphics characters will print as spaces." 300 PRINT '" The CR character is sent at each ENTER character found (CHR$ 13), so LLISTS will print out the full width that your printer can handle on long lines" 310 INPUT AT 1,o;" for more...";a$ 320 CLS : PRINT " This printer I/F is nearly compatible with software that supports the AERCO 2068 printer I/F, as it uses the same IO portand BUSY bit that Aerco uses. Ifyou have software that supports the Aerco I/F and would like to make this port fully emulate theAerco I/F, see assy. instr. step5. (Done on preassembled units)" 325 PRINT " To check if the printer is busy from Basic, INKEY$#3 will return the letter R if ready or B if busy. Thus 100 IF INKEY$#3=""B"" THEN GOTO 100 will wait tillthe printer is ready before falling through." 330 PRINT " If you would like a hard copy listing of this program's Basicprinted on your printer, enter ""p"" at this prompt." 340 INPUT AT 1,0;"

      or only";a$ 350 IF a$="p" OR a$="P" THEN LLIST 360 CLS : PRINT '" This BASIC program will erase itself when you next press the key, ready to load in orkey in an application program using the Oliger Printer Port. The nec. MC and table changes will stay." 370 PRINT '" For a back up copy of this program, input at thenext prompt." 380 PRINT '" Ignore error report given after next prompt if only is pressed." 390 INPUT AT o,o;" To clear Basic AREA";AT 1,o;"or SAVE";a$ 400 IF a$="s" OR a$="S" THEN SAVE "Oli PRCODE" LINE 10: SAVE "prcd"CODE 23296,256: BEEP 1,1: CLS : GO TO 360 410 CLEAR 420 DELETE , ```