home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / simtel / sigm / vols000 / vol042 / wm.doc < prev    next >
Encoding:
Text File  |  1985-02-10  |  7.5 KB  |  233 lines

  1. ; How to customize the keyboard codes on WM 1.06
  2. ;
  3. ;         by Trevor Marshall
  4. ;        26 Mirrelia Way,
  5. ;        Ferndale, West Australia 6155
  6. ;     phone    (619)4576059
  7. ;
  8. SUMMARY║áá Modification≤áá t∩á customizσá WordMaste≥á 1.0╢áá arσ ì
  9. described«á Thσá RESOURCE.CO═ file≤ createΣ durinτ thi≤á proces≤ ì
  10. arσá presen⌠á oεá thσ disk¼á anΣ ma∙ bσ useΣ b∙á ßá licenceσá oµ ì
  11. WordMaster 1.06 to patch his WordMaster similarly.
  12.  
  13.  
  14. A≤ ß use≥ oµ WordStar(R⌐ ╔ wa≤ no⌠ completel∙ satisfieΣ witΦ thσ ì
  15. SCREE╬ edito≥ provideΣ witΦ m∙ owε CROMEMC╧ baseΣ system.
  16.  
  17. AlthougΦá WordMaste≥ (R⌐ seemeΣ t∩ offe≥ thσ feature≤ ╔á fel⌠á ╔ ì
  18. needeΣá fo≥ non- wordprocessinτ applications¼á versioε 1.0╢á diΣ ì
  19. no⌠á offe≥ ß se⌠ oµ keyboarΣ command≤ 'compatibleº witΦ WordSta≥ ì
  20. anΣá wheneve≥ ╔ trieΣ t∩ usσ thσ vide∩ command≤ ╔ founΣá tha⌠á ╔ ì
  21. wa≤ deletinτ word≤ whilst tryinτ t∩ shif⌠ thσ cursor!
  22.  
  23. MicroPr∩á d∩á no⌠ offe≥ 'customizinτ notesº fo≥á WordMaste≥á anΣ ì
  24. severa∞á attempt≤á t∩ dis-assemblσ i⌠ baseΣ oε m∙á knowledgσá oµ ì
  25. WordStar'≤á structurσá werσá unsuccessful«á Wheεá thσá codσá wa≤ ì
  26. finally broken the reason for the difficulty was obvious.
  27. WordMaste≥á ha≤á ßá decodinτá structurσ whicΦá i≤á nothinτá likσ ì
  28. WordStar's.
  29.  
  30. Wheεá ß Contro∞ Characte≥ i≤ typeΣ oε thσ keyboarΣ it≤ valuσá (░ ì
  31. t∩ 1FH⌐ i≤ useΣ a≤ thσ offse⌠ int∩ ß tablσ whicΦ contain≤á jump≤ ì
  32. t∩á eacΦ oµ thσ operatinτ routines«á Thσ addresse≤ iε thi≤ tablσ ì
  33. caε bσ easil∙ changeΣ no⌠ onl∙ t∩ re-assigε change≤ t∩á keyboarΣ ì
  34. functions but also to enhance the editor's features.
  35.  
  36. ╔á likσá t∩ observσ thσ effec⌠ oµ globa∞ substitution≤á usinτá ß ì
  37. command such as
  38. B 999 < ROLD STRING$NEWSTRING$ V >
  39. Wheε eacΦ replacemen⌠ i≤ madσ thσ vide∩ modσ i≤ entereΣ t∩ checδ ì
  40. tha⌠á aεá erro≥ iε typinτ thσ string≤ diΣ no⌠á occur«á Wheεá thσ ì
  41. ESCAP┼á ke∙ i≤ useΣ t∩ exi⌠ thσ vide∩ modσ thσ nex⌠ substitutioε ì
  42. occurs, and so on.
  43. Unfortunatel∙á thσ CONTROL-├ interrup⌠ commanΣ doe≤ no⌠ worδá iε ì
  44. thσá vide∩ mode¼á s∩ iµ yo⌡ havσ madσ ß mistakσ yo⌡ ma∙á no⌠á bσ ì
  45. able to interrupt the macro.
  46. WordSta≥ use≤ CONTROL-╒ t∩ interrup⌠ an∙ routine« 
  47. WordMaste≥á ha≤ it≤ CONTROL-├ interrup⌠ routinσ a⌠ 23EB¼á anΣ aε ì
  48. entr∙á iεá thσ keyboarΣ decodinτ tablσ t∩ jum≡ t∩á thi≤á addres≤ ì
  49. effectivel∙á allow≤ interruptioε t∩ thσ vide∩ baseΣ modσ (iεá m∙ ì
  50. case¼ wheε CTL-╒ i≤ pressed)«   
  51.  
  52. WitΦá WordMaste≥ no≈ doinτ wha⌠ ╔ wanteΣ i⌠ t∩ d∩ ╔ nex⌠á tackleΣ ì
  53. thσ probleφ oµ thσ disδ drivσ motors.
  54. Cromemc∩ CDO╙ ha≤ ß featurσ whicΦ switche≤ ofµ you≥ drivσ motor≤ ì
  55. wheεá thσ disk≤ arσ no⌠ beinτá accessed¼á considerabl∙á reducinτ ìèdisk and head wear.
  56. Thσá motor≤ arσ turneΣ ofµ b∙ ß 'Turε ofµ Drivσ Motorsº cal∞á t∩ ì
  57. BDO╙á (96H⌐á o≥ b∙ an∙ prograφ askinτ BDO╙ fo≥á bufferreΣá linσ ì
  58. input.
  59. WordMaste≥á accesse≤á thσ BIO╙á jum≡á tablσá directly¼á (withou⌠ ì
  60. callinτá vißá BDOS)¼á s∩ tha⌠ thσ drivσ motor≤ continuσá t∩á ruε ì
  61. during an edit.
  62.  
  63. Thσá tasδ then¼á wa≤ t∩ modif∙ WordSta≥ s∩ tha⌠ thσ drivσ motor≤ ì
  64. coulΣ bσ turned off during edits.
  65.  
  66. The BIOS jump table is entered via a routine at 0D4A.
  67. ╔á havσá intercepteΣá call≤ t∩ thσá CONI╬á routinσá b∙á checkinτ ì
  68. whethe≥á thσ accumulato≥ (whicΦ contain≤ aε inde° int∩ thσá BIO╙ ì
  69. jum≡á tables⌐á contain≤á ╢ (CONIN)«á Iµ i⌠ i≤ ß CONI╬á cal∞á thσ ì
  70. motors are turned off via a call to BDOS.
  71. Therσá i≤ enougΦ rooφ iε thσ use≥ patcΦ area≤ t∩á implemen⌠á thσ ì
  72. code needed.
  73. A≤á WordSta≥ change≤ thσ addres≤ a⌠ 0005╚ whicΦ point≤ t∩á BDOS¼ ì
  74. thi≤ addres≤ mus⌠ bσ saveΣ prio≥ t∩ enterinτ Wordstar«á Thσ codσ ì
  75. to effect this is listed below.
  76.  
  77.  
  78. CUSTOMIZING YOUR WORDMASTER
  79.  
  80. Invoke Ward Christensen's RESOURCE.COM by typing RESOURCE
  81. it will prompt with ..... 
  82.  
  83. Memory open to XXXX
  84. *
  85.  
  86. type O5000 <RETURN>
  87.      U7700 <RETURN>
  88.      RWM.SYM <RETURN>          to read in the symbol file
  89.      RWM.CTL <RETURN>           "   "         control  "
  90.      RWM.DOC <RETURN>           "   "         comments "
  91.      RWM.COM <RETURN>           "   "         program   "
  92.      ? <RETURN>
  93.  
  94. resource will reply
  95.  
  96. SYMTBL=1E00 3A70
  97. PC    =0100
  98. OFFSET=5000
  99. COMNTS=7700 7B46
  100. CTLTBL=1800 1935
  101. *
  102.  
  103. Then try  
  104.      L11C5 1202
  105.  
  106. And the jump table, fully commented, should be listed.
  107. From then on, happy patching! (and Merry Christmas)
  108.  
  109. Trevor Marshall, 13 Dec '80.è
  110. .paè
  111. ; The following code was 'fudged' to look like
  112. ;  the display when you use 'Resource'
  113. ; All lowercase comments are added by hand,
  114. ;  all other labels,etc, come from RESOURCE files
  115. ;-----------------------------------------------------
  116. ; The Jump Table at 11C5 is patched to effect
  117. ;   keyboard function changes
  118. ;
  119. ; This was the original jump table in WM 1.06
  120. CTLTABLE:        ;11C5 
  121. 11C5    DW    DORET    ;1345H
  122. 11C7    DW    CURSOR-LEFT-WORD    ;126DH
  123. 11C9    DW    CURSOR-R-L-LINE    ;1289H
  124. 11CB    DW    UP-SCREEN    ;142CH
  125. 11CD    DW    CURSOR-RIGHT-WORD    ;123FH
  126. 11CF    DW    SCROLL-DOWN    ;1409H
  127. 11D1    DW    INSERT-ON-OFF    ;150BH
  128. 11D3    DW    DEL-CHAR-RIGHT    ;14ECH
  129. 11D5    DW    CURSOR-LEFT-CHAR    ;122AH
  130. 11D7    DW    INSERT-TAB    ;153AH
  131. 11D9    DW    CURSOR-DOWN-LINE    ;12C1H
  132. 11DB    DW    CURSOR-UP-LINE    ;1303H
  133. 11DD    DW    CURSOR-RIGHT-CHAR    ;1216H
  134. 11DF    DW    DO-CR    ;15ABH
  135. 11E1    DW    INSERT-CR    ;1594H
  136. 11E3    DW    DEL-WORD-RIGHT    ;1476H
  137. 11E5    DW    DEL-LINE-RIGHT    ;14DDH
  138. 11E7    DW    HELP    ;1954H
  139. 11E9    DW    SCREEN-UP    ;1414H
  140. 11EB    DW    DORET    ;1345H
  141. 11ED    DW    DOTOPORBOTTOM    ;1346H
  142. 11EF    DW    DEL-LINE-LEFT    ;14BFH
  143. 11F1    DW    DORET    ;1345H
  144. 11F3    DW    DORET    ;1345H
  145. 11F5    DW    SCROLL-UP    ;137CH
  146. 11F7    DW    DEL-LINE    ;14CEH
  147. 11F9    DW    CUR-RIGHT-TAB    ;12B6H
  148. 11FB    DW    DOESCAPE    ;1205H
  149. 11FD    DW    DEL-WORD-LEFT    ;1460H
  150. 11FF    DW    PUT-CHAR-IN-FILE    ;151AH
  151. 1201    DW    DOTOPORBOTTOM    ;1346H
  152.     end of table
  153. ;
  154. ; My table was patched to the following functions
  155. CTLTABLE:        ;11C5 
  156. 11C5    DW    DORET    ;1345H
  157.     DW    CURSOR-LEFT-WORD    ;126DH
  158.     DW    CURSOR-R-L-LINE    ;1289H
  159.     DW    UP-SCREEN    ;142CH
  160.     DW    CURSOR-RIGHT-CHAR    ;1216H
  161.     DW    CURSOR-UP-LINE    ;1303H
  162.     DW    CURSOR-RIGHT-WORD    ;123FH
  163.     DW    DEL-CHAR-RIGHT    ;14ECH
  164.     DW    CURSOR-LEFT-CHAR    ;122AHè    DW    INSERT-TAB    ;153AH
  165.     DW    DORET    ;1345H
  166.     DW    DORET    ;1345H
  167.     DW    DORET    ;1345H
  168.     DW    DO-CR    ;15ABH
  169.     DW    INSERT-CR    ;1594H
  170.     DW    DORET    ;1345H
  171.     DW    PUT-CHAR-IN-FILE    ;151AH
  172.     DW    HELP    ;1954H
  173.     DW    SCREEN-UP    ;1414H
  174.     DW    DORET    ;1345H
  175.     DW    DEL-WORD-RIGHT    ;1476H
  176.     DW    INTERRUPTED    ;23EBH
  177.     DW    INSERT-ON-OFF    ;150BH
  178.     DW    SCROLL-DOWN    ;1409H
  179.     DW    CURSOR-DOWN-LINE    ;12C1H
  180.     DW    DEL-LINE    ;14CEH
  181.     DW    SCROLL-UP    ;137CH
  182.     DW    DOESCAPE    ;1205H
  183.     DW    DORET    ;1345H
  184.     DW    PUT-CHAR-IN-FILE    ;151AH
  185. 1201    DW    DOTOPORBOTTOM    ;1346H
  186. .paè;
  187. ; To allow a CDOS 'motors off' call, or any other call
  188. ;  to your BDOS you may effect the following changes:
  189. ;---------------------------------------------------------
  190. ; Original code at 0100
  191. 0100    JMP    INIT    ;0269H
  192. ; This jump to WMs initialization should be 
  193. ;  patched to cause a call to our routine at 01AD
  194. ;
  195. ; The jump at 0100 is changed to
  196.     JMP    01ADH
  197. ;
  198. ; where this routine has neen patched
  199. ;NOW SAVE CDOS BASE ADDR BEFORE WM CLOBBERS IT
  200. 01AD    LHLD    CDOS-BASE-ADDR    ;at 6
  201. 01B0    SHLD    SAVE-CDOS-BASE    ;01B6H
  202. 01B3    JMP    INIT    ;0269H
  203. ;
  204. ;
  205. ; Original code calling BIOS table jump routine
  206. 23CE    LHLD    L0001    ;1
  207. ;NOW CHANGE CALL TO 0D4A TO CALL OUR PATCH
  208. 23D1    CALL    TBLJUMP    ;0D4AH
  209. 23D4    MOV    A,C
  210. 23D5    PCHL
  211.     etc
  212. ;
  213. ; The CALL 0D4A at 23D1 is changed to CALL 01C4 where
  214. ;  we have put this code:
  215. ; When a call to BIOS occurs this routine intercepts it
  216. ;
  217. ;NOW CALL BDOS VIA OUR PATCH
  218. 01C4    CPI    6
  219. 01C6    JNZ    TBLJUMP    ;0D4AH
  220. ;IF IT WAS A 'CONIN' CALL, INTERCEPT IT
  221. 01C9    PUSH    H
  222. ;PUT THE RETURN ADDR ONTO STACK, AND PREPARE INDIRECT CALL
  223. 01CA    LXI    H,01D4H
  224. 01CD    PUSH    H
  225. 01CE    LHLD    SAVE-CDOS-BASE    ;01B6H
  226. ;96H CALL TO CDOS TURNS OFF MOTORS
  227. 01D1    MVI    C,96H
  228. ;NOW 'CALL' BDOS
  229. 01D3    PCHL
  230. 01D4    POP    H
  231. 01D5    JMP    TBLJUMP    ;0D4AH
  232. ;
  233.