home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / mbug / mbug056.arc / DDTF.DOC < prev    next >
Text File  |  1979-12-31  |  6KB  |  171 lines

  1. *    ddtf.doc
  2. *    Documentation for ddtf.asm, a string-find function for ddt.
  3. *    version 1        october 27, 1981
  4. *
  5. *    (C) 1981, by Roy Lipscomb, Logic Associates, Chicago
  6. *    Copying or distributing permitted only if non-profit.
  7. *    Home system:  HP/RCPM, (312) 955-4493
  8. *
  9. *    This module relocates itself under the ccp, prints a signon
  10. *    message, then invokes ddt.  Loaded, this module takes about
  11. *    .5K by both itself; but since it protects itself and the CCP,
  12. *    it entails 2.5K overhead.
  13. *
  14. *     To have ddt automatically load filename.com, type
  15. *    "ddtf filename.com".
  16. *
  17. *    This module uses two consecutive rst locations.  These
  18. *    may be changed, but must not include rst 0 or rst 7.
  19. *
  20. *
  21. * >>>>> Essential:  Read the note at the end of this document
  22. *    before attempting to assemble DDTF.ASM.
  23. *
  24. *********************************************************************
  25. *            Instructions
  26. *
  27. *    The following instructions are available in condensed form
  28. *    within the program itself, and may be displayed at run time.
  29. *    (The program sign-on message will tell how.)
  30. *
  31. *    This program allows finding all occurences of any string of
  32. *    indefinite length.  Install a model of the string at 5dh,
  33. *    including a prefix and suffix of a single character not
  34. *    used in the model itself.  (For example, "/find this/".)
  35. *    You may do this with the I, A, and/or S commands of ddt.
  36. *
  37. *    A listing of all occurrences of the desired string can now
  38. *    be displayed by typing GB (in the assembly version given).
  39. *    Additional searches can be conducted by simply typing G.
  40. *
  41. *    Each occurence will be represented by a one-line, ddt-style
  42. *    dump.  The string itself will begin in the middle of the line.
  43. *    (The width of the line can be set at assembly time.)
  44. *
  45. *    All registers except the program counter are saved before
  46. *    the search and restored after the search.
  47. *
  48. *    Note:  If the search does not perform properly, check for
  49. *    1)  Missing prefix or suffix.
  50. *    2)  Using a suffix/prefix that also appears in the string.
  51.  
  52. *..................................................................
  53. *            Examples
  54. *..................................................................
  55. *
  56. *    Example:  Find all instances of "disk".
  57. *
  58. *    Procedure:    -i/disk/
  59. *            -gb
  60. *
  61. *..................................................................
  62. *
  63. *    Example:  Find all copies of "JMP CDAB".
  64. *
  65. *    Procedure:    -a5d
  66. *            005D nop
  67. *            005E jmp cdab
  68. *            0061 nop
  69. *            0062 <cr>
  70. *            -gb
  71. *
  72. *..................................................................
  73. *
  74. *    Example:  Find all instances of hex 005638.
  75. *
  76. *    Procedure:    -s5d
  77. *            005D ff
  78. *            005E 00
  79. *            005F 56
  80. *            0060 38
  81. *            0061 ff
  82. *            0062 .
  83. *            -gb
  84. *
  85. *..................................................................
  86. *
  87. *    Example:  Print an interesting display
  88. *
  89. *    Procedure:    -i//
  90. *            -gb
  91. *
  92. *********************************************************************
  93. *
  94. *        Advanced explanations and instructions.
  95. *            (For software hackers)
  96. *
  97. *    Assume we are using the RST 1, 2 locations.  Listing RST 1
  98. *    we see--
  99. *
  100. *        0008    CALL 0038
  101. *        000B    JMP nnnn
  102. *        000E    JPO 0000
  103. *        0011    JNZ E000
  104. *
  105. *    "JMP nnnn" is the entry of ddtf.  In this example, the
  106. *    search is initiated by typing GB.  Additional searches
  107. *    may then be conducted by simply typing G (as long as the
  108. *    program counter has not be explicitly changed with the
  109. *    XP command).
  110. *
  111. *    "CALL 0038" is the exit to DDT from DDTF.  Whenever DDT is
  112. *    invoked in this way, a simple G will activate the next
  113. *    command (in this case, an immediate reentry into DDTF).
  114. *
  115. *    "JPO" gives the starting address of the block to be searched.
  116. *    "JNZ" gives the length of the block to be searched.  The
  117. *    default values are 0000 and E000.  These may be changed
  118. *    at assembly time; they may also be changed at run time
  119. *    by using the A command.  (Changes are not normally needed.)
  120. *
  121. *..................................................................
  122. *
  123. *    Example:  Change length of search block to 200h.
  124. *
  125. *    Procedure:    -a11
  126. *            0011 jnz 200
  127. *            0014 <cr>
  128. *            -
  129. *
  130. *********************************************************************
  131. *
  132. *        IMPORTANT:  ASSEMBLY INSTRUCTIONS
  133. *
  134. *    Note:  As distributed, this source can be assembled
  135. *    only by LASM.COM or LINKASM.COM, Ward Christensen's public
  136. *    domain assemblers.  LINKASM is available as CPMUG 36.11 and 
  137. *    36.12; LASM.COM is available on most RCPM downloading systems.
  138. *    (LASM is a slight upgrade of LINKASM.)
  139. *
  140. *    LASM's special feature is allowing separate source files to
  141. *    be assembled as one, if each source chains in the next via a
  142. *    LINK statement.  (Eg., "LINK NEXT.ASM".)  If linked to itself,
  143. *    a program can create two copies of itself, or of selected
  144. *    routines within itself.  This provides a convenient method for
  145. *    creating a relocatable program without using a relocating
  146. *    assembler.  DDTF.ASM uses this technique.
  147. *
  148. *    1)  If LASM is available, DDTF.ASM will assemble without
  149. *    modification.  The one exception is that if you change the
  150. *    name of the source from DDTF.ASM to something else, you must
  151. *    also change the "LINK DDTF.ASM" at the end of the source file
  152. *    to reflect the new name.
  153. *
  154. *    2)  If LASM is not available, the following "double up"
  155. *    procedure will allow you to use DDTF.ASM with any assembler.
  156. *
  157. *        a)  PIP DDTF2.ASM=DDTF.ASM
  158. *
  159. *        b)  Erase the following lines at the end of DDTF2.ASM:
  160. *
  161. *            IF    NOT COPY1
  162. *            LINK    DDTF
  163. *            ENDIF
  164. *
  165. *        c)  PIP DDTF2.ASM=DDTF2.ASM,DDTF2.ASM
  166. *
  167. *        d)  Assemble and use DDTF2.ASM instead of DDTF.ASM.
  168. *
  169. *                        (end of documentation)
  170. **********************************************************************
  171.