Customizing Mscript

See all articles from CATS v3 n2
Author(s): Mark Fisher
Publication: CATS Newsletter
Pub Details: CATS v3 n2 (Volume 3, Issue 2)
Date: May 1985
Pages: 10-11

As you know by now, I can’t have a program for long before I’ve got to find something to 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, of a west coast user’s group, in his Fat Bits program as listed in last month’s newsletter. Unfortunately, he didn’t put his name in the program, and thus wasn’t credited.

2. The space key 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. ***** STOP THE PRESS! I’ve got a patch to change the operation of the DELETE routine – see addendum.

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

Most programs use the ROM to translate from the signals recieved from the keyboard to the characters represented. MSCRIPT doesn’t do this. It does all 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 – we don’t want to get a character when we press the CAPS SHIFT, for example – but it is in the interests of speed to move as many functions to Caps Shift keys as possible.

To move the TAB function, just LOAD “MSCRIPT” CODE, then poke the TAB value, 152, to the key you wish to use for tab. I wanted the TAB on the SHIFTed 1, so I found the offset for the “1” key (15), and added it to the base address of the CAPS SHIFT column (42646) to get the correct address: 42661. I then typed POKE 42661,152, and ENTER, to put the TAB function on the shifted 1.

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.

I have heard a rumor that 21st Century Electronics is coming out with an updated version. It may have the currently undocumented TAB function improved as listed here. In the meantime, try it yourself. You may get a better fit than the original author could give.

Mark Fisher

Addendum

Addendum: The operation of the DELETE key can be changed to Timex standard with a seven byte patch. What happens is that the cursor-left routine is called before the delete. To clear space for the patch, the prompt “Block Marker Error!” is shortened to “Block Error”, and the seven bytes of m/c put in the space freed.

To insert this patch, load a copy of MSCRIPT, and BREAK after the M/C has loaded. Add the following lines to your FAT BITS loader (as listed in last month’s issue), then GOTO 100. When the run ends, SAVE the revised mscript m/c by GO TO 15.

 100>POKE 38167,223:POKE 38168,174:POKE 44755,11
110 RESTORE 150
115 FOR i=44762 TO 44775
120 READ j
130 POKE i,j
140 NEXT i
150 DATA 101,114,114,111,114,17,81,160,213,195,185,146,33

MSCRIPT Keyboard Decode Table

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

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