home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Programming / Misc / rs60-2.dms / rs60-2.adf / Examples / ExampleMacros.asm < prev   
Encoding:
Assembly Source File  |  1994-04-20  |  37.9 KB  |  1,202 lines

  1. *****************************************************************************
  2. *        Example Macros V1.00 ©1994 The Puzzle Factory, Inc.                *
  3. *        This macro file may be freely redistributed as long as this        *
  4. *        copyright notice is not removed.                                   *
  5. *                                                                           *
  6. *    The contents of this file is provided without warrantee of any kind    *
  7. *    and the entire responsibility for use is assumed by the end user.      *
  8. *****************************************************************************
  9.  
  10. ;>>>        PLEASE READ THIS FILE BEFORE USING THE RS.MACROS FILE         <<<
  11. ;
  12. ;This file contains a number of example macros which you may use to do useful
  13. ;things, to learn more about your Amiga, or to better understand haw to write
  14. ;your own ReSource macros.
  15. ;
  16. ;IMPORTANT NOTE                                                IMPORTANT NOTE
  17. ;It is not possible to provide standard macros that may be freely used in all
  18. ;situations with a tool such as ReSource.  Because the macro itself can't
  19. ;know what sort of code or data it is being used on, it it up to the user to
  20. ;ensure that it will be used with some degree of intelligence.  The following
  21. ;example will, perhaps, illustrate the problem.
  22. ;
  23. ;Suppose that there exists in your code, a NewWindow structure.  After
  24. ;disassembly, but before using the "NewWindow" macro, it looks like this:
  25. ;
  26. ;lbL000A54     dl      0
  27. ;              dl      $12D0077
  28. ;              dl      $FFFF0000
  29. ;              dl      $2200002
  30. ;              dw      $140E
  31. ;              dl      lbL000A84
  32. ;              dw      0
  33. ;              dw      0
  34. ;              dl      MyTitle.MSG
  35. ;              dw      0
  36. ;              dw      0
  37. ;              dw      0
  38. ;              dw      0
  39. ;              dw      0
  40. ;              dw      0
  41. ;              dw      0
  42. ;              dw      0
  43. ;              dw      1
  44. ;
  45. ;After using the "NewWindow" macro, it looks like this:
  46. ;
  47. ;lbW000A54     dw      0,0,301,119
  48. ;              db      $FF,$FF
  49. ;              dl      (IDCMP_GADGETDOWN|IDCMP_CLOSEWINDOW)
  50. ;              dl      (WFLG_DRAGBAR|WFLG_DEPTHGADGET|WFLG_CLOSEGADGET|WFLG_SMART_REFRESH|WFLG_GIMMEZEROZERO|WFLG_ACTIVATE|WFLG_NOCAREREFRESH)
  51. ;              dl      lbL000A84
  52. ;              dl      0
  53. ;              dl      MyTitle.MSG
  54. ;              dl      0
  55. ;              dl      0
  56. ;              dw      0,0,0,0
  57. ;              dw      WBENCHSCREEN
  58. ;
  59. ;This is all well and good, and you are, hopefully, happy with the result.
  60. ;
  61. ;But suppose that in this particular program the programmer decided to access
  62. ;some variables in the NewWindow structure, and the C compiler that produced
  63. ;the executable put labels in the middle of structure fields, rather than
  64. ;using offsets from the structure beginning (this actually happens quite
  65. ;frequently).  Now the disassembled, but unstructured data will look like
  66. ;this:
  67. ;
  68. ;lbW000A54     dw      0
  69. ;lbW000A56     dw      0          ;nw_TopEdge
  70. ;lbW000A58     dw      $12D       ;nw_Width
  71. ;lbL000A5A     dl      $77FFFF    ;nw_Height
  72. ;              dl      $220
  73. ;              dw      2
  74. ;lbW000A64     dw      $140E      ;nw_Flags+2 (word)
  75. ;              dl      lbL000A84
  76. ;              dw      0
  77. ;              dw      0
  78. ;              dl      MyTitle.MSG
  79. ;              dw      0
  80. ;              dw      0
  81. ;              dw      0
  82. ;              dw      0
  83. ;              dw      0
  84. ;              dw      0
  85. ;              dw      0
  86. ;              dw      0
  87. ;              dw      1
  88. ;
  89. ;And after using the "NewWindow" macro, it looks like this:
  90. ;
  91. ;lbW000A54     dw      0
  92. ;lbW000A56     dw      0          ;nw_TopEdge
  93. ;lbW000A58     dw      $12D       ;nw_Width
  94. ;lbL000A5A     dl      $77FFFF    ;nw_Height
  95. ;              db      0,0
  96. ;              dl      (IDCMP_NEWSIZE|IDCMP_VANILLAKEY|IDCMP_CHANGEWINDOW)
  97. ;lbW000A64     dw      (WFLG_DRAGBAR|WFLG_SIZEBRIGHT|WFLG_SMART_REFRESH|WFLG_BACKDROP|WFLG_REPORTMOUSE|WFLG_GIMMEZEROZERO|WFLG_NOCAREREFRESH|WFLG_NW_EXTENDED|WFLG_WINDOWTICKED|WFLG_ZOOMED|$80000)
  98. ;              dl      lbL000A84
  99. ;              dw      0
  100. ;              dw      0
  101. ;              dl      MyTitle.MSG
  102. ;              dw      0
  103. ;              dw      0,0,0,0
  104. ;              dw      0
  105. ;              dw      0
  106. ;              dw      0
  107. ;              dw      1
  108. ;
  109. ;As you can see, the addition of the labels into the middle of this data,
  110. ;caused the macro to completely mess up the NewWindow structure.  Depending
  111. ;on your assembler, this may still assemble correctly, but I wouldn't count
  112. ;on it.  About the only thing one can do in a case like this is to not use
  113. ;the macro, or to write a very long and very complicated macro that attempts
  114. ;to be all things to all programs.  What should really happen is to change
  115. ;the assembly source so that, after finishing the disassembly, so that
  116. ;"lbW000A64" for example, is referenced as "lbW000A62+2", or better, as
  117. ;"_NewWindow+nw_Flags+2".
  118. ;
  119. ;Because of these problems, it is very important to cast a discerning eye at
  120. ;any code or data you plan on converting with a ReSource macro.
  121. ;
  122. ;WHY NOT JUST IMPROVE RESOURCE MACROS?
  123. ;Macros were not ever intended to be used for this purpose.  ReSource Macros
  124. ;were intended to be used to do simple repetitive tasks.  ReSource Command
  125. ;Language (RCL) was intended for tasks where complex decisions are needed to
  126. ;be made about the code being disassembled.  We have plans to release a
  127. ;variety of RCL scripts in the future.  Stay tuned for announcements.
  128. ;
  129. ;                      ---------------/---------------
  130. ;NOTES
  131. ;All the macros in this file that operate on structures, place a blank line
  132. ;at the beginning of the structure, and none at the end.  This is an important
  133. ;consideration because otherwise it is possible that multiple blank lines will
  134. ;be inserted between structures.
  135. ;
  136. ;Each macro comes with instructions on its use.  Please read these in order
  137. ;to know what assumptions are present in the macro so that you may get good
  138. ;use from them.
  139. ;
  140. ;TPF
  141.  
  142.  
  143. ;Set tabs:          |       |                 |       |       |       |
  144.  
  145.     ifd    __m68
  146. CAPE    set    1
  147.     ENDC
  148.     ifd    CAPE
  149.     bnryonly
  150.     endc
  151.  
  152.     dc.l    $BABEF00F    ; ReSource macros identifier
  153.     dc.l    0    ; number of words of user data following
  154.     dc.b    '   - General Macros -   '    ; User-defined name #1.
  155.     dc.b    '  - Intuition Macros -  '    ; User-defined name #2.
  156.     dc.b    '- Miscellaneous Macros -'    ; User-defined name #3.
  157. ************************************************************************
  158. ;Whenever the disassembly shows location 4 (AbsExecBase), use this macro to
  159. ;rename it to something more meaningful.  This macro only calls a symbol
  160. ;base, but you may find it more convenient to just hit KP-1.
  161.  
  162.     dc.l    1    ; Macro number 1
  163.     dc.l    macroend01-macrostart01
  164.  
  165. macnamestart01    dc.b    'Conv. 4 -> AbsExecBase  '
  166.     ifgt    24-(*-macnamestart01)
  167.     dcb.b    24-(*-macnamestart01),0
  168.     endc
  169.  
  170. macrostart01    dc.w    $0177    ; SYMBOLS/Trap Vectors
  171.     dc.w    0    ; reserved
  172. macroend01:
  173. ************************************************************************
  174. ;This macro will search for "jsr<tab>_LVO" or "jmp<tab>_LVO" and rename the
  175. ;preceeding label with the name of the system call preceeded by an underscore.
  176. ;So "jsr<tab>_LVOOpenWindow" will produce a label named "_OpenWindow".
  177. ;This is very useful for those annoying little C language stubs.
  178. ;The actual library calls must have already been parsed and named before
  179. ;using this macro.  This macro works with old syntax.
  180.  
  181.     dc.l    2    ; Macro number 2
  182.     dc.l    macroend02-macrostart02
  183.  
  184. macnamestart02    dc.b    'SysCalls: Old syntax    '
  185.     ifgt    24-(*-macnamestart02)
  186.     dcb.b    24-(*-macnamestart02),0
  187.     endc
  188.  
  189. macrostart02    dc.w    $0677    ; CURSOR/Pattern search/Set pattern string
  190.     dc.w    (2$-1$)
  191.  
  192. 1$    dc.b    'j(mp|sr)    _LVO',0,1
  193.     cnop    0,2
  194.  
  195. 2$    dc.w    $004E    ; CURSOR/Pattern search/Find next occurrence
  196.     dc.w    $020A    ; STRINGS/Get/Symbol
  197.     dc.w    $0205    ; STRINGS/Edit functions/Clip start
  198.     dc.w    (4$-3$)
  199.  
  200. 3$    dc.b    '_LVO',0,1
  201.     cnop    0,2
  202.  
  203. 4$    dc.w    $0207    ; STRINGS/Edit functions/Prepend
  204.     dc.w    (6$-5$)
  205.  
  206. 5$    dc.b    '_',0,1
  207.     cnop    0,2
  208.  
  209. 6$    dc.w    $0187    ; CURSOR/Relative/Previous label
  210.     dc.w    $0213    ; STRINGS/Put/Label
  211.     dc.w    $0186    ; CURSOR/Relative/Next label
  212.     dc.w    0    ; reserved
  213. macroend02:
  214. ************************************************************************
  215. ;This macro is identical to the one directly above, but works with new syntax.
  216.  
  217.     dc.l    3    ; Macro number 3
  218.     dc.l    macroend03-macrostart03
  219.  
  220. macnamestart03    dc.b    'SysCalls: New syntax    '
  221.     ifgt    24-(*-macnamestart03)
  222.     dcb.b    24-(*-macnamestart03),0
  223.     endc
  224.  
  225. macrostart03    dc.w    $0677    ; CURSOR/Pattern search/Set pattern string
  226.     dc.w    (2$-1$)
  227.  
  228. 1$    dc.b    'j(mp|sr)    ''(_LVO',0,1
  229.     cnop    0,2
  230.  
  231. 2$    dc.w    $004E    ; CURSOR/Pattern search/Find next occurrence
  232.     dc.w    $020A    ; STRINGS/Get/Symbol
  233.     dc.w    $0205    ; STRINGS/Edit functions/Clip start
  234.     dc.w    (4$-3$)
  235.  
  236. 3$    dc.b    '_LVO',0,1
  237.     cnop    0,2
  238.  
  239. 4$    dc.w    $0207    ; STRINGS/Edit functions/Prepend
  240.     dc.w    (6$-5$)
  241.  
  242. 5$    dc.b    '_',0,1
  243.     cnop    0,2
  244.  
  245. 6$    dc.w    $0187    ; CURSOR/Relative/Previous label
  246.     dc.w    $0213    ; STRINGS/Put/Label
  247.     dc.w    $0186    ; CURSOR/Relative/Next label
  248.     dc.w    0    ; reserved
  249. macroend03:
  250. ************************************************************************
  251. ;This macro is useful when you have a number of labels in a program that jump
  252. ;to the C stubs converted by the 2 macros directly above.  Position the line
  253. ;with the "JMP" instruction on the cursor line, and execute this macro.
  254. ;The label on the "JMP" line will be converted to "<label>.jmp".
  255. ;So "Label jmp _OpenWindow" will produce "_OpenWindow.jmp jmp _OpenWindow".
  256. ;The cursor line must already have a label.
  257.  
  258.     dc.l    4    ; Macro number 4
  259.     dc.l    macroend04-macrostart04
  260.  
  261. macnamestart04    dc.b    'Create LibCall Name.jmp '
  262.     ifgt    24-(*-macnamestart04)
  263.     dcb.b    24-(*-macnamestart04),0
  264.     endc
  265.  
  266. macrostart04    dc.w    $0040    ; CURSOR/Absolute/Forward reference
  267.     dc.w    $0209    ; STRINGS/Get/Label
  268.     dc.w    $003F    ; CURSOR/Absolute/Previous location
  269.     dc.w    $0208    ; STRINGS/Edit functions/Append
  270.     dc.w    (2$-1$)
  271.  
  272. 1$    dc.b    '.jmp',0,1
  273.     cnop    0,2
  274.  
  275. 2$    dc.w    $0213    ; STRINGS/Put/Label
  276.     dc.w    0    ; reserved
  277. macroend04:
  278. ************************************************************************
  279. ;ReSource almost always detects WORD jump tables, but occasionally misses
  280. ;one.  You can clean it up by putting the table base loaction on the cursor
  281. ;line and calling this macro.  It will end by itself when it runs out of
  282. ;words to convert.
  283.  
  284.     dc.l    5    ; Macro number 5
  285.     dc.l    macroend05-macrostart05
  286.  
  287. macnamestart05    dc.b    'WORD size JMP Table     '
  288.     ifgt    24-(*-macnamestart05)
  289.     dcb.b    24-(*-macnamestart05),0
  290.     endc
  291.  
  292. macrostart05    dc.w    $0056    ; */Convert specific EA's/Set base #1
  293.     dc.w    $0677    ; CURSOR/Pattern search/Set pattern string
  294.     dc.w    (2$-1$)
  295.  
  296. 1$    dc.b    '(    dc.w    |    dw    )',0,1
  297.     cnop    0,2
  298.  
  299. 2$    dc.w    $0247    ; MACROS 1/Set macro label/#1
  300.     dc.w    $7FA1    ; MACROS 1/Set macro label/#1
  301.     dc.w    $0256    ; CURSOR/Pattern search/Search this line
  302.     dc.w    $0059    ; */Convert specific EA's/Cvert W/base 1
  303.     dc.w    $8211    ; CURSOR/Relative/Next byte * 2
  304.     dc.w    $0251    ; MACROS 1/Previous macro label/#1
  305.     dc.w    0    ; reserved
  306. macroend05:
  307. ************************************************************************
  308. ;This macro gets the reference label of a "JMP" instruction, and renames
  309. ;the label on the "JMP" line, "<label>.jmp".
  310. ;So "Label jmp strcmp" will produce "strcmp.jmp jmp strcmp".
  311.  
  312.     dc.l    6    ; Macro number 6
  313.     dc.l    macroend06-macrostart06
  314.  
  315. macnamestart06    dc.b    'Name from Fwd Ref       '
  316.     ifgt    24-(*-macnamestart06)
  317.     dcb.b    24-(*-macnamestart06),0
  318.     endc
  319.  
  320. macrostart06    dc.w    $0040    ; CURSOR/Absolute/Forward reference
  321.     dc.w    $0209    ; STRINGS/Get/Label
  322.     dc.w    $003F    ; CURSOR/Absolute/Previous location
  323.     dc.w    $0208    ; STRINGS/Edit functions/Append
  324.     dc.w    (2$-1$)
  325.  
  326. 1$    dc.b    '.jmp',0,1
  327.     cnop    0,2
  328.  
  329. 2$    dc.w    $0213    ; STRINGS/Put/Label
  330.     dc.w    $0186    ; CURSOR/Relative/Next label
  331.     dc.w    0    ; reserved
  332. macroend06:
  333. ************************************************************************
  334. ;This is a dangerous macro!
  335. ;This macro loops forever or until aborted!
  336. ;If you have some image data, and would like to convert it to binary, first
  337. ;set the data size, words or longwords.  Then call this macro with the start
  338. ;of the data on the cursor line.  Select the abort function, either from the
  339. ;1st menu or from the keyboard, when you get near the bottom of the data to
  340. ;convert.
  341. ;If you do not have real fast reflexes, change the line at "macrostart07"
  342. ;to "dc.w    $019C   ; MACROS 1/Execution speed/Slow".
  343.  
  344.     dc.l    7    ; Macro number 7
  345.     dc.l    macroend07-macrostart07
  346.  
  347. macnamestart07    dc.b    'Convert to binary       '
  348.     ifgt    24-(*-macnamestart07)
  349.     dcb.b    24-(*-macnamestart07),0
  350.     endc
  351.  
  352. macrostart07    dc.w    $019B    ; MACROS 1/Execution speed/Fast
  353.     dc.w    $002D    ; DISPLAY/Set Numeric base/Binary
  354.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  355.     dc.w    $0251    ; MACROS 1/Previous macro label/#1
  356.     dc.w    0    ; reserved
  357. macroend07:
  358. ************************************************************************
  359. ;This is a dangerous macro!
  360. ;This macro loops forever or until aborted!
  361. ;Many times you will have a number of subroutines in a program that you
  362. ;would like to treat as "black boxes".  That is, starting with a global label
  363. ;and containing only local labels.  It is generally safe to treat programs
  364. ;written in C this way, but programs written in assembler may have entry
  365. ;points anywhere.
  366. ;To use this macro, position the 2nd label (the label after the global label)
  367. ;on the cursor line, and execute this macro.  Select the abort function,
  368. ;either from the 1st menu or from the keyboard, when you get to the last label
  369. ;to convert.
  370. ;If you do not have real fast reflexes, change the line at "macrostart08"
  371. ;to "dc.w    $019C   ; MACROS 1/Execution speed/Slow".
  372.  
  373.     dc.l    8    ; Macro number 8
  374.     dc.l    macroend8-macrostart8
  375.  
  376. macnamestart8    dc.b    'Local labels            '
  377.     ifgt    24-(*-macnamestart8)
  378.     dcb.b    24-(*-macnamestart8),0
  379.     endc
  380.  
  381. macrostart8    dc.w    $019B    ; MACROS 1/Execution speed/Fast
  382.     dc.w    $029D    ; STRINGS/Accumulator/Decimal
  383.     dc.w    $0225    ; STRINGS/Define string/Acm
  384.     dc.w    (2$-1$)
  385.  
  386. 1$    dc.b    '1$',0,1
  387.     cnop    0,2
  388.  
  389. 2$    dc.w    $0247    ; MACROS 1/Set macro label/#1
  390.     dc.w    $7FA1    ; MACROS 1/Set macro label/#1
  391.     dc.w    $0213    ; STRINGS/Put/Label
  392.     dc.w    $0186    ; CURSOR/Relative/Next label
  393.     dc.w    $0206    ; STRINGS/Edit functions/Clip end
  394.     dc.w    (4$-3$)
  395.  
  396. 3$    dc.b    '$',0,1
  397.     cnop    0,2
  398.  
  399. 4$    dc.w    $0216    ; STRINGS/Maths functions/Increment
  400.     dc.w    $0208    ; STRINGS/Edit functions/Append
  401.     dc.w    (6$-5$)
  402.  
  403. 5$    dc.b    '$',0,1
  404.     cnop    0,2
  405.  
  406. 6$    dc.w    $0251    ; MACROS 1/Previous macro label/#1
  407.     dc.w    0    ; reserved
  408. macroend8:
  409. ************************************************************************
  410. ;This is the minimum "Auto-configuration" macro that ReSource will produce.
  411. ;If you have made changes to your ReSource environment, substitute your
  412. ;"Auto-configuration" macro for this macro (must be macro 19).
  413.  
  414.     dc.l    19    ; Macro number 19
  415.     dc.l    macroend19-macrostart19
  416.  
  417. macnamestart19    dc.b    ' Auto-configuration     '
  418.     ifgt    24-(*-macnamestart19)
  419.     dcb.b    24-(*-macnamestart19),0
  420.     endc
  421.  
  422. macrostart19    dc.w    $0384    ; DISPLAY 2/Set comments column
  423.     dc.w    (2$-1$)
  424.  
  425. 1$    dc.b    '$34',0,1
  426.     cnop    0,2
  427.  
  428. 2$    dc.w    $0339    ; MACROS 3/Execute/(#19)
  429.     dc.w    0    ; reserved
  430. macroend19:
  431. ************************************************************************
  432. *                 ---==== End of General Macros ====---                *
  433. ************************************************************************
  434. ;After disassembly, and if there are no extraneous labels, position the
  435. ;start of the structure on the cursor line, and execute this macro to get
  436. ;a symbolic NewScreen structure.
  437.  
  438.     dc.l    20    ; Macro number 20
  439.     dc.l    macroend20-macrostart20
  440.  
  441. macnamestart20    dc.b    'NewScreen               '
  442.     ifgt    24-(*-macnamestart20)
  443.     dcb.b    24-(*-macnamestart20),0
  444.     endc
  445.  
  446. macrostart20    dc.w    $001F    ; LABELS/Create single/Full-line comment
  447.     dc.w    (2$-1$)
  448.  
  449. 1$    dc.b    ';',0,1
  450.     cnop    0,2
  451.  
  452. 2$    dc.w    $0014    ; DISPLAY/Set data type/Words
  453.     dc.w    $850A    ; CURSOR/Relative/Next line * 5
  454.     dc.w    $0017    ; DISPLAY/Set data type/Bytes
  455.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  456.     dc.w    $0014    ; DISPLAY/Set data type/Words
  457.     dc.w    $031F    ; SYMBOLS/View modes
  458.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  459.     dc.w    $0678    ; SYMBOLS/Screen types
  460.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  461.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  462.     dc.w    $8409    ; CURSOR/Relative/Previous line * 4
  463.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  464.     dc.w    $8509    ; CURSOR/Relative/Previous line * 5
  465.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  466.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  467.     dc.w    0    ; reserved
  468. macroend20:
  469. ************************************************************************
  470. ;After disassembly, and if there are no extraneous labels, position the
  471. ;start of the structure on the cursor line, and execute this macro to get
  472. ;a symbolic NewWindow structure.
  473.  
  474.     dc.l    21    ; Macro number 21
  475.     dc.l    macroend21-macrostart21
  476.  
  477. macnamestart21    dc.b    'NewWindow               '
  478.     ifgt    24-(*-macnamestart21)
  479.     dcb.b    24-(*-macnamestart21),0
  480.     endc
  481.  
  482. macrostart21    dc.w    $001F    ; LABELS/Create single/Full-line comment
  483.     dc.w    (2$-1$)
  484.  
  485. 1$    dc.b    ';',0,1
  486.     cnop    0,2
  487.  
  488. 2$    dc.w    $0014    ; DISPLAY/Set data type/Words
  489.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  490.     dc.w    $0017    ; DISPLAY/Set data type/Bytes
  491.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  492.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  493.     dc.w    $0113    ; SYMBOLS/IDCMP classes
  494.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  495.     dc.w    $014F    ; SYMBOLS/Window flags
  496.     dc.w    $860A    ; CURSOR/Relative/Next line * 6
  497.     dc.w    $0014    ; DISPLAY/Set data type/Words
  498.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  499.     dc.w    $0014    ; DISPLAY/Set data type/Words
  500.     dc.w    $0678    ; SYMBOLS/Screen types
  501.     dc.w    $8409    ; CURSOR/Relative/Previous line * 4
  502.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  503.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  504.     dc.w    $8909    ; CURSOR/Relative/Previous line * 9
  505.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  506.     dc.w    $8409    ; CURSOR/Relative/Previous line * 4
  507.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  508.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  509.     dc.w    0    ; reserved
  510. macroend21:
  511. ************************************************************************
  512. ;After disassembly, and if there are no extraneous labels, position the
  513. ;start of the structure on the cursor line, and execute this macro to get
  514. ;a symbolic TextAttr structure.
  515.  
  516.     dc.l    22    ; Macro number 22
  517.     dc.l    macroend22-macrostart22
  518.  
  519. macnamestart22    dc.b    'TextAttr                '
  520.     ifgt    24-(*-macnamestart22)
  521.     dcb.b    24-(*-macnamestart22),0
  522.     endc
  523.  
  524. macrostart22    dc.w    $0040    ; CURSOR/Absolute/Forward reference
  525.     dc.w    $001D    ; LABELS/Create single/Label
  526.     dc.w    (2$-1$)
  527.  
  528. 1$    dc.b    'FontName',0,1
  529.     cnop    0,2
  530.  
  531. 2$    dc.w    $003F    ; CURSOR/Absolute/Previous location
  532.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  533.     dc.w    $0014    ; DISPLAY/Set data type/Words
  534.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  535.     dc.w    $0017    ; DISPLAY/Set data type/Bytes
  536.     dc.w    $010C    ; SYMBOLS/Font styles
  537.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  538.     dc.w    $010A    ; SYMBOLS/FontFlags
  539.     dc.w    0    ; reserved
  540. macroend22:
  541. ************************************************************************
  542. ;3 steps to easy IntuiText label creation:
  543. ;Use this macro and the "<name>.Text" and "IntuiText Names" macros to create
  544. ;meaningful labels easily.
  545. ;Only use these macros if there are no extraneous labels in the IntuiText
  546. ;structure.
  547. ;Do step 1 for all IntuiText structures in a group.  Then do step 2 for all
  548. ;"it_IText" data.  Then do step 3 for all IntuiText structures.
  549. ;
  550. ;Step 1 in easy IntuiText label creation:
  551. ;After disassembly, and if there are no extraneous labels, position the
  552. ;start of the structure on the cursor line, and execute this macro to get
  553. ;a symbolic IntuiText structure.
  554. ;If appropriate, then use the "<name>.Text" and "IntuiText Names" macros.
  555.  
  556.     dc.l    23    ; Macro number 23
  557.     dc.l    macroend23-macrostart23
  558.  
  559. macnamestart23    dc.b    'IText                   '
  560.     ifgt    24-(*-macnamestart23)
  561.     dcb.b    24-(*-macnamestart23),0
  562.     endc
  563.  
  564. macrostart23    dc.w    $0017    ; DISPLAY/Set data type/Bytes
  565.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  566.     dc.w    $0014    ; DISPLAY/Set data type/Words
  567.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  568.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  569.     dc.w    $830A    ; CURSOR/Relative/Next line * 3
  570.     dc.w    $0042    ; LABELS/Edit single/Full-line comment
  571.     dc.w    (2$-1$)
  572.  
  573. 1$    dc.b    ';',0,1
  574.     cnop    0,2
  575.  
  576. 2$    dc.w    $8509    ; CURSOR/Relative/Previous line * 5
  577.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  578.     dc.w    $8409    ; CURSOR/Relative/Previous line * 4
  579.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  580.     dc.w    0    ; reserved
  581. macroend23:
  582. ************************************************************************
  583. ;Step 2 in easy IntuiText label creation:
  584. ;This macro is useful for creating consistant names for IntuiText structures
  585. ;and their "it_IText" data.
  586. ;When ReSource detects referenced ASCII, it creates a label out of the ASCII
  587. ;text, and appends ".MSG".
  588. ;This macro will replace the "MSG" part with "Text".
  589. ;Don't use on labels that don't end in "MSG".
  590. ;After using the "IText" macro and this one, then use the "IntuiText Names"
  591. ;macro, if appropriate.
  592.  
  593.     dc.l    24    ; Macro number 24
  594.     dc.l    macroend24-macrostart24
  595.  
  596. macnamestart24    dc.b    '<name>.Text             '
  597.     ifgt    24-(*-macnamestart24)
  598.     dcb.b    24-(*-macnamestart24),0
  599.     endc
  600.  
  601. macrostart24    dc.w    $0209    ; STRINGS/Get/Label
  602.     dc.w    $0206    ; STRINGS/Edit functions/Clip end
  603.     dc.w    (2$-1$)
  604.  
  605. 1$    dc.b    'MSG',0,1
  606.     cnop    0,2
  607.  
  608. 2$    dc.w    $0208    ; STRINGS/Edit functions/Append
  609.     dc.w    (4$-3$)
  610.  
  611. 3$    dc.b    'Text',0,1
  612.     cnop    0,2
  613.  
  614. 4$    dc.w    $0213    ; STRINGS/Put/Label
  615.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  616.     dc.w    0    ; reserved
  617. macroend24:
  618. ************************************************************************
  619. ;Step 3 in easy IntuiText label creation:
  620. ;After using the "IText" and "<name>.Text" macros, then use this one, if
  621. ;appropriate.
  622. ;Position the start of the IntuiText structure on the cursor line, and
  623. ;execute this macro to get a meaningful name for the IntuiText structure.
  624. ;It will end up with the name "<text>.ITxt".
  625.  
  626.     dc.l    25    ; Macro number 25
  627.     dc.l    macroend25-macrostart25
  628.  
  629. macnamestart25    dc.b    'IntuiText Names         '
  630.     ifgt    24-(*-macnamestart25)
  631.     dcb.b    24-(*-macnamestart25),0
  632.     endc
  633.  
  634. macrostart25    dc.w    $000A    ; CURSOR/Relative/Next line
  635.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  636.     dc.w    $0040    ; CURSOR/Absolute/Forward reference
  637.     dc.w    $0209    ; STRINGS/Get/Label
  638.     dc.w    $003F    ; CURSOR/Absolute/Previous location
  639.     dc.w    $0187    ; CURSOR/Relative/Previous label
  640.     dc.w    $0206    ; STRINGS/Edit functions/Clip end
  641.     dc.w    (2$-1$)
  642.  
  643. 1$    dc.b    'Text',0,1
  644.     cnop    0,2
  645.  
  646. 2$    dc.w    $0208    ; STRINGS/Edit functions/Append
  647.     dc.w    (4$-3$)
  648.  
  649. 3$    dc.b    'ITxt',0,1
  650.     cnop    0,2
  651.  
  652. 4$    dc.w    $0213    ; STRINGS/Put/Label
  653.     dc.w    $0186    ; CURSOR/Relative/Next label
  654.     dc.w    0    ; reserved
  655. macroend25:
  656. ************************************************************************
  657. ;After disassembly, and if there are no extraneous labels, position the
  658. ;start of the structure on the cursor line, and execute this macro to get
  659. ;a symbolic Menu structure.
  660.  
  661.     dc.l    26    ; Macro number 26
  662.     dc.l    macroend26-macrostart26
  663.  
  664. macnamestart26    dc.b    'Menu                    '
  665.     ifgt    24-(*-macnamestart26)
  666.     dcb.b    24-(*-macnamestart26),0
  667.     endc
  668.  
  669. macrostart26    dc.w    $0013    ; DISPLAY/Set data type/Longs
  670.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  671.     dc.w    $0014    ; DISPLAY/Set data type/Words
  672.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  673.     dc.w    $0014    ; DISPLAY/Set data type/Words
  674.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  675.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  676.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  677.     dc.w    $0014    ; DISPLAY/Set data type/Words
  678.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  679.     dc.w    $001F    ; LABELS/Create single/Full-line comment
  680.     dc.w    (2$-1$)
  681.  
  682. 1$    dc.b    ';',0,1
  683.     cnop    0,2
  684.  
  685. 2$    dc.w    $8409    ; CURSOR/Relative/Previous line * 4
  686.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  687.     dc.w    $8309    ; CURSOR/Relative/Previous line * 3
  688.     dc.w    $011E    ; SYMBOLS/Menu flags
  689.     dc.w    $8409    ; CURSOR/Relative/Previous line * 4
  690.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  691.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  692.     dc.w    $8109    ; CURSOR/Relative/Previous line * 1
  693.     dc.w    $0040    ; CURSOR/Absolute/Forward reference
  694.     dc.w    0    ; reserved
  695. macroend26:
  696. ************************************************************************
  697. ;After disassembly, and if there are no extraneous labels, position the
  698. ;start of the structure on the cursor line, and execute this macro to get
  699. ;a symbolic MenuItem structure.
  700.  
  701.     dc.l    27    ; Macro number 27
  702.     dc.l    macroend27-macrostart27
  703.  
  704. macnamestart27    dc.b    'MenuItem                '
  705.     ifgt    24-(*-macnamestart27)
  706.     dcb.b    24-(*-macnamestart27),0
  707.     endc
  708.  
  709. macrostart27    dc.w    $0013    ; DISPLAY/Set data type/Longs
  710.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  711.     dc.w    $0014    ; DISPLAY/Set data type/Words
  712.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  713.     dc.w    $0014    ; DISPLAY/Set data type/Words
  714.     dc.w    $011F    ; SYMBOLS/MenuItem flags
  715.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  716.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  717.     dc.w    $830A    ; CURSOR/Relative/Next line * 3
  718.     dc.w    $0017    ; DISPLAY/Set data type/Bytes
  719.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  720.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  721.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  722.     dc.w    $0014    ; DISPLAY/Set data type/Words
  723.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  724.     dc.w    $0042    ; LABELS/Edit single/Full-line comment
  725.     dc.w    (2$-1$)
  726.  
  727. 1$    dc.b    ';',0,1
  728.     cnop    0,2
  729.  
  730. 2$    dc.w    $8409    ; CURSOR/Relative/Previous line * 4
  731.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  732.     dc.w    $8809    ; CURSOR/Relative/Previous line * 8
  733.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  734.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  735.     dc.w    $8109    ; CURSOR/Relative/Previous line * 1
  736.     dc.w    $0040    ; CURSOR/Absolute/Forward reference
  737.     dc.w    0    ; reserved
  738. macroend27:
  739. ************************************************************************
  740. ;After disassembly, and if there are no extraneous labels, position the
  741. ;start of the structure on the cursor line, and execute this macro to get
  742. ;a symbolic (old style) Gadget structure.
  743.  
  744.     dc.l    28    ; Macro number 28
  745.     dc.l    macroend28-macrostart28
  746.  
  747. macnamestart28    dc.b    'Gadget                  '
  748.     ifgt    24-(*-macnamestart28)
  749.     dcb.b    24-(*-macnamestart28),0
  750.     endc
  751.  
  752. macrostart28    dc.w    $001F    ; LABELS/Create single/Full-line comment
  753.     dc.w    (2$-1$)
  754.  
  755. 1$    dc.b    ';',0,1
  756.     cnop    0,2
  757.  
  758. 2$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  759.     dc.w    $0014    ; DISPLAY/Set data type/Words
  760.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  761.     dc.w    $0014    ; DISPLAY/Set data type/Words
  762.     dc.w    $010E    ; SYMBOLS/Gadget flags
  763.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  764.     dc.w    $010D    ; SYMBOLS/Gadget activation
  765.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  766.     dc.w    $010F    ; SYMBOLS/Gadget types
  767.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  768.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  769.     dc.w    $850A    ; CURSOR/Relative/Next line * 5
  770.     dc.w    $0014    ; DISPLAY/Set data type/Words
  771.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  772.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  773.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  774.     dc.w    $8D09    ; CURSOR/Relative/Previous line * $0D
  775.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  776.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  777.     dc.w    $8109    ; CURSOR/Relative/Previous line * 1
  778.     dc.w    $0040    ; CURSOR/Absolute/Forward reference
  779.     dc.w    0    ; reserved
  780. macroend28:
  781. ************************************************************************
  782. ;After disassembly, and if there are no extraneous labels, position the
  783. ;start of the structure on the cursor line, and execute this macro to get
  784. ;a symbolic Image structure.
  785.  
  786.     dc.l    29    ; Macro number 29
  787.     dc.l    macroend29-macrostart29
  788.  
  789. macnamestart29    dc.b    'Image                   '
  790.     ifgt    24-(*-macnamestart29)
  791.     dcb.b    24-(*-macnamestart29),0
  792.     endc
  793.  
  794. macrostart29    dc.w    $0014    ; DISPLAY/Set data type/Words
  795.     dc.w    $850A    ; CURSOR/Relative/Next line * 5
  796.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  797.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  798.     dc.w    $0017    ; DISPLAY/Set data type/Bytes
  799.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  800.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  801.     dc.w    $8209    ; CURSOR/Relative/Previous line * 2
  802.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  803.     dc.w    $8609    ; CURSOR/Relative/Previous line * 6
  804.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  805.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  806.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  807.     dc.w    $0042    ; LABELS/Edit single/Full-line comment
  808.     dc.w    (2$-1$)
  809.  
  810. 1$    dc.b    ';',0,1
  811.     cnop    0,2
  812.  
  813. 2$    dc.w    0    ; reserved
  814. macroend29:
  815. ************************************************************************
  816. ;After disassembly, and if there are no extraneous labels, position the
  817. ;start of the structure on the cursor line, and execute this macro to get
  818. ;a symbolic Border structure.
  819.  
  820.     dc.l    30    ; Macro number 30
  821.     dc.l    macroend30-macrostart30
  822.  
  823. macnamestart30    dc.b    'Border                  '
  824.     ifgt    24-(*-macnamestart30)
  825.     dcb.b    24-(*-macnamestart30),0
  826.     endc
  827.  
  828. macrostart30    dc.w    $0014    ; DISPLAY/Set data type/Words
  829.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  830.     dc.w    $0017    ; DISPLAY/Set data type/Bytes
  831.     dc.w    $840A    ; CURSOR/Relative/Next line * 4
  832.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  833.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  834.     dc.w    $0042    ; LABELS/Edit single/Full-line comment
  835.     dc.w    (2$-1$)
  836.  
  837. 1$    dc.b    ';',0,1
  838.     cnop    0,2
  839.  
  840. 2$    dc.w    $8609    ; CURSOR/Relative/Previous line * 6
  841.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  842.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  843.     dc.w    $8209    ; CURSOR/Relative/Previous line * 2
  844.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  845.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  846.     dc.w    0    ; reserved
  847. macroend30:
  848. ************************************************************************
  849. *                ---==== End of Intuition Macros ====---               *
  850. ************************************************************************
  851. ;When disassembling ILBM (and related) data, it is often easier to see what
  852. ;is going on if it is not just a jumble of bytes, words or longwords.
  853. ;This macro will convert a "CMAP" color table to orderly data; 3 bytes per
  854. ;line.
  855. ;Position the 1st entry (just past the size longword) on the cursor line, and
  856. ;execute this macro.  Continue (repeat macro or press the spacebar) until all
  857. ;entrys are done.
  858. ;Don't go over onto the next data chunk.  Undoing what this macro does is a
  859. ;pain.
  860.  
  861.     dc.l    39    ; Macro number 39
  862.     dc.l    macroend39-macrostart39
  863.  
  864. macnamestart39    dc.b    'Make CMAP (1 entry)','     '
  865.     ifgt    24-(*-macnamestart39)
  866.     dcb.b    24-(*-macnamestart39),0
  867.     endc
  868.  
  869. macrostart39    dc.w    $0017    ; DISPLAY/Set data type/Bytes
  870.     dc.w    $830A    ; CURSOR/Relative/Next line * 3
  871.     dc.w    $0017    ; DISPLAY/Set data type/Bytes
  872.     dc.w    $8309    ; CURSOR/Relative/Previous line * 3
  873.     dc.w    $02C4    ; DISPLAY 2/Mult constants override/Set
  874.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  875.     dc.w    0    ; reserved
  876. macroend39:
  877. ************************************************************************
  878. ;Put any floppy disk installed under V36 or later, OFS or FFS, into DF0: and
  879. ;excute this macro to see a commented disassembly of the boot sector.
  880.  
  881.     dc.l    54    ; Macro number 54
  882.     dc.l    macroend54-macrostart54
  883.  
  884. macnamestart54    dc.b    'Disassemble BOOT sector '
  885.     ifgt    24-(*-macnamestart54)
  886.     dcb.b    24-(*-macnamestart54),0
  887.     endc
  888.  
  889. macrostart54    dc.w    $01A4    ; MACROS 1/Execution speed/Very slow
  890.     dc.w    $0273    ; PROJECT/Read tracks
  891.     dc.w    (2$-1$)
  892.  
  893. 1$    dc.b    'df0: 0 0 2',0,1
  894.     cnop    0,2
  895.  
  896. 2$    dc.w    $000B    ; DISPLAY/Set data type/ASCII
  897.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  898.     dc.w    $0013    ; DISPLAY/Set data type/Longs
  899.     dc.w    $820A    ; CURSOR/Relative/Next line * 2
  900.     dc.w    $000E    ; DISPLAY/Set data type/Code
  901.     dc.w    $8309    ; CURSOR/Relative/Previous line * 3
  902.     dc.w    $001F    ; LABELS/Create single/Full-line comment
  903.     dc.w    (4$-3$)
  904.  
  905. 3$    dc.b    'The 1st longword of a bootblock is "DOS" followed by hex 0',0,1
  906.     cnop    0,2
  907.  
  908. 4$    dc.w    $001F    ; LABELS/Create single/Full-line comment
  909.     dc.w    (6$-5$)
  910.  
  911. 5$    dc.b    'or hex 1, if formatted using FastFileSystem.',0,1
  912.     cnop    0,2
  913.  
  914. 6$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  915.     dc.w    $001F    ; LABELS/Create single/Full-line comment
  916.     dc.w    (8$-7$)
  917.  
  918. 7$    dc.b    'The 2nd longword of a bootblock is the block checksum.',0,1
  919.     cnop    0,2
  920.  
  921. 8$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  922.     dc.w    $001F    ; LABELS/Create single/Full-line comment
  923.     dc.w    (10$-9$)
  924.  
  925. 9$    dc.b    'The 3rd longword of a bootblock is the location of the root block.',0,1
  926.     cnop    0,2
  927.  
  928. 10$    dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  929.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  930.     dc.w    $0034    ; LABELS/Create single/Label - fwd ref
  931.     dc.w    $0040    ; CURSOR/Absolute/Forward reference
  932.     dc.w    $001D    ; LABELS/Create single/Label
  933.     dc.w    (12$-11$)
  934.  
  935. 11$    dc.b    'ExpansionName',0,1
  936.     cnop    0,2
  937.  
  938. 12$    dc.w    $003F    ; CURSOR/Absolute/Previous location
  939.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  940.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  941.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  942.     dc.w    (14$-13$)
  943.  
  944. 13$    dc.b    'V2.04 or better',0,1
  945.     cnop    0,2
  946.  
  947. 14$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  948.     dc.w    $008C    ; SYMBOLS/Offsets/Exec
  949.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  950.     dc.w    (16$-15$)
  951.  
  952. 15$    dc.b    'Open the expansion library',0,1
  953.     cnop    0,2
  954.  
  955. 16$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  956.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  957.     dc.w    (18$-17$)
  958.  
  959. 17$    dc.b    'Did it open OK?',0,1
  960.     cnop    0,2
  961.  
  962. 18$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  963.     dc.w    $0034    ; LABELS/Create single/Label - fwd ref
  964.     dc.w    $0040    ; CURSOR/Absolute/Forward reference
  965.     dc.w    $001D    ; LABELS/Create single/Label
  966.     dc.w    (20$-19$)
  967.  
  968. 19$    dc.b    '1$',0,1
  969.     cnop    0,2
  970. 20$
  971.     dc.w    $003F    ; CURSOR/Absolute/Previous location
  972.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  973.     dc.w    (22$-21$)
  974.  
  975. 21$    dc.b    'Branch if no',0,1
  976.     cnop    0,2
  977.  
  978. 22$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  979.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  980.     dc.w    (24$-23$)
  981.  
  982. 23$    dc.b    'Move base into an address reg',0,1
  983.     cnop    0,2
  984.  
  985. 24$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  986.     dc.w    $05BE    ; SYMBOLS/eb_Flags bitdefs
  987.     dc.w    $0051    ; SYMBOLS/Select field/Second
  988.     dc.w    $008D    ; SYMBOLS/Offsets/Expansion
  989.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  990.     dc.w    (26$-25$)
  991.  
  992. 25$    dc.b    'Special kludge',0,1
  993.     cnop    0,2
  994.  
  995. 26$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  996.     dc.w    $008C    ; SYMBOLS/Offsets/Exec
  997.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  998.     dc.w    (28$-27$)
  999.  
  1000. 27$    dc.b    'Close expansion library',0,1
  1001.     cnop    0,2
  1002.  
  1003. 28$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1004.     dc.w    $0034    ; LABELS/Create single/Label - fwd ref
  1005.     dc.w    $0040    ; CURSOR/Absolute/Forward reference
  1006.     dc.w    $001D    ; LABELS/Create single/Label
  1007.     dc.w    (30$-29$)
  1008.  
  1009. 29$    dc.b    'DosName',0,1
  1010.     cnop    0,2
  1011.  
  1012. 30$    dc.w    $003F    ; CURSOR/Absolute/Previous location
  1013.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1014.     dc.w    $008C    ; SYMBOLS/Offsets/Exec
  1015.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  1016.     dc.w    (32$-31$)
  1017.  
  1018. 31$    dc.b    'Find resident tag',0,1
  1019.     cnop    0,2
  1020.  
  1021. 32$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1022.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  1023.     dc.w    (34$-33$)
  1024.  
  1025. 33$    dc.b    'Did we find it?',0,1
  1026.     cnop    0,2
  1027.  
  1028. 34$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1029.     dc.w    $0034    ; LABELS/Create single/Label - fwd ref
  1030.     dc.w    $0040    ; CURSOR/Absolute/Forward reference
  1031.     dc.w    $001D    ; LABELS/Create single/Label
  1032.     dc.w    (36$-35$)
  1033. 35$
  1034.     dc.b    '2$',0,1
  1035.     cnop    0,2
  1036.  
  1037. 36$    dc.w    $003F    ; CURSOR/Absolute/Previous location
  1038.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  1039.     dc.w    (38$-37$)
  1040.  
  1041. 37$    dc.b    'Branch if no',0,1
  1042.     cnop    0,2
  1043.  
  1044. 38$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1045.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  1046.     dc.w    (40$-39$)
  1047.  
  1048. 39$    dc.b    'Move tag into an address reg',0,1
  1049.     cnop    0,2
  1050.  
  1051. 40$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1052.     dc.w    $00D8    ; SYMBOLS/ResidentTag
  1053.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  1054.     dc.w    (42$-41$)
  1055.  
  1056. 41$    dc.b    'Get address of init routine in A0',0,1
  1057.     cnop    0,2
  1058.  
  1059. 42$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1060.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  1061.     dc.w    (44$-43$)
  1062.  
  1063. 43$    dc.b    'Indicate success!',0,1
  1064.     cnop    0,2
  1065.  
  1066. 44$    dc.w    $0186    ; CURSOR/Relative/Next label
  1067.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  1068.     dc.w    (46$-45$)
  1069.  
  1070. 45$    dc.b    'Indicate failure ;^(',0,1
  1071.     cnop    0,2
  1072.  
  1073. 46$    dc.w    $0186    ; CURSOR/Relative/Next label
  1074.     dc.w    $0186    ; CURSOR/Relative/Next label
  1075.     dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1076.     dc.w    $02C2    ; DISPLAY 2/DCB override/Set
  1077.     dc.w    $0017    ; DISPLAY/Set data type/Bytes
  1078.     dc.w    $005C    ; DISPLAY/Set Numeric base/Decimal
  1079.     dc.w    $001E    ; LABELS/Create single/End-of-line comment
  1080.     dc.w    (48$-47$)
  1081.  
  1082. 47$    dc.b    'Not used for normal bootblock',0,1
  1083.     cnop    0,2
  1084.  
  1085. 48$    dc.w    $001F    ; LABELS/Create single/Full-line comment
  1086.     dc.w    (50$-49$)
  1087.  
  1088. 49$    dc.b    ';',0,1
  1089.     cnop    0,2
  1090.  
  1091. 50$    dc.w    $0015    ; CURSOR/Absolute/Start of file
  1092.     dc.w    0    ; reserved
  1093. macroend54:
  1094. ************************************************************************
  1095. ;This macro removes repeats from the RS.KeyTable file.
  1096. ;We don't think that executing this macro is particularly useful, or even a
  1097. ;good idea, but thought that many people would be interested in seeing the
  1098. ;kind of useful file transformations that may be done with ReSource macros.
  1099. ;If you do execute this macro, back up your RS.KeyTable file first!
  1100.  
  1101.     dc.l    55    ; Macro number 55
  1102.     dc.l    macroend55-macrostart55
  1103.  
  1104. macnamestart55    dc.b    'Remove KT Repeats       '
  1105.     ifgt    24-(*-macnamestart55)
  1106.     dcb.b    24-(*-macnamestart55),0
  1107.     endc
  1108.  
  1109. macrostart55    dc.w    $003C    ; PROJECT/Open load file
  1110.     dc.w    (2$-1$)
  1111.  
  1112. 1$    dc.b    'RS.keytable',0,1
  1113.     cnop    0,2
  1114.  
  1115. 2$    dc.w    $0014    ; DISPLAY/Set data type/Words
  1116.     dc.w    $0035    ; reserved
  1117.     dc.w    $0247    ; MACROS 1/Set macro label/#1
  1118.     dc.w    $7FA1    ; MACROS 1/Set macro label/#1
  1119.     dc.w    $020E    ; STRINGS/Get/Symbol value
  1120.     dc.w    $7FFD    ; MACROS 1/Directives/Start conditional
  1121.     dc.w    $0258    ; STRINGS/Maths functions/Logical AND
  1122.     dc.w    (4$-3$)
  1123.  
  1124. 3$    dc.b    '$7FFF',0,1
  1125.     cnop    0,2
  1126.  
  1127. 4$    dc.w    $7FFE    ; MACROS 1/Directives/End conditional
  1128.     dc.w    $0226    ; */Zap
  1129.     dc.w    (6$-5$)
  1130.  
  1131. 5$    dc.b    $1B,$1B,0,1
  1132.     cnop    0,2
  1133.  
  1134. 6$    dc.w    $810A    ; CURSOR/Relative/Next line * 1
  1135.     dc.w    $0251    ; MACROS 1/Previous macro label/#1
  1136.     dc.w    0    ; reserved
  1137. macroend55:
  1138. ************************************************************************
  1139. ;This macro will send the assembly output file from ReSource to PRT: just
  1140. ;as though you had selected "SAVE/Save .asm/All".
  1141.  
  1142.     dc.l    56    ; Macro number 56
  1143.     dc.l    macroend56-macrostart56
  1144.  
  1145. macnamestart56    dc.b    'Print current file      '
  1146.     ifgt    24-(*-macnamestart56)
  1147.     dcb.b    24-(*-macnamestart56),0
  1148.     endc
  1149.  
  1150. macrostart56    dc.w    $004C    ; SAVE/Tabs/Spaces
  1151.     dc.w    $0279    ; STRINGS/Get/Filename
  1152.     dc.w    $0207    ; STRINGS/Edit functions/Prepend
  1153.     dc.w    (2$-1$)
  1154.  
  1155. 1$    dc.b    'echo > prt: ',$27,0,1
  1156.     cnop    0,2
  1157.  
  1158. 2$    dc.w    $0208    ; STRINGS/Edit functions/Append
  1159.     dc.w    (4$-3$)
  1160.  
  1161. 3$    dc.b    $27,0,1
  1162.     cnop    0,2
  1163.  
  1164. 4$    dc.w    $01C9    ; */DOS command
  1165.     dc.w    (6$-5$)
  1166.  
  1167. 5$    dc.b    $1B,$1B,0,1
  1168.     cnop    0,2
  1169.  
  1170. 6$    dc.w    $01C9    ; */DOS command
  1171.     dc.w    (8$-7$)
  1172.  
  1173. 7$    dc.b    'date > prt:',0,1
  1174.     cnop    0,2
  1175.  
  1176. 8$    dc.w    $01C9    ; */DOS command
  1177.     dc.w    (10$-9$)
  1178.  
  1179. 9$    dc.b    'echo > prt: " "',0,1
  1180.     cnop    0,2
  1181.  
  1182. 10$    dc.w    $0018    ; SAVE/Save .asm/All
  1183.     dc.w    (12$-11$)
  1184.  
  1185. 11$    dc.b    'prt:',0,1
  1186.     cnop    0,2
  1187.  
  1188. 12$    dc.w    $01C9    ; */DOS command
  1189.     dc.w    (14$-13$)
  1190.  
  1191. 13$    dc.b    'echo > prt: "',$0C,'"',0,1
  1192.     cnop    0,2
  1193.  
  1194. 14$    dc.w    $004B    ; SAVE/Tabs/Real tabs
  1195.     dc.w    0    ; reserved
  1196. macroend56:
  1197. ************************************************************************
  1198. *              ---==== End of Miscellaneous Macros ====---             *
  1199. ************************************************************************
  1200.  
  1201.     end
  1202.