Customize your M-SCRIPT

I am one of those people who can’t have a program for long before I find something to improve or otherwise fool with. In this case, the victim is MSCRIPT. MSCRIPT is a beautiful, full featured word processor. In a month of using the program, I’ve found only four things to complain about.

1. The characters were hard to read, due to the Timex’s method of getting 64 characters on a line. This was solved by Jack Dohaney, in his Fat Bits program as listed in issue 2/4 of SWN.

2. The space bar alternately sticks and prints double. This is a Timex hardware problem, due to their 29 cent keyboard.

3. DELETE works opposite to Timex convention, deleting to the right rather than the left.

4. TAB is awkwardly placed, requiring pressing the CAPS SHIFT, SYMBL SHIFT, and 8 keys together. This is the one that can be changed.

Most programs use the ROM keyboard decode subroutine to translate the signals received from the keyboard into the characters represented. MSCRIPT doesn’t do this. It does all of its own keyboard decoding, using a set of tables located between 42582 and 42837. Since these tables are in RAM, you can change that table, even so far as creating a Dvorak keyboard, by POKEing new values.

MSCRIPT uses these four tables to translate the electrical key press to an ASCII code for the corresponding letter. Each table is represented by a column in figure #1. It chooses among the four columns on the basis of the status of the CAPS and SYMBL shift keys. The first column headings reflect this. Each of these tables starts at a different address – these addresses are given above each column. MSCRIPT then chooses the offset that corresponds to the key pressed, moves over to the correct column, and returns with the entry at that position.

For example, pressing an unshifted “d” causes MSCRIPT to look in the table starting at 42582, and return with the number at offset seven. This is 100, the ASCII code for “d”. If the same key were depressed while holding both CAPS and SYMBL shifts, a 196 would be returned.

In general, numbers followed by a blank have no effect when pressed. In our example, the 196 shown in the table will be returned, but nothing will happen on the screen. Sometimes that’s ok (e.g., we don’t want to get a character when we press the CAPS SHIFT), but it is in the interest of speed to move as many functions to Caps Shift keys as possible.

As an example of how to implement these changes, we will move the TAB function key to the shifted one key.

1. LOAD “MSCRIPT” CODE.

2. POKE the TAB value, 152, to the key you wish to use for tab (in this case SHIFT 1).

3. Find the offset for the “1” key (15), and add it to the base address of the CAPS SHIFT column (42646) to get the correct address: 42661.

4. Type POKE 42661,152, and ENTER, to put the TAB function on the shifted 1.

5. SAVE “MSCRIPT” CODE,(start,length)

Other often used functions are INSERT (CAPS, SYMBL, I) and MERGE (CAPS, SYMBL, M). These could be placed on the unused CAPS shifted 3, 4, or 9. While we’re at it, how about making the unshifted 5, 6, 7, and 8 act as the cursor controls? This would allow easy movement around the text, while still allowing the numbers to be printed if they were CAPS shifted. This would be accomplished by exchanging the values at offsets 19, 22,23, and 24 between the No shift and CAPS shift columns.

MSCRIPT Keyboard Decode Table

Base     No Shift   CAPS shift   SYMBL shift  CAPS+SYMBL shift
Address  42582      42646        42710        42774
                                                                  Offset
                                                                  in table
          00         00           00           00 (caps shift)       0
         122 z       90 Z         58 :        218                    1
         120 x       88 X         96 †        216                    2
          99 c       67 C         63 ?        195 copy block         3
         118 v       86 V         47 /        214                    4
          97 a       65 A         00          193                    5
         115 s       83 S         00          211 sub-delete         6
         100 d       68 D         92 |        196                    7
         102 f       70 F         00          198                    8
         103 g       71 G         00          199 printer code       9
         113 q       81 Q         00          209 restore line      10
         119 w       87 W         00          215                   11
         101 e       69 E         00          197 cursor to END     12
         114 r       82 R         60 <        210 remove block      13
         116 t       84 T         62 >        212 cursor to TOP     14
          49 1      129           33 !        145                   15
          50 2      130 capLK     64 @        146                   16
          51 3      131           35 #        147                   17
          52 4      132           36 $        148                   18
          53 5      133 lft       37 %        149 cur full left     19
          48 0        8 del       95 _         24                   20
          57 9      137           41 )        153                   21
          56 8      136 rgt       40 (        152 tab               22
          55 7      135 up        39 '        151 page up           23
          54 6      134 dwn       38 &        150 page down         24
         112 p       80 P         34 "        208 PRINT menu sel    25
         111 o       79 O         59 ;        207                   26
         105 i       73 I         00          201 insert text       27
         117 u       85 U         93 ]        213 unmark block      28
         121 y       89 Y         91 [        217                   29
          13 ent     13 ent       13 ent       13 ent               30
         108 l       76 L         61 =        204                   31
         107 k       75 K         43 +        203                   32
         106 j       74 J         45 -        202                   33
         104 h       72 H         94 ↑        200 HELP summary      34
          32 sp     128 menu     128 menu     128 menu              35
          00         00           00           00 (smb shft key)    36
         109 m       77 M         46 .        205 merge text blk    37
         110 n       78 N         44 ,        206 new page          38
          98 b       66 B         42 *        194 set block mark    39