Keyword (Kendall/Dohany)

Developer(s): Glyn Kendall, Jack Dohany
Date: 1984
Type: Program
Platform(s): TS 2068

KEYWORD lets you enter BASIC program lines by typing keywords out in full (LOAD, REM, RANDOMIZE…) in capitals, separated by spaces, instead of with single keystrokes. A special cursor replaces the K and L cursors while it is on, CAPS LOCK works, and Extended Mode and Symbol Shift keywords can still be entered with single keys. It is switched on and off by GO TO 9900, or by POKEs to 26690 and 26691 that the instructions give. The instructions explain that 305 bytes of machine code are loaded at 40000, and that a 51-byte start-up routine moves the 224-byte main routine into place and hooks it in through the channel information area.

The REMs read “KEYWORD by Glyn Kendall, from YOUR COMPUTER, 6-84, adapted for 2068 by Jack Dohany”. This is the version on CATS Library Tape 3. It is Keywrd1.tap in the Keyword download, which also holds Dohany’s later KEYWORD V5; the CATS copy adds only save lines. Jack Dohany’s phone number in the REM has been left out of the listing below.

Program Analysis

Most of the BASIC is a paged instruction text; GO SUB 100 waits for a key between pages. The machine code block kwcode (400 bytes at 40000) does the installation, and the program explains that the installer then deletes the BASIC lines that called it, along with the code at 40000 to 40305, as “dead weight”.

Appears On

Balance your checkbook, decode cryptograms, or trace your BASIC program's execution path — Tape 3 is where serious productivity meets hands-on programming. Highlights include a word processor, a flat-file database, machine code loaders, and a complete darkroom formulary.

Related Content

Source Code

    1 REM KEYWORD
    2 REM by Glyn Kendall
    3 REM from YOUR COMPUTER,6-84
    4 REM adapted for 2068 by         Jack Dohany
   10 CLS : PRINT TAB 5;"KEYWORD INSTRUCTIONS"
   12 PRINT '"1. KEYWORD allows two modes of  BASIC program entry: the normal single-keystroke entry, with KEYWORD off, and ""typed-keyword"""'"entry with KEYWORD on." 
   13 PRINT '"With KEYWORD on, program lines"'"can be entered without using"'"SYMBOL SHIFT or Extended Mode."
   14 PRINT '"2. KEYWORD can be turned off or"'"on by GOing TO 9900."
   16 PRINT '"3. KEYWORD should be loaded onlyinto a ""clean machine""- that is,one that's just been turned on."
   18 PRINT '"4. For technical reasons,"'"KEYWORD can only be saved right"'"after loading. Details later."
   20 GO SUB 100
   22 PRINT "5. RAMTOP is now ";PEEK 23730+256*PEEK 23731;"."''"The 224 bytes of KEYWORD code"'"are safely tucked away within"'"the operating system."''"KEYWORD can only be hurt by"'"the commands NEW or RAND USR 0."
   24 PRINT '"BASIC or ML programs can now be"'"LOADed or MERGEd,and the presentBASIC lines can all be deleted."'"BUT if you delete lines 9900"'"-9999, then you can only switch"'"KEYWORD on or off as follows:"
   26 PRINT '"ON:"'"POKE 26690,208: POKE 26691,92"''"OFF:"'"POKE 26690,14: POKE 26691,12"
   28 GO SUB 100
   30 PRINT "6. ***USING KEYWORD***"''"-A special cursor ( > ), is usedwhen KEYWORD is on, replacing"'"the normal K and L cursors."
   32 PRINT '"-You can do everything with"'"KEYWORD on that you can with"'"it off. The only difference is"'"that keywords (such as LOAD,"'"REM, RANDOMIZE) are typed out"'"IN FULL, IN CAPS, SEPARATED BY"'"A SPACE."
   34 PRINT '"-CAPS LOCK works; use it!"
   36 PRINT '"-If you run into problems, try"'"CAPS SHIFT-1 (EDIT)."
   38 GO SUB 100
   40 PRINT "7. NOTE: Even with KEYWORD on,"'"Extended-Mode and Symbol-Shiftedkeywords  can  be  entered as"'"single keystrokes. They can"'"also be typed out." 
   42 PRINT '"8. TECHNICAL DETAILS:"'"-305 bytes of ML code are first"'"loaded at 40000. The tail end"'"of that code is then called"'"(via RAND USR 40275) to move"'"the 51-byte STARTUP routine to"'"23300 (in printer buffer)."
   44 PRINT '"-The STARTUP routine is then"'"called, only once; it can later"'"be destroyed, when the printer"'"is used. This routine makes"'"room for the MAIN program at"'"26730, and sets up the Channel"'"Information Area (26690,1) to"'"divert input control."
   46 GO SUB 100
   48 PRINT "TECHNICAL DETAILS: (Continued)"
   50 PRINT '"-The 224-byte MAIN program is"'"then moved from 40051 TO 23760,"'"where it will be accessed if"'"the Channel Info Area has its"'"address."
   52 PRINT '"-The original code from 40000"'"to 40305 is now dead weight."'"So it is removed, along with"'"the BASIC lines that called"'"it. This can be seen by"'"loading KEYWORD and hitting"'"BREAK during a SAVE."
   54 PRINT ''TAB 9;"***THE END***"
   55 PRINT ''"PS:"'"Dead Weight should be deleted."
   56 GO SUB 100
   58 CLS : GO TO 9964
  100 INPUT "COPY? "; LINE q$: IF q$="y" OR q$="Y" THEN COPY /
  101 IF q$=" STOP " THEN STOP 
  102 CLS : RETURN 
 9900 REM KEYWORD
 9901 REM by Glyn Kendall (YOUR  COMPUTER 6-84); adapted for 2068 by Jack Dohany 
 9902 INPUT "KEYWORD ON? (y/n)"; LINE q$
 9904 IF q$="y" OR q$="Y" THEN POKE 26690,208: POKE 26691,92: POKE 23658,8
 9906 IF q$="n" OR q$="N" THEN POKE 26690,14: POKE 26691,12: POKE 23658,0
 9910 INPUT "SAVE KEYWORD? (y/n)"; LINE q$
 9912 IF q$="y" OR q$="Y" THEN SAVE "KEYWORD" LINE 9950: BEEP .01,25: CLS : PRINT "PLEASE PRESS A KEY.": SAVE "kwcode"CODE 40000,400: GO TO 9910
 9914 IF q$="n" OR q$="N" THEN GO TO 9920
 9916 GO TO 9910
 9920 INPUT "DELETE DEAD WEIGHT? "; LINE q$
 9922 IF q$="y" OR q$="Y" THEN GO TO 9940
 9930 STOP 
 9940 REM DELETE DEAD WEIGHT
 9942 CLEAR 65337
 9944 DELETE 1,200
 9946 DELETE 9910,9922
 9948 DELETE 9940,9999
 9950 CLEAR 40000: BORDER 0: PAPER 0: INK 7: CLS : PRINT "LOADING KEYWORD MC": LOAD "kwcode"CODE 40000,400
 9960 REM INSTALL KEYWORD
 9962 CLS : RANDOMIZE USR 40275
 9964 INPUT "INSTRUCTIONS? ";q$
 9966 IF q$="y" OR q$="Y" THEN GO TO 10
 9968 GO TO 9902

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