home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / enterprs / cpm / utils / a / asmhelp.lzh / CHAP4.TXT < prev   
Encoding:
Text File  |  1992-12-08  |  5.1 KB  |  114 lines

  1.                               CHAP04.TXT
  2.                          Version 1.01 12/27/84
  3.                         Robert Flagg 72466,2332
  4.  
  5.                          Chapter 4 - Patching
  6.  
  7.          Even  where a program cannot be easily overlaid,  it  is
  8. often  possible  to  configure it for a  particular  computer  or
  9. function    by    changing   the   object   code    byte-by-byte.
  10. Overlaying is a fast way of making many such changes,  but it  is
  11. cumbersome  and  unnecessary where only a few changes need to  be
  12. made. Making changes in this manner is called "patching".
  13.  
  14.          DDT may be used for examining and changing the values at
  15. each  address in the program,  with its "s"  (Set)  command.  For
  16. example, a common patch is changing the cursor delays in WordStar
  17. 3.3 (WS.COM):
  18.  
  19.          A>DDT WS.COM <cr>
  20.          DDT VERS 2.2   <---returned by the command
  21.          NEXT PC        <---returned by the command
  22.          4800 0100      <---returned by the command
  23.          -s02AF         <---the command and starting address (HEX)
  24.          -02AF 03 **    <---returned by command - option to change **
  25.                         <---the ** does not appear on your screen
  26.                         <---Changing the delays:  (note that the
  27.                             delays are DECIMAL!)
  28.  
  29.           Hex Old New
  30.           Add.
  31.          -02AF 03 01    <---(cr) makes the change and
  32.          -02B0 09 03    <---moves to next address (HEX)
  33.          -02B1 19 09    <---change next delay
  34.          -02B2 40 19    <---
  35.          -02B3 09 03    <---last delay
  36.          -02B4 00       <---(cr) keeps data unaltered
  37.          -02B5 00       <---(.) exits "s" mode
  38.          -g0            <---exit from DDT
  39.  
  40.          WARM BOOT      <---system response
  41.  
  42.          A>SAVE 72  WSNEW.COM
  43.  
  44.  
  45.          DDT was created in 1976 by Digital Research. Much easier
  46. screen-oriented  patching  tools have been developed since  then.
  47. Notable  examples  in the public domain are EDFILE and  its  very
  48. recent offspring, PATCH.
  49.  
  50.          The  following is an example of invoking EDFILE for  the
  51. purpose  of  examining the file  PATNEW.COM.  PATCH  is  similar,
  52. except  that  it  is much more screen  oriented,  making  use  of
  53. hilighting  and also using the standard WordStar cursor  movement
  54. control keys (^X,  ^S,  ^D,  etc.). PATCH also allows you to edit
  55. memory (and in versions 1.5 and above -track-by-track on any disk
  56. drive!)
  57.  
  58. .PO 5
  59.  
  60. A>edfile c:patnew.com
  61.  
  62.  
  63. Vers: 01-10-84; by: J.C.Kaltwasser & M.J.Mosko, K3RL
  64.  
  65. File: C:PATNEW.COM  Record: 00001 (0001H)   LOF: 00171 (00ABH)
  66.       00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F   0123456789ABCDEF
  67.       -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --   ----------------
  68. 0180- 65 74 69 74 00 00 00 00 00 00 00 04 1B 3D 00 00  >etit.........=..<
  69. 0190- 64 00 1B 6C 2F 63 00 1B 2F 6C 63 01 20 20 04 03  >d..l/c../lc.  ..<
  70. 01A0- 0A 00 01 1A 2A 40 23 00 00 11 00 00 00 00 02 1B  >....*@@#.........<
  71. 01B0- 45 00 00 00 02 1B 52 08 00 00 0A 00 02 1B 54 00  >E.....R.......T.<
  72. 01C0- 00 00 02 1B 29 34 00 00 02 1B 28 30 00 00 0A 00  >....)4....(0....<
  73. 01D0- 7E B7 37 C8 23 F5 E5 7E CD 00 02 E1 F1 3D C8 18  >~77H#ue~M..aq=H.<
  74. 01E0- F3 CD 25 02 0D 0A 00 C9 C5 D5 E5 DD E5 FD E5 F5  >sM%....IEUe]e}eu<
  75. 01F0- 6F 26 00 E5 CD A6 00 F1 FD E1 DD E1 E1 D1 C1 C9  >o&.eM&.q}a]aaQAI<
  76.  
  77. ?<cr>
  78. File: C:PATNEW.COM  Record: 00002 (0002H)   LOF: 00171 (00ABH)
  79.       00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F   0123456789ABCDEF
  80.       -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --   ----------------
  81. 0200- 6F E5 CD A6 00 C9 FE 80 DC 90 02 D4 A9 02 E6 7F  >oeM&.I~.\..T).f<
  82. 0210- 18 EE C5 D5 E5 DD E5 FD E5 CD A3 00 7D 18 D9 E5  >.nEUe]e}eM#.}.Ye<
  83. 0220- 21 06 02 18 04 E5 21 00 02 22 38 02 E1 E3 F5 C5  >!....e!.."8.acuE<
  84. 0230- D5 7E 23 B7 28 07 E5 CD 00 02 E1 18 F4 D1 C1 F1  >U~#7(.eM..a.tQAq<
  85. 0240- E3 C9 7D B4 C8 3A 24 01 87 87 87 E3 E3 E3 E3 C5  >cI}4H:$....ccccE<
  86. 0250- 01 D2 04 C1 3D 20 F4 2B 18 E8 CD D0 01 D8 2A CE  >.R.A= t+.hMP.X*N<
  87. 0260- 01 18 DF F5 C5 D5 E5 21 A8 01 CD 5A 02 21 A2 01  >.._uEUe!(.MZ.!".<
  88. 0270- CD D0 01 2A BA 01 D4 42 02 E1 D1 C1 F1 C9 F5 C5  >MP.*:.TB.aQAqIuE<
  89.  
  90. ?Q <cr>
  91. .PO 8
  92.  
  93.          As  you can see,  a <cr> takes you through the file  one
  94. page at a time.  Both HEX and ASCII are dumped to the screen, and
  95. finding an address is simply a matter of reading across and down.
  96. Both  EDFILE  and PATCH allow you to edit either the HEX  or  the
  97. ASCII  columns and both allow writing of the edited file back  to
  98. the disk by a simple write command,  thus eliminating those pesky
  99. "SAVE"  sizes!  A  very useful feature of these programs  is  the
  100. ability to search through a file for HEX and/or ASCII strings.
  101.  
  102.          PATCH version 1.5 is available on the KayPro SIG in DL1.
  103. There  are several files:  PAT15.BIN(COM),  the object code file,
  104. PAT15.DOC,  the documentation and three files used for installing
  105. the  program  on your  system:  PATINS.BIN(COM),  the  installer,
  106. PAT15.INS,  the installation message file and PAT15.DTA, a binary
  107. data file containing data on about 30 common terminals, including
  108. KayPro with and without hilighting!
  109. 9 F5 C5  >MP.*:.TB.aQAqIuE<
  110.  
  111. ?Q <cr>
  112. .PO 8
  113.  
  114.          As  you can see