home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / TURBOPAS / TURBOKEY.DOC < prev    next >
Text File  |  2000-06-30  |  17KB  |  373 lines

  1.  
  2.         Defining the DEC Rainbow Keyboard for Turbo Pascal
  3.  
  4.  
  5.                         Willett Kempton
  6.                         8 January 1985
  7.  
  8.  
  9.  
  10. Turbo Pascal is great!  But who can remember those stupid WordStar
  11. commands?  This document shows how to define the entire Rainbow
  12. keyboard so the Turbo editor recognizes it.  Why bother?  Easier
  13. to remember.  Faster typing.  Less confusing to switch to Turbo from
  14. word processors and other programs which use the same function keys.
  15. Easier to train new staff.
  16.  
  17.  
  18. The Borland TINST program is supposed to allow customizing the
  19. TURBO editor to the keyboard of your computer.  The Turbo manual
  20. says that keycodes are limited to four characters, but in fact
  21. with more than three characters, TINST beeps and does not define
  22. the key properly.  For example, the Rainbow "next screen" key
  23. generates four characters ( <esc> [ 6 ~ ), so TINST cannot define
  24. that key to do anything useful.  All but 8 of the Rainbow's
  25. function keys generate more than three characters.
  26.  
  27. The restriction to three characters is not imposed by TURBO
  28. itself, but only by the TINST program.  TURBO imposes the
  29. restriction that all the key definitions together not exceed 153
  30. characters, which is the size of its table defining these keys.
  31. The three-character TINST limit can be circumvented by entering
  32. key values into a table in the TURBO program directly, with DDT86
  33. or DEBUG, thereby defining any length of keys desired.
  34.  
  35.  
  36. A Proposed Set of Keys
  37. ----------------------
  38.  
  39. After experimenting with several different keyboard definitions, I
  40. settled on the one described below.  Key names are logical, as
  41. much as possible.  In a moment of foolishness, I even made up a key
  42. strip for these definitions.  The block commands remain available
  43. only as the original WordStar keys (^K^B, etc).  The method
  44. described below can be used to define any other set of keys, if
  45. the following is not desired.
  46.  
  47.  
  48. Rainbow key      Turbo function
  49. -----------      --------------------
  50.         <--      1. Character left
  51.         -->      3. Character right
  52.         F17      4. Word left
  53.         PF1      5. Word right
  54.    Up arrow      6. Line up
  55.  Down arrow      7. Line down
  56.         F19      8. Scroll up
  57.         PF3      9. Scroll down
  58. Prev Screen     10. Page up
  59. Next Screen     11. Page down
  60.         F18     12. To left on line
  61.         PF2     13. To right on line
  62.         F20     16. To top of file
  63.         PF4     17. To bottom of file
  64.      Resume     20. To prior cursor position
  65.  
  66. Main Screen     21. Toggle insert/overwrite mode
  67. Insert Here     22. Insert line
  68.   Interrupt     23. Delete line
  69.      Cancel     24. Delete to end of line
  70. Addtnl Opts     25. Delete right word
  71.      Remove     26. Delete character under cursor
  72.  
  73.        Exit     38. End edit
  74.        Help     41. Restore line
  75.        Find     42. Find
  76.          Do     43. Find and replace
  77.      Select     44. Repeat last find
  78.  
  79.        ^K^B     29. Mark block begin
  80.        ^K^K     30  Mark block end
  81.        ^K^C     33. Copy block
  82.        ^K^V     34. Move block
  83.        ^K^Y     35. Delete block
  84.        ^K^R     36. Read block from disk
  85.        ^K^W     37. Write block to disk
  86.  
  87.  
  88. Keystrip Template
  89. -------- --------
  90.  
  91.    - print at 10 cpi (DEC LA-34/50/100 will change r and o to lines)
  92.    - cut off lines and "X"es, tape three strips into one
  93.  
  94.  
  95. X(0rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr(B
  96. X Hold    Print  Set-up   F4     Break         Delete  Prior  Delete  Insert/
  97. X Screen  Screen                               Line    Cursor to eol  Overwr
  98. X(0ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(B
  99.  
  100. (0rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr(B
  101. Insert/ Exit  TURBO   <ESC>    BS      LF    Delete         Restore    Search
  102. Overwr        PASCAL                         word           Line       Replace
  103. (0oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(B
  104.  
  105. (0rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr(BX
  106. Search and          Word   Line    Scroll  File X
  107. Replace       F/PF  l/r    l/r     u/d     t/b  X
  108. (0oooooooooooooooooooooooooooooooooooooooooooooooo(BX
  109.  
  110.  
  111.  
  112.  
  113. Screen Installation
  114. ------ ------------
  115.  
  116. Before working with the keys, use TINST to finalize the screen installation
  117. to something satisfactory.  On early releases, delete line was wrong.
  118. Delete line should be:  <esc> [ M    or    <esc> [ 1 M
  119.  
  120. Also in TINST, you may want to disable START HIGHLIGHTING.  This is because
  121. whatever Turbo considers "highlighting" is sent to the console by every
  122. Pascal program generated by the compiler, even if the program does no console
  123. I/O whatsoever!!  (If PIP or COPY were written in Turbo Pascal, they would
  124. make the screen go bold every time they were run.)  Disable by typing "-".
  125. The disadvantage is that in the editor, control characters will not appear
  126. to be different from other characters, and blocks arent visible--minor
  127. disadvantages, in my opinion, compared to having every program toggle the
  128. screen brightness.
  129.  
  130. Once you have the screen set the way you want it, you are ready to
  131. install the keyboard.
  132.  
  133.  
  134.  
  135. How to Enter the Key Values
  136. --- -- ----- --- --- ------
  137.  
  138. Using DDT86 or DEBUG, look for the table at the memory locations
  139. listed below.
  140.  
  141. Operating system   Turbo version   Table starts at
  142.  --------------      --------       -----
  143.     CP/M-86           2.00B         4C55
  144.     CP/M-86           2.10A         4DD5
  145.     MS-DOS            2.00B         4CFB
  146.  
  147. If you have a version other than one of those listed, find the
  148. table by looking for the repeating 01 FF 01 FF 01 FF pattern --
  149. you can't miss it.  The first few predefined key entries start
  150. with hex values: 02 1B 44 01 FF 02 1B 43 etc (see examples below).
  151. They show as ..D....C......A..B.  This is where you start putting
  152. in your keys.  The new keys must be entered in the same sequence
  153. as in the TINST program.  Any keys to be skipped are entered as
  154. "01 FF".  Each table entry begins with the length of the key.
  155. Also, note that the bottom of the dumps show the original WordStar
  156. key definitions in a second table.  These are unchanged and continue
  157. to be valid as alternative keys.  (I couldn't find this table in
  158. the CP/M-80 version.)
  159.  
  160. In the examples below, d is used both by MS-DOS and CP/M-86 to
  161. dump memory (show a block).  DDT86 reads the file with "r", while
  162. DEBUG gives it on the command line.  Memory values are changed by
  163. "s" on DDT86, which sets one value per line, and by "e" on DEBUG,
  164. which allows 8 values per line.  Be sure to check with another
  165. "d", and to save with "w", before leaving the program.  This
  166. procedure is a bit tedious; it goes much faster with two people,
  167. one reading the values.
  168.  
  169. Since it is easy to make mistakes when entering values via DDT or
  170. DEBUG, this procedure should be done on a spare disk copy of
  171. TURBO, and all keys should be tested before it is put into routine
  172. use.  I found that when a five-key sequence was used for Turbo
  173. function 44, 'repeat last find', it did not work; replacing it
  174. with a four-key sequence solved the problem.  Any further key
  175. refinements have to be made with DDT86 or DEBUG; if you ask TINST
  176. to redefine these long key sequences, it gets very confused (it can
  177. still change screen values correctly).  This key system has be in
  178. routine use at three sites for 6 months, and has worked perfectly.
  179.  
  180. Footnote:  These keys even work in remote mode!  e.g.  On one Rainbow
  181. run CTTY \AUX (under MS-DOS) then set your modem to auto-answer.
  182. From a second Rainbow (or VT220), call the first.  You can now edit
  183. and run programs on the first Rainbow, using the Turbo editor and all
  184. the defined function keys.
  185.  
  186.  
  187.  
  188. MS-DOS Keyboard Installation
  189. ------ -------- ------------
  190.  
  191. B>a:debug turbo.com                           { call debug }
  192.  
  193. -d4ce0,4ddf                                   { display the empty key table }
  194.  
  195. 0AD9:4CE0  02 8B 1E E4 02 2B DA 5A-5B C3 80 3E CF 02 00 74   ...d.+ZZ[C.>O..t
  196. 0AD9:4CF0  07 87 DA E8 F9 B5 87 DA-C3 01 0D 02 1B 44 01 FF   ..Zhy5.ZC....D..
  197. 0AD9:4D00  02 1B 43 01 FF 01 FF 02-1B 41 02 1B 42 01 FF 01   ..C......A..B...
  198. 0AD9:4D10  FF 01 FF 01 FF 01 FF 01-FF 01 FF 01 FF 01 FF 01   ................
  199. 0AD9:4D20  FF 01 FF 01 FF 01 FF 01-FF 01 FF 01 FF 01 FF 01   ................
  200. 0AD9:4D30  FF 01 FF 01 FF 01 FF 01-FF 01 FF 01 FF 01 FF 01   ................
  201. 0AD9:4D40  FF 01 FF 01 FF 01 FF 01-FF 01 FF 01 FF 01 FF 01   ................
  202. 0AD9:4D50  FF 01 FF 01 FF 01 FF 01-FF 00 00 00 00 00 00 00   ................
  203. 0AD9:4D60  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  204. 0AD9:4D70  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  205. 0AD9:4D80  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  206. 0AD9:4D90  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  207. 0AD9:4DA0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  208. 0AD9:4DB0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  209. 0AD9:4DC0  00 01 0D 01 13 01 08 01-04 01 01 01 06 01 05 01   ................
  210. 0AD9:4DD0  18 01 17 01 1A 01 12 01-03 02 11 13 02 11 04 02   ................
  211. -e4cfb
  212.                                                    { enter values }
  213. 0AD9:4CFB  02.03   1B.1b   44.5b   01.44   FF.01
  214. 0AD9:4D00  02.ff   1B.03   43.1b   01.5b   FF.43   01.05   FF.1b   02.5b
  215. 0AD9:4D08  1B.33   41.31   02.7e   1B.03   42.1b   01.4f   FF.50   01.03
  216. 0AD9:4D10  FF.1b   01.5b   FF.41   01.03   FF.1b   01.5b   FF.42   01.05
  217. 0AD9:4D18  FF.1b   01.5b   FF.33   01.33   FF.7e   01.03   FF.1b   01.4f
  218. 0AD9:4D20  FF.52   01.04   FF.1b   01.5b   FF.35   01.7e   FF.04   01.1b
  219. 0AD9:4D28  FF.5b   01.36   FF.7e   01.05   FF.1b   01.5b   FF.33   01.32
  220. 0AD9:4D30  FF.7e   01.03   FF.1b   01.4f   FF.51   01.01   FF.ff   01.01
  221. 0AD9:4D38  FF.ff   01.05   FF.1b   01.5b   FF.33   01.34   FF.7e   01.03
  222. 0AD9:4D40  FF.1b   01.4f   FF.53   01.01   FF.ff   01.01   FF.ff   01.05
  223. 0AD9:4D48  FF.1b   01.5b   FF.31   01.38   FF.7e   01.05   FF.1b   01.5b
  224. 0AD9:4D50  FF.32   01.30   FF.7e   01.04   FF.1b   01.5b   FF.32   01.7e
  225. 0AD9:4D58  FF.05   00.1b   00.5b   00.31   00.37   00.7e   00.05   00.1b
  226. 0AD9:4D60  00.5b   00.31   00.39   00.7e   00.05   00.1b   00.5b   00.32
  227. 0AD9:4D68  00.36   00.7e   00.04   00.1b   00.5b   00.33   00.7e   00.01
  228. 0AD9:4D70  00.ff   00.01   00.ff   00.01   00.ff   00.01   00.ff   00.01
  229. 0AD9:4D78  00.ff   00.01   00.ff   00.01   00.ff   00.01   00.ff   00.01
  230. 0AD9:4D80  00.ff   00.01   00.ff   00.01   00.ff   00.05   00.1b   00.5b
  231. 0AD9:4D88  00.32   00.31   00.7e   00.01   00.ff   00.01   00.ff   00.05
  232. 0AD9:4D90  00.1b   00.5b   00.32   00.38   00.7e   00.04   00.1b   00.5b
  233. 0AD9:4D98  00.31   00.7e   00.05   00.1b   00.5b   00.32   00.39   00.7e
  234. 0AD9:4DA0  00.04   00.1b   00.5b   00.34   00.7e   00.01   00.ff   00.00
  235.  
  236. -d4ce0,4ddf                                   { check the new table }
  237.  
  238. 0AD9:4CE0  02 8B 1E E4 02 2B DA 5A-5B C3 80 3E CF 02 00 74   ...d.+ZZ[C.>O..t
  239. 0AD9:4CF0  07 87 DA E8 F9 B5 87 DA-C3 01 0D 03 1B 5B 44 01   ..Zhy5.ZC....[D.
  240. 0AD9:4D00  FF 03 1B 5B 43 05 1B 5B-33 31 7E 03 1B 4F 50 03   ...[C..[31~..OP.
  241. 0AD9:4D10  1B 5B 41 03 1B 5B 42 05-1B 5B 33 33 7E 03 1B 4F   .[A..[B..[33~..O
  242. 0AD9:4D20  52 04 1B 5B 35 7E 04 1B-5B 36 7E 05 1B 5B 33 32   R..[5~..[6~..[32
  243. 0AD9:4D30  7E 03 1B 4F 51 01 FF 01-FF 05 1B 5B 33 34 7E 03   ~..OQ......[34~.
  244. 0AD9:4D40  1B 4F 53 01 FF 01 FF 05-1B 5B 31 38 7E 05 1B 5B   .OS......[18~..[
  245. 0AD9:4D50  32 30 7E 04 1B 5B 32 7E-05 1B 5B 31 37 7E 05 1B   20~..[2~..[17~..
  246. 0AD9:4D60  5B 31 39 7E 05 1B 5B 32-36 7E 04 1B 5B 33 7E 01   [19~..[26~..[3~.
  247. 0AD9:4D70  FF 01 FF 01 FF 01 FF 01-FF 01 FF 01 FF 01 FF 01   ................
  248. 0AD9:4D80  FF 01 FF 01 FF 05 1B 5B-32 31 7E 01 FF 01 FF 05   .......[21~.....
  249. 0AD9:4D90  1B 5B 32 38 7E 04 1B 5B-31 7E 05 1B 5B 32 39 7E   .[28~..[1~..[29~
  250. 0AD9:4DA0  04 1B 5B 34 7E 01 FF 00-00 00 00 00 00 00 00 00   ..[4~...........
  251. 0AD9:4DB0  00 00 00 00 00 00 00 00-00 00 00 00 00 00 00 00   ................
  252. 0AD9:4DC0  00 01 0D 01 13 01 08 01-04 01 01 01 06 01 05 01   ................
  253. 0AD9:4DD0  18 01 17 01 1A 01 12 01-03 02 11 13 02 11 04 02   ................
  254.  
  255. -w                                           { save to disk! }
  256. Writing 8A00 bytes
  257.  
  258. -q                                           { leave DEBUG }
  259.  
  260. B>
  261.  
  262.  
  263.  
  264.  
  265. CP/-86 Keyboard Installation
  266. ------ -------- ------------
  267.  
  268. B>ddt86                                      { call DDT, do not give file }
  269.  
  270. DDT86 1.1
  271. -r turbo.cmd                                 { read the file here }
  272.  
  273.   START      END
  274. 0650:0000 0650:8BFF
  275. -d4c30,4d2f                                  { show the empty key table }
  276.  
  277. 0650:4C30 84 BA 5A 5B C3 53 52 8B 16 EC 03 8B 1E EE 03 2B ..Z[.SR........+
  278. 0650:4C40 DA 5A 5B C3 80 3E D9 03 00 74 07 87 DA E8 1F B6 .Z[..>...t......
  279. 0650:4C50 87 DA C3 01 0D 02 1B 44 01 FF 02 1B 43 01 FF 01 .......D....C...
  280. 0650:4C60 FF 02 1B 41 02 1B 42 01 FF 01 FF 01 FF 01 FF 01 ...A..B.........
  281. 0650:4C70 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 ................
  282. 0650:4C80 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 ................
  283. 0650:4C90 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 ................
  284. 0650:4CA0 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 ................
  285. 0650:4CB0 FF 01 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  286. 0650:4CC0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  287. 0650:4CD0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  288. 0650:4CE0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  289. 0650:4CF0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  290. 0650:4D00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  291. 0650:4D10 00 00 00 00 00 00 00 00 00 00 00 01 0D 01 13 01 ................
  292. 0650:4D20 08 01 04 01 01 01 06 01 05 01 18 01 17 01 1A 01 ................
  293. -s4c55
  294.                                               { start setting new values }
  295. 0650:4C55 02 03
  296.  
  297. 0650:4C56 1B 1b
  298.  
  299. 0650:4C57 44 5b
  300.  
  301. 0650:4C58 01 44
  302.  
  303. 0650:4C59 FF 01
  304.  
  305. 0650:4C5A 02 ff
  306.  
  307. 0650:4C5B 1B 03
  308.  
  309. 0650:4C5C 43 1b
  310.  
  311.  
  312.  
  313. { and so on (use dump below to see all values) }
  314.  
  315.  
  316.  
  317. 0650:4C6F 01 5b
  318.  
  319. 0650:4C70 FF .                              { stop, and                    }
  320.  
  321. -d4c50,4c6f                                 { check your work occasionally }
  322.  
  323. 0650:4C50 87 DA C3 01 0D 03 1B 5B 44 01 FF 03 1B 5B 43 05 .......[D....[C.
  324. 0650:4C60 1B 5B 33 31 7E 03 1B 4F 50 03 1B 5B 41 03 1B 5B .[31~..OP..[A..[
  325. -s4c70
  326.  
  327. 0650:4C70 FF 42
  328.  
  329.  
  330.   { etc.  etc. }
  331.  
  332.  
  333. 0650:4CFF 00 01
  334.  
  335. 0650:4D00 00 ff
  336.  
  337. 0650:4D01 00 .
  338.  
  339. -d4c30,4d2f                        { check the final product }
  340.  
  341. 0650:4C30 84 BA 5A 5B C3 53 52 8B 16 EC 03 8B 1E EE 03 2B ..Z[.SR........+
  342. 0650:4C40 DA 5A 5B C3 80 3E D9 03 00 74 07 87 DA E8 1F B6 .Z[..>...t......
  343. 0650:4C50 87 DA C3 01 0D 03 1B 5B 44 01 FF 03 1B 5B 43 05 .......[D....[C.
  344. 0650:4C60 1B 5B 33 31 7E 03 1B 4F 50 03 1B 5B 41 03 1B 5B .[31~..OP..[A..[
  345. 0650:4C70 42 05 1B 5B 33 33 7E 03 1B 4F 52 04 1B 5B 35 7E B..[33~..OR..[5~
  346. 0650:4C80 04 1B 5B 36 7E 05 1B 5B 33 32 7E 03 1B 4F 51 01 ..[6~..[32~..OQ.
  347. 0650:4C90 FF 01 FF 05 1B 5B 33 34 7E 03 1B 4F 53 01 FF 01 .....[34~..OS...
  348. 0650:4CA0 FF 05 1B 5B 31 38 7E 05 1B 5B 32 30 7E 04 1B 5B ...[18~..[20~..[
  349. 0650:4CB0 32 7E 05 1B 5B 31 37 7E 05 1B 5B 31 39 7E 05 1B 2~..[17~..[19~..
  350. 0650:4CC0 5B 32 36 7E 04 1B 5B 33 7E 01 FF 01 FF 01 FF 01 [26~..[3~.......
  351. 0650:4CD0 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 01 FF 05 ................
  352. 0650:4CE0 1B 5B 32 31 7E 01 FF 01 FF 05 1B 5B 32 38 7E 04 .[21~......[28~.
  353. 0650:4CF0 1B 5B 31 7E 05 1B 5B 32 39 7E 04 1B 5B 34 7E 01 .[1~..[29~..[4~.
  354. 0650:4D00 FF 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
  355. 0650:4D10 00 00 00 00 00 00 00 00 00 00 00 01 0D 01 13 01 ................
  356. 0650:4D20 08 01 04 01 01 01 06 01 05 01 18 01 17 01 1A 01 ................
  357.  
  358. -w turbo.cmd                          { write your file to disk }
  359.  
  360. -^C                                   { leave DDT86 (AFTER writing) }
  361. B>
  362.  
  363.  
  364.  
  365. Permissions
  366. -----------
  367.  
  368. This document, and the data structures implicit in the hex dumps listed
  369. herein, are contributed to the public domain.
  370.  
  371.                                     -- W. Kempton,  8 Jan 85
  372.     --------
  373.