home *** CD-ROM | disk | FTP | other *** search
/ Club Amiga de Montreal - CAM / CAM_CD_1.iso / files / 289.lha / Resource_v3.20 / Manual.doc < prev    next >
Encoding:
Text File  |  1989-10-07  |  160.4 KB  |  3,438 lines

  1. This document constitutes the DEMO VERSION of the current user  documentation
  2. as of the time it was edited.  The Puzzle Factory, Inc. reserves the right to
  3. update  this  document  without  notice.   The  only differences between this
  4. document and the commercial manual are the lack of page numbers, and  differ-
  5. ent section headings.  Tabs are set every 8 characters. - JL
  6. -----------------------------------------------------------------------------
  7.  
  8.  
  9.             ReSource(tm) Reference Manual V2.0
  10.  
  11.             For ReSource(tm) V3.20 and later
  12.  
  13.  
  14.  
  15.     Intelligent Interactive Disassembler for Amiga® Programmers
  16.  
  17.  
  18.  
  19.             Copyright © 1988, 1989 by Glen McDiarmid
  20.                 All Rights Reserved.
  21.  
  22. Copyright Notice
  23.  
  24. ReSource(tm) software and documentation are copyright by Glen McDiarmid.   No
  25. part  of  the  software  or  documentation  may  be  reproduced, transmitted,
  26. translated into other languages, posted  to  a  network,  or  distributed  by
  27. electronic  or  other  means without the express permission of the author, or
  28. his agents.  You have the right to make one backup copy for archival purposes.
  29.  
  30.         *****************************************************************
  31.     * In an effort to minimize piracy, each  copy  of  ReSource(tm) *
  32.     * sold  is  individually  assembled and linked.  Complex macros *
  33.     * used  during  assembly  are  capable  of  creating  literally *
  34.     * billions of unique code combinations, making it easy to trace *
  35.     * any  illegal copies back to the original purchaser.  Software *
  36.     * thieves will be prosecuted to the full extent of the law.     *
  37.         *****************************************************************
  38.  
  39. Disclaimer
  40.  
  41. The Puzzle Factory, Inc. provides this program "as-is"  without  warranty  of
  42. any  kind,  either  expressed  or implied, including, but not limited to, the
  43. implied warranties of merchantability and fitness for a  particular  purpose.
  44. The  entire  risk as to the results and performance of the program is assumed
  45. by you.  Should the program prove defective, you (and not The Puzzle Factory,
  46. Inc.)   assume  the  entire  cost  of  all  necessary  servicing,  repair  or
  47. correction.  Further, The Puzzle Factory, Inc. does not warrant, guarantee or
  48. make  any  representation regarding the use of, or the results of the use of,
  49. the program in terms of correctness, accuracy, reliability,  currentness,  or
  50. otherwise; and you rely on the program and results solely at your own risk.
  51.  
  52. The material contained in this documentation is believed to be accurate,  but
  53. The  Puzzle  Factory,  Inc.  reserves the right to update the software and/or
  54. documentation without notice.
  55.  
  56. Distribution
  57.  
  58. ReSource software and documentation are available from:
  59.  
  60.         The Puzzle Factory, Inc.    Glen McDiarmid
  61.         P.O. Box 986            28 Marginson Street
  62.         Veneta, OR 97487        Ipswich, Queensland
  63.         U.S.A.                AUSTRALIA  4305
  64.         (503) 935-3709            (07) 812-2963
  65.  
  66. Update Policy
  67.  
  68. Our update policy is very simple:  For updates  within  a  version  (revision
  69. changes only), we simply ask that you return your original ReSource disk.  If
  70. you  provide  postage  and  a return mailer, we will return it free of charge
  71. with the latest revision of the software.  Otherwise, there will be a  charge
  72. for media and shipping.
  73.  
  74. For major updates, a nominal fee will be  charged.   Please  contact  us  for
  75. instructions on how to get the latest version.
  76.  
  77. Trademarks
  78.  
  79. Amiga Includes Version 1.3
  80. Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  81. All Rights Reserved.
  82.  
  83. Amiga, AmigaDOS, Kickstart, Intuition, and Workbench are trademarks of
  84. Commodore-Amiga, Inc.
  85.  
  86. C.A.P.E. 68K, and C.A.P.E. are trademarks of Inovatronics, Inc.
  87.  
  88. FastFonts © by MicroSmiths, Blitzfonts © by Hayes Haugen.
  89.  
  90. Table Of Contents
  91.  
  92. Introduction                        xx
  93. Getting Started                    xx
  94.    System Requirements                 xx
  95.    The Command Line                    xx
  96.  
  97. Part 1.  Tutorial                    xx
  98.     1. About the User Interface            xx
  99.     2. Definition of the Current Line          xx
  100.     3. Disassembling a Program             xx
  101.     4. About Menus                    xx
  102.     5. About Keys                    xx
  103.     6. About the Mouse                 xx
  104.     7. About Load Files                xx
  105.     8. About Data Files                xx
  106.     9. About Output                    xx
  107.    10. About Symbols                    xx
  108.    11. Display Preferences                xx
  109.    12. About Searches                  xx
  110.    13. ARP and Wildcards                xx
  111.  
  112. Part 2.  Reference                    xx
  113.    1. PROJECT MENU                    xx
  114.      1. Abort                    xx
  115.      2. Open load file                xx
  116.      3. Open binary file                xx
  117.      4. Restore file                xx
  118.      5. Dismble memory                xx
  119.      6. Read tracks                 xx
  120.      7. O'lay binary image              xx
  121.      8. Save .RS                    xx
  122.      9. About                    xx
  123.     10. Quit                    xx
  124.  
  125.    2. DISPLAY MENU                    xx
  126.      1. Hiliting (menu)                xx
  127.          1. None                    xx
  128.          2. BSS hunks                xx
  129.          3. DATA hunks                xx
  130.          4. CODE hunks                xx
  131.          5. CHIP LOAD hunks             xx
  132.          6. FAST LOAD hunks             xx
  133.          7. Reloc32                 xx
  134.          8. Symbol scan                xx
  135.          9. Data type uncertain            xx
  136.         10. Data type known             xx
  137.         11. Internally produced refs        xx
  138.         12. Uninitialized data            xx
  139.         13. Optimize override            xx
  140.         14. DCB override                xx
  141.         15. Optimizations                xx
  142.         16. Symbols                    xx
  143.      2. Set data type (menu)            xx
  144.      3. Set numeric base (menu)            xx
  145.      4. Decimal conversion (menu)            xx
  146.      5. Blank lines (menu)              xx
  147.      6. Cursor address (menu)            xx
  148.          1. Relative                xx
  149.          2. Absolute                xx
  150.      7. Titlebar info (menu)            xx
  151.          1. Filename                xx
  152.          2. Attributes                xx
  153.          3. Accumulator                xx
  154.      8. Wrap                    xx
  155.      9. Block-fill                  xx
  156.     10. Fill-in data types              xx
  157.     11. Fill-in D/T Fwd                xx
  158.     12. Set counter                 xx
  159.     13. Reset counter                xx
  160.     14. Flip case - code                xx
  161.     15. Flip case - data                xx
  162.  
  163.    3. DISPLAY2 MENU                    xx
  164.      1. DCB override (Menu)                xx
  165.  
  166.    4. SYMBOLS1 MENU                    xx
  167.      1. Set Source/dest (Menu)            xx
  168.      2. Object (Menu)                xx
  169.  
  170.    5. SYMBOLS2 MENU                    xx
  171.  
  172.    6. OPTIMIZATION MENU                xx
  173.      1. Local override (Menu)            xx
  174.      2. Branches (Menu)                xx
  175.  
  176.    7. CURSOR MENU                    xx
  177.      1. Remember                    xx
  178.      2. Clear loc stack                xx
  179.      3. Relative (Menu)                xx
  180.          1. Next byte                xx
  181.          2. Previous byte                xx
  182.          3. Next line                xx
  183.          4. Previous line                xx
  184.          5. Next label                xx
  185.          6. Previous label              xx
  186.          7. Next symbol                xx
  187.          8. Previous symbol             xx
  188.          9. Next section                xx
  189.         10. Previous section            xx
  190.         11. Next reloc32                xx
  191.         12. Previous reloc32            xx
  192.         13. Next page                xx
  193.         14. Previous page                xx
  194.         15. Skip forward                xx
  195.         16. Skip backward                xx
  196.         17. Next unparsed code            xx
  197.         18. Next D/T change             xx
  198.         19. Previous D/T change            xx
  199.         20. Next uncertain D/T            xx
  200.         21. Next backward reference         xx
  201.         22. Next hilite                xx
  202.      4. Absolute (Menu)                xx
  203.          1. End of file                xx
  204.          2. Start of file                xx
  205.          3. Forward reference            xx
  206.          4. Second forward reference        xx
  207.          5. Backward reference            xx
  208.          6. Previous location            xx
  209.          7. Specify offset              xx
  210.          8. Specify label                xx
  211.          9. Specify symbol              xx
  212.         10. Specify percentage            xx
  213.      5. Copy (Menu)                 xx
  214.      6. Paste (Menu)                xx
  215.      7. Swap (Menu)                 xx
  216.      8. Scrolling speed (Menu)            xx
  217.      9. Normal search (Menu)            xx
  218.          1. Set search string            xx
  219.          2. Find next occurrence            xx
  220.          3. Find previous occurrence        xx
  221.          4. Find nearest occurrence         xx
  222.          5. Search this line            xx
  223.          6. Search accumulator            xx
  224.     10. Pattern search (Menu)            xx
  225.  
  226.    8. LABELS MENU                    xx
  227.      1. Create single (Menu)            xx
  228.          1. End-of-line comment            xx
  229.          2. Full-line comment            xx
  230.          3. Label                    xx
  231.          4. Label - fwd ref             xx
  232.          5. Symbol                  xx
  233.          6. Symbol - dest                xx
  234.      2. Edit single (Menu)              xx
  235.      3. Replace single (Menu)            xx
  236.          1. Label                    xx
  237.      4. Remove single (Menu)            xx
  238.          1. Label                    xx
  239.          2. Symbol                  xx
  240.          3. End-of-line comment            xx
  241.          4. Full-line comment            xx
  242.          5. All                    xx
  243.      5. Create multiple (Menu)            xx
  244.          1. Reloc32                 xx
  245.          2. All                    xx
  246.  
  247.    9. LOCAL MACROS MENU                xx
  248.  
  249.   10. GLOBAL MACROS MENU                xx
  250.  
  251.   11. STRINGS MENU                    xx
  252.      1. Get (Menu)                  xx
  253.          1. Label                    xx
  254.          2. Symbol                  xx
  255.          3. Symbol - dest                xx
  256.          4. Symbol value                xx
  257.          5. Symbol value - dest            xx
  258.          6. End-of-line comment            xx
  259.          7. Full-line comment            xx
  260.          8. Search string                xx
  261.          9. Filename                xx
  262.         10. Save .asm name              xx
  263.         11. Save .RS name                xx
  264.         12. Macros filename             xx
  265.         13. Keytable filename            xx
  266.         14. Cursor longword             xx
  267.         15. Cursor offset                xx
  268.         16. Accumulator length            xx
  269.         17. Partial save size            xx
  270.         18. File                    xx
  271.         19. Attribute bits              xx
  272.      2. Put (Menu)                    xx
  273.          1. Label                    xx
  274.          2. Attributes                xx
  275.          3. Base register                xx
  276.      3. Edit functions (Menu)            xx
  277.          1. Clip start                xx
  278.          2. Clip end                xx
  279.          3. Prepend                 xx
  280.          4. Append                  xx
  281.          5. Reverse                 xx
  282.          6. Lower case                xx
  283.      4. Operand size (Menu)             xx
  284.      5. Accumulator (Menu)              xx
  285.      6. Maths functions (Menu)            xx
  286.          1. Increment                xx
  287.          2. Decrement                xx
  288.          3. Add                    xx
  289.          4. Subtract                xx
  290.          5. Multiply                xx
  291.          6. Divide                  xx
  292.          7. Negate                  xx
  293.          8. Logical NOT                xx
  294.          9. Logical AND                xx
  295.         10. Logical OR                xx
  296.         11. Exclusive OR                xx
  297.         12. ROR                    xx
  298.         13. ROL                    xx
  299.      7. Define string (Menu)            xx
  300.      8. Swap with buffer (Menu)            xx
  301.      9. Input buffer (Menu)             xx
  302.     10. Output buffer (Menu)            xx
  303.    
  304.    12. SPECIAL FUNCTIONS MENU              xx
  305.      1. Repeat last command             xx
  306.      2. Dos Command                 xx
  307.      3. Zap                     xx
  308.      4. Screen (Menu)                xx
  309.      5. Set task priority                xx
  310.      6. Origin (Menu)                xx
  311.      7. Convert xx(An) EA's (Menu)          xx
  312.          1. Disable                    xx
  313.      8. Specify Base Register (Menu)        xx 
  314.      9. Convert specific EA's (Menu)        xx 
  315.     10. Data type set (Menu)            xx
  316.     11. Convert to.. (Menu)             xx
  317.     12. Reloc32 (Menu)                xx
  318.  
  319.    13. SAVE MENU                    xx
  320.      1. O/P Directory                xx
  321.      2. Partial save (Menu)             xx
  322.          1. Reset start                xx
  323.          2. Set start                xx
  324.          3. Set end                 xx
  325.          4. Reset end                xx
  326.      3. Save binary image (Menu)            xx
  327.      4. Save .asm (Menu)                xx
  328.      5. Calculate .asm size (Menu)          xx
  329.          1. All                    xx
  330.          2. Partial                 xx
  331.      6. Save to memory (Menu)            xx
  332.      7. Save tracks (Menu)              xx
  333.      8. Save screen                    xx
  334.      9. Tabs (Menu)                 xx
  335.     10. Symbol table (Menu)             xx
  336.  
  337.    14. OPTIONS1 MENU                    xx
  338.      1. Show offsets (Menu)             xx
  339.      2. Display beep (Menu)             xx
  340.      3. User feedback (Menu)            xx
  341.      4. Feedback Delays (Menu)            xx
  342.      5. Labels (Menu)                xx
  343.      6. Hidden labels (Menu)            xx
  344.      7. Symbols (Menu)                xx
  345.      8. End-of-line comments (Menu)         xx
  346.      9. Full-line comments (Menu)            xx
  347.     10. Chip-load info (Menu)            xx
  348.     11. Section statements (Menu)            xx
  349.     12. End statement (Menu)            xx
  350.     13. DCB statements (Menu)            xx
  351.     14. Reference recognition (Menu)        xx
  352.  
  353.    15. OPTIONS2 MENU                    xx
  354.      1. Short branches (Menu)            xx
  355.      2. Separate labels (Menu)            xx
  356.      3. Label colons (Menu)             xx
  357.      4. Leading zeroes (Menu)            xx
  358.      5. Assembler (Menu)                xx
  359.          1. Metacomco                xx
  360.          2. Cape                    xx
  361.          3. Capatch                    xx
  362.      6. Auto labels (Menu)                xx
  363.      7. Verbose saves (Menu)            xx
  364.      8. Multiple constants (Menu)            xx
  365.  
  366.    16. KEY BINDINGS MENU                xx
  367.  
  368.    17. Credits                     xx
  369.  
  370.  
  371. Introduction
  372.  
  373. ReSource was originally just an interactive disassembler, but  Version  3  is
  374. much  more than this.  Because ReSource can get its input from a file, track,
  375. or memory, and output all or part to any of these, it is more  of  a  general
  376. purpose  hacking  tool.  It can be used to browse through files, without ever
  377. bothering to save anything, just to find out what is inside.  It  also  knows
  378. quite a bit about AmigaDOS(TM) and the Amiga® OS.  This built-in intelligence
  379. will  save  you  a  great deal of time when disassembling files.  ReSource is
  380. also blindingly fast.  It is written entirely in assembly language, and  does
  381. all text rendering using its own special internal routines.
  382.  
  383. When you run ReSource, you can supply the name of the file  to  load  on  the
  384. command line:
  385.  
  386.         1> [run] ReSource c:popcli
  387.  
  388. If you do not specify something on the command line for ReSource to work  on,
  389. it  will  default to one longword of memory at location zero.  Alternatively,
  390. you can wait until ReSource starts running, and select a file using  the  ARP
  391. file  requester.   For  full  specifications  on command line parameters, see
  392. below.  Providing that there is enough memory available,  you  can  load  ANY
  393. file  into  ReSource.  If ReSource recognizes it as a load file (one that can
  394. be run; an executable program), it will load the  program,  and  perform  any
  395. necessary  relocation,  etc.,  as if the program is going to be actually run.
  396. If the file that you request loaded is not a load file,  it  will  be  loaded
  397. "as-is".   Load  files may be also loaded "as-is", by using the "Load binary"
  398. function, in the "PROJECT" menu.  This will give  you  access  to  the  hunk,
  399. symbol, relocation and debug information, which otherwise gets stripped  when
  400. the  program is loaded into memory.  Libraries, device drivers, and fonts are
  401. also load files,  which  means  that  you  can  disassemble  them,  save  the
  402. assembler source code, modify them, and re-assemble them.
  403.  
  404. Getting Started
  405.  
  406. If the version/revision of ReSource you have purchased  is  higher  than  the
  407. version  indicated  on  the  title  page  of  this  manual,  please  refer to
  408. "History.doc", an ASCII file on your  ReSource  disk  containing  incremental
  409. documentation.   A  "ReadMe"  file may also be present containing information
  410. about your particular release of ReSource.
  411.  
  412. System Requirements
  413. ReSource is designed to work on any properly  configured  Amiga®  500,  1000,
  414. 2000, or 2500.
  415.  
  416. Kickstart V1.2 or higher is required.
  417.  
  418. Because ReSource uses functions in the "ARP" library, you must have the  file
  419. "arp.library"  in your "LIBS:" directory when you run ReSource.  This file is
  420. supplied with the commercial version of ReSource, and is available from  most
  421. BBS's.  The version of "arp.library" must be 34 or higher.
  422.  
  423. While ReSource will run on a 512K Amiga®, you will be severely limited in the
  424. size of programs that you may disassemble.  One megabyte  of  RAM  should  be
  425. considered the minimum necessary to disassemble all but the smaller programs,
  426. and  you  will  need  1  1/2  to  2 megabytes of RAM if you want to work with
  427. programs larger than 30-40K.
  428.  
  429. To  make  the  best  use  of  the  menus,  run  FastFonts©,  or  Blitzfonts©.
  430. Otherwise,  scanning through the menus will be very sluggish due to the large
  431. number of sub-items.
  432.  
  433. The Command Line
  434. When you run ReSource from a  CLI,  you  can  supply  a  parameter,  so  that
  435. ReSource  gets  its  input right away.  The following parameters are accepted
  436. with the following meanings:
  437.  
  438.    1> ReSource ?
  439.        (Using "?" as the first parameter on the command line will display the
  440.     parameter syntax requirements, then exit immediately)
  441.  
  442.    1> ReSource <ProgName>
  443.     (The executable program <ProgName> will be loaded as a load file ONLY
  444.     if it is a load file.  Otherwise it will be loaded as a binary file.
  445.        Corrupted load files may have to be loaded as a binary image)
  446.  
  447.    1> ReSource *b <FileName>
  448.     (The file <FileName> will be loaded as a binary image)
  449.  
  450.    1> ReSource *m <Sloc> <Eloc>
  451.     (Load memory, from location <Sloc> to location <Eloc>)
  452.  
  453.    1> ReSource *DFn: <Scyl> <Ecyl+1> [#sec] [Offsec]
  454.     (Load from drive DFn: starting at cylinder <Scyl> and continuing to
  455.     <Ecyl+1>.  The default is to read complete track(s).  This may be
  456.     modified by the next two optional parameters:  The fourth parameter
  457.     specifies that ReSource should read [#sec] sectors, and the fifth
  458.     parameter specifies that these sectors should start at [Offsec]
  459.     sector.)
  460.  
  461.    1> ReSource *
  462.     (Kickstart(TM) as it appears in memory is loaded)
  463.  
  464.    ReSource will accept "-I" or "-i" as the first parameter  on  the  command
  465.    line.  This will force ReSource to use an interlaced screen.
  466.  
  467. Examine the following examples:
  468.  
  469.    1> ReSource c:popcli
  470.     (The program "popcli" will be loaded as a load file, from the C: device)
  471.  
  472.    1> ReSource libs:arp.library
  473.     (Load the file "arp.library", from the LIBS: device, as a load file)
  474.  
  475.    1> ReSource *b c:popcli
  476.     (The file "popcli" will be loaded as a binary image, from the C: device)
  477.  
  478.    1> ReSource *m $FC0000 $FD0000
  479.     (The first 64K of Kickstart(TM) will be loaded)
  480.  
  481.    1> ReSource *DF0: 0 0 2
  482.     (The boot sectors from DF0: will be loaded, a total of 1024 bytes.
  483.     Use this to check for/disassemble viruses)
  484.  
  485.    1> ReSource *DF1: 40 41
  486.     (The entire directory cylinder from DF1: will be loaded, 11K in all)
  487.  
  488.    1> ReSource *m $400 $800
  489.     (For most Amigas®, this will load the Exec library.  Some shells will
  490.     eat the "$" character.  If this is a problem, ReSource will treat the
  491.     "C" standard, "0x", as equivalent)
  492.  
  493.    1> ReSource *m 0 1
  494.     (Load one byte of memory, at location zero)
  495.  
  496. ReSource may be "Run" without problem, and multitasks beautifully.  It will
  497. even allow you to change the task priority from inside ReSource.
  498.  
  499. Do not load ReSource from the Workbench(TM).
  500.  
  501.  
  502. Tutorial
  503. 1.1    About the User Interface
  504. Because of the large number of functions in ReSource, it was decided  to  use
  505. one-and  two-character menu names, so that more menus could be used.  Looking
  506. from the left, the first menu is "P", which stands for "PROJECT".   The  real
  507. menu  name  is  directly  under  the  one-or  two-character  name, in capital
  508. letters, so should be fairly easy to find.  In all future reference to menus,
  509. the full menu name will be used.
  510.  
  511. In the reference section, a heading ending with a ":"  refers to  the  lowest
  512. hierarchical  menu  item  for that function.  In some cases, the heading will
  513. end with a "/:"  to indicate that there are several  sub-items  with  related
  514. functions being discussed under that heading, e.g.:
  515.  
  516.     DISPLAY/Block-fill: Refers to a single item.
  517.     DISPLAY/Wrap/:      Refers to a group of sub-items.
  518.  
  519. Functions will be referenced by menu, rather than by key name.  For  example,
  520. the  "Quit"  function  will  be described as "PROJECT/Quit".  The function to
  521. restore the current file will be "PROJECT/Restore".  You will  find  both  of
  522. these  under  the  "PROJECT"  menu.   Functions  in  sub-menu  boxes  will be
  523. described in a similar way, e.g., "SAVE/Tabs/Spaces".  Because  any  key  can
  524. have any function bound to it (except "PROJECT/Abort"), key usage will not be
  525. discussed,  when  referencing  functions.   However, to make it easier to get
  526. started, some key bindings will be present, even without loading a  keytable.
  527. Note that loading a keytable may override these keybindings:
  528.  
  529.     up arrow        scroll up one line
  530.     down arrow        scroll down line line
  531.     shift-up arrow      page backward
  532.     shift-down arrow    page forward
  533.     right arrow        forward reference
  534.     left arrow        previous location
  535.     right-Amiga Q        quit
  536.     right-Amiga O        open a file
  537.  
  538. To rebind a key, select "KEY BINDINGS/Rebind key" from the  menus,  select  a
  539. function  from  the  menus to have bound, then press the key that you want it
  540. bound to.  You can overwrite key bindings if you want.  When done, you should
  541. save the keytable as "S:RS.keytable".  This can be  done  by  selecting  "KEY
  542. BINDINGS/Save"  from the menus.  Even both of these functions can be bound to
  543. a key, in fact the only function that is not practical to rebind is "PROJECT/
  544. Abort", which is always bound to right-Amiga A.
  545.  
  546. A sample keytable is provided for your use.  The key mapping used in the file
  547. is described in a file named "MyKeyBindings.doc".  Alternately, you  may  use
  548. the  supplied  program  "ShowKeys"  to  read  your S:RS.keytable at any time.
  549. ShowKeys may be used without parameters or it will accept the pathname  of  a
  550. keytable  as  an optional parameter.  You may want to redirect output to your
  551. printer for hardcopy.
  552.  
  553. 1.2    Definition of the Current Line
  554. Many functions in ReSource operate only on the current line.   Because  there
  555. is no real "cursor", it is necessary to define the "current line":
  556.  
  557. The "current line" is the top line, as you see it on ReSource's screen.
  558.  
  559. If there is a section statement (e.g., SECTION BSS) to be  displayed  at  the
  560. cursor  address,  this will be shown before any other text, and will force it
  561. to be shown on the next  line  down.   If  this  is  not  the  first  section
  562. statement  in  the  program, there will be an extra blank line, which will be
  563. shown before the section statement.  After the section statement, and  before
  564. the  rest  of  the  line,  one  or more "full-line comments" can be attached.
  565. Immediately after the cursor line, any "hidden  labels"  will  be  shown.   A
  566. hidden  label may also have a full-line comment attached, which will be shown
  567. immediately before it, but after the cursor line.  Note that in this example:
  568.  
  569.             SECTION prog000000,CODE    ; Section statement
  570.    ; This is a full line comment!
  571.    ; This is another full line comment!
  572.             MOVE.L  D1-D4/A2-A6,-(SP)    ; Line of code
  573.  
  574. all the above text is one line.  Whenever you scroll up or down a  line,  all
  575. parts  of  the  "current  line"  will scroll together.  To put it simply, the
  576. first "real" line of code or data in the window is the current line.
  577.  
  578. 1.3    Disassembling a Program
  579. To disassemble a program is to interpret what went into the program  to  make
  580. it work.  It can be a very complex and trying task, but with practice one can
  581. become quite adept at it.  There are many different and separate things to do
  582. when  disassembling.   One of the most important is to separate the code from
  583. the data.  There is only one part of a load file that  is  guaranteed  to  be
  584. code, and that is at the very start.
  585.  
  586. One very useful function of ReSource is its ability to scan  lines  of  code,
  587. looking  for  references  to  other  parts of the program being disassembled.
  588. When a reference is made, it creates a label at that address, which  will  be
  589. used in all future references to that part of the program.  More importantly,
  590. ReSource  can determine what type of data is being referenced, and be correct
  591. (almost) every time.  If you intend to  reassemble  the  source,  you  should
  592. still  verify  it before saving, as mistakes will occasionally occur.  Before
  593. ReSource makes a decision about what type of data  is  being  referenced,  it
  594. examines  many  different pieces of information that are available, including
  595. the actual instruction that made the reference.  There  are  a  few  ways  of
  596. getting  ReSource  to  scan  lines of code.  The simplest way is by using the
  597. "LABELS/Create single/Label - fwd ref".  This scans only  the  current  line,
  598. and does NOT advance the cursor.
  599.  
  600. If a line of code makes a reference to somewhere  within  the  program,  that
  601. HASN'T  got  a  label  yet,  it  will  be shown as some offset from the label
  602. "START", which is imagined to be (but is not actually, unless YOU  have  done
  603. it)  attached  to  the  first  byte of the program.  You could create a label
  604. called "START", at the first byte of the  program.   However,  when  you  re-
  605. assemble,  there  is a chance that some different length instructions will be
  606. generated.  This will make all references past  the  first  different  length
  607. instruction inaccurate.
  608.  
  609.  
  610. Another way to get ReSource to scan lines of code is with the  "LABELS/Create
  611. multiple/ALL".   This  function  scans  the  current  line.   If  ReSource is
  612. reasonably sure that it is code, it will scan the line, and move  on  to  the
  613. next line.  This process will repeat until either the end of the section,  or
  614. until  a non-conditional branch, unless immediately followed by certain code.
  615. After executing this function, if the cursor isn't at the end  of  file,  and
  616. there  is  more  code  that  hasn't been "scanned" yet, you can scroll to the
  617. start of the next block of code, or use "CURSOR/Relative/Next unparsed code",
  618. and execute this function again, repeating until all code in the program  has
  619. been  scanned.   At this point, most references within the program will be to
  620. labels, and not use the "START+$xxxx" type of reference.   To  make  sure  of
  621. this,  you  can  set  up  a  search  for "START+", and perhaps scan the lines
  622. individually.  A better way to do this is to use "SAVE/Calculate  .asm  size"
  623. and then use sucessive iterations of "CURSOR/Absolure/Previous location",  as
  624. a  number  of  error  types that will interfere with assembly are pushed onto
  625. the location stack by this function.  Note that the number of errors will  be
  626. limited by the size of the location stack: 256.
  627.  
  628. There is still another way to scan code, and it may  be  best  when  you  are
  629. first  starting  to  use  ReSource  and  haven't yet learned when to scan the
  630. entire program, and when not to.  First, make the top of the file the current
  631. line.  Then, hold down the left-Amiga key, and while also  holding  down  the
  632. left  mouse  button, scroll through the file until you come to the end.  This
  633. sequence calls the function "LABELS/Create single/Label - fwd ref" repeatedly
  634. and generates labels for all forward references within the file.
  635.  
  636. When all code in a program has been "scanned", the  next  function  that  you
  637. will  generally  want  to use is "DISPLAY/Fill-in data types".  This function
  638. does two passes over the entire program, and does NOT shift the cursor.   The
  639. first pass looks at what data types have been set, and makes some assumptions
  640. about all places in the program where the data type has not been specifically
  641. set.   When  you "Set data type", you are telling ReSource "this is CODE", or
  642. "this is ASCII", or "these are to be displayed as  bytes",  etc.   Generally,
  643. this  data  type  will be assumed from this byte forward, until the next byte
  644. that has had the data type specifically set.  Many conditions are tested when
  645. making decisions about what type of data is where.  Providing that  you  have
  646. "scanned"  all  code in the program, after executing the "Fill-in data types"
  647. function the resulting source code will look like source code should look.
  648.  
  649. "Fill-in data types" is used to let ReSource know how far back  to  go,  when
  650. scrolling  backwards.   String  lengths  are also determined.  When you first
  651. load in a file, all line lengths  are  set  to  two  bytes.   When  scrolling
  652. forward,  most  things  will  be  shown  properly  anyway,  but if you scroll
  653. backwards before first doing a "Fill-in data types", a jarring  display  will
  654. result.
  655.  
  656. At this point, if you output to a ".asm"  file,  it  will  probably  be  good
  657. enough  to  re-assemble.  However, most people will want to examine the file,
  658. and make it more readable, especially if the program needs  to  be  modified.
  659. An  excellent  place  to  start  is  by finding where any libraries are being
  660. opened, finding where the library base is being stored, and giving meaningful
  661. names to these data storage locations.  Assume that the following code  is  a
  662. small part of a program:
  663.  
  664.             MOVE.L  4,A6
  665.             LEA     START+$06B6(PC),A1
  666.             JSR     -$0198(A6)
  667.             MOVE.L  D0,START+$0C36
  668.             BNE.S   START+$06AE
  669.             MOVE.L  #$00038007,D7
  670.             JSR     -$006C(A6)
  671.             BRA.S   START+$06B2
  672.  
  673.             JSR     START+$0142
  674.             ADDQ.W  #8,SP
  675.             RTS
  676.  
  677.             BCC     START+$0727
  678.             ????
  679.             BGE     START+$0725
  680.             BHI     START+$0730
  681.             BSR     START+$0732
  682.             ????
  683.  
  684. After scanning all code in this program, it would look like this:
  685.  
  686.             MOVE.L  4,A6
  687.    lbC000694        LEA     doslib.MSG(PC),A1
  688.             JSR     -$0198(A6)
  689.             MOVE.L  D0,lbL000C36
  690.             BNE.S   lbC0006AE
  691.             MOVE.L  #$00038007,D7
  692.             JSR     -$006C(A6)
  693.             BRA.S   lbC0006B2
  694.  
  695.    lbC0006AE        JSR     lbC000142
  696.    lbC0006B2        ADDQ.W  #8,SP
  697.             RTS
  698.  
  699.    doslib.MSG      dc.b    'dos.library',0
  700.  
  701. The astute will have noticed that because the A6  register  was  loaded  from
  702. location  4,  it  will  point to the Exec library base.  Therefore, the third
  703. line of this block of code is a call to somewhere in the  Exec  library.   By
  704. scrolling so that this line becomes the top line on the screen, and selecting
  705. the "SYMBOLS 1/Libraries/Exec", our block of code will now look like this:
  706.  
  707.             MOVE.L  4,A6
  708.    lbC000694        LEA     doslib.MSG(PC),A1
  709.             JSR     _LVOOldOpenLibrary(A6)
  710.             MOVE.L  D0,lbL000C36
  711.             BNE.S   lbC0006AE
  712.             MOVE.L  #$00038007,D7
  713.             JSR     -$006C(A6)
  714.             BRA.S   lbC0006B2
  715.  
  716.    lbC0006AE        JSR     lbC000142
  717.    lbC0006B2        ADDQ.W  #8,SP
  718.             RTS
  719.  
  720.    doslib.MSG      dc.b    'dos.library',0
  721.  
  722. Checking the documentation for the "OldOpenLibrary" Exec call  will  tell  us
  723. that on return, the D0 register will contain the library base for the library
  724. just opened, if successful.  Because we know that it was the DOS library that
  725. was  opened, the label "lbL000C36" referenced on the fourth line could now be
  726. called "Dos_Base", instead of "lbL000C36":
  727.  
  728.             MOVE.L  4,A6
  729.    lbC000694        LEA     doslib.MSG(PC),A1
  730.             JSR     _LVOOldOpenLibrary(A6)
  731.             MOVE.L  D0,Dos_Base
  732.             BNE.S   lbC0006AE
  733.             MOVE.L  #$00038007,D7
  734.             JSR     -$006C(A6)
  735.             BRA.S   lbC0006B2
  736.  
  737.    lbC0006AE        JSR     lbC000142
  738.    lbC0006B2        ADDQ.W  #8,SP
  739.             RTS
  740.  
  741.    doslib.MSG      dc.b    'dos.library',0
  742.  
  743. If the D0 register DID contain a non-zero value, it means that  "dos.library"
  744. did  open  successfully,  and the following conditional branch WILL be taken.
  745. Where this branches to, is labeled "lbC0006AE".  A better name for this might
  746. be "OpenedOK".  Scroll so that the line "lbC0006AE JSR lbC000142" is  on  the
  747. top  line  of  the  display,  and  select "LABELS/Create single/Label".  When
  748. asked, type in "OpenedOK":
  749.  
  750.             MOVE.L  4,A6
  751.    lbC000694        LEA     doslib.MSG(PC),A1
  752.             JSR     _LVOOldOpenLibrary(A6)
  753.             MOVE.L  D0,Dos_Base
  754.             BNE.S   OpenedOK
  755.             MOVE.L  #$00038007,D7
  756.             JSR     -$006C(A6)
  757.             BRA.S   lbC0006B2
  758.  
  759.    OpenedOK        JSR     lbC000142
  760.    lbC0006B2        ADDQ.W  #8,SP
  761.             RTS
  762.  
  763.    doslib.MSG      dc.b    'dos.library',0
  764.  
  765. If the call to "OldOpenLibrary" was unsuccessful, the  branch  on  the  fifth
  766. line  would  NOT  be taken.  In this case, the D7 register is loaded with the
  767. value "$38007", and a call is made to the  subroutine  at  offset  -$6C  from
  768. where the A6 register is currently pointing.  We do know that the A6 register
  769. was  pointing  to the Exec library base before, and we also know that none of
  770. the code executed so far has destroyed the value in  A6,  so  we  can  safely
  771. assume  that  A6  still  points to Exec library base.  Hence, by scrolling so
  772. that the seventh line of this block is on the top line of  the  display,  and
  773. selecting "SYMBOLS 1/Libraries/Exec" again, our block will look like this:
  774.  
  775.             MOVE.L  4,A6
  776.    lbC000694        LEA     doslib.MSG(PC),A1
  777.             JSR     _LVOOldOpenLibrary(A6)
  778.             MOVE.L  D0,Dos_Base
  779.             BNE.S   OpenedOK
  780.             MOVE.L  #$00038007,D7
  781.             JSR     _LVOAlert(A6)
  782.             BRA.S   lbC0006B2
  783.  
  784.    OpenedOK        JSR     lbC000142
  785.    lbC0006B2        ADDQ.W  #8,SP
  786.             RTS
  787.  
  788.    doslib.MSG      dc.b    'dos.library',0
  789.  
  790. After reading the documentation for the Exec call "Alert", we find  out  that
  791. on entry, the D7 register should contain a number representing an alert code.
  792. By scrolling so the the line "MOVE.L #$00038007,D7" is on the top line of the
  793. display, and selecting "SYMBOLS 2/A-B/Alert codes", our block will  now  look
  794. like this:
  795.  
  796.             MOVE.L  4,A6
  797.    lbC000694        LEA     doslib.MSG(PC),A1
  798.             JSR     _LVOOldOpenLibrary(A6)
  799.             MOVE.L  D0,Dos_Base
  800.             BNE.S   OpenedOK
  801.             MOVE.L  #AT_Recovery!AG_OpenLib!AO_DOSLib,D7
  802.             JSR     _LVOAlert(A6)
  803.             BRA.S   lbC0006B2
  804.  
  805.    OpenedOK        JSR     lbC000142
  806.    lbC0006B2        ADDQ.W  #8,SP
  807.             RTS
  808.  
  809.    doslib.MSG      dc.b    'dos.library',0
  810.  
  811. Examining the include file "exec/alerts.i" will tell us that "AT_Recovery" is
  812. used for recoverable alerts, "AG_OpenLib" means  that  a  library  failed  to
  813. open, and "AO_DOSLib" tells us which library is in question.  Because this is
  814. a  recoverable  alert, the following line of code ("BRA.S lbC0006B2") WILL be
  815. executed, in which case we might change the label  "lbC0006B2"  to  something
  816. like  "DosDidntOpen",  or  "NoDosAvailable".  This is important, since if any
  817. other code in this program makes a reference to one of  the  labels  that  we
  818. have changed, it too will use the new name.  In this example, another part of
  819. the program that WAS:
  820.  
  821.    lbC0007DE        MOVE.L  4(SP),D1
  822.             MOVE.L  lbL000C36,A6
  823.             JMP     -$0024(A6)
  824.  
  825.    lbC0007EA        MOVE.L  D4,-(SP)
  826.             MOVEM.L 8(SP),D1-D4
  827.             MOVE.L  lbL000C36,A6
  828.             JSR     -$008A(A6)
  829.             MOVE.L  (SP)+,D4
  830.             RTS
  831.  
  832.    lbC0007FE        MOVE.L  4(SP),D1
  833.             MOVE.L  lbL000C36,A6
  834.             JMP     -$007E(A6)
  835.  
  836. now will be shown as:
  837.  
  838.    lbC0007DE        MOVE.L  4(SP),D1
  839.             MOVE.L  Dos_Base,A6
  840.             JMP     -$0024(A6)
  841.  
  842.    lbC0007EA        MOVE.L  D4,-(SP)
  843.             MOVEM.L 8(SP),D1-D4
  844.             MOVE.L  Dos_Base,A6
  845.             JSR     -$008A(A6)
  846.             MOVE.L  (SP)+,D4
  847.             RTS
  848.  
  849.    lbC0007FE        MOVE.L  4(SP),D1
  850.             MOVE.L  Dos_Base,A6
  851.             JMP     -$007E(A6)
  852.  
  853. After using "SYMBOLS 1/Libraries/Dos" a few times, it would become:
  854.  
  855.    lbC0007DE        MOVE.L  4(SP),D1
  856.             MOVE.L  Dos_Base,A6
  857.             JMP     _LVOClose(A6)
  858.  
  859.    lbC0007EA        MOVE.L  D4,-(SP)
  860.             MOVEM.L 8(SP),D1-D4
  861.             MOVE.L  Dos_Base,A6
  862.             JSR     _LVOCreateProc(A6)
  863.             MOVE.L  (SP)+,D4
  864.             RTS
  865.  
  866.    lbC0007FE        MOVE.L  4(SP),D1
  867.             MOVE.L  Dos_Base,A6
  868.             JMP     _LVOCurrentDir(A6)
  869.  
  870. To continue, we would replace a few labels:
  871.  
  872.    CloseSUB        MOVE.L  4(SP),D1
  873.             MOVE.L  Dos_Base,A6
  874.             JMP     _LVOClose(A6)
  875.  
  876.    CreatePrSUB     MOVE.L  D4,-(SP)
  877.             MOVEM.L 8(SP),D1-D4
  878.             MOVE.L  Dos_Base,A6
  879.             JSR     _LVOCreateProc(A6)
  880.             MOVE.L  (SP)+,D4
  881.             RTS
  882.  
  883.    CurDirSUB        MOVE.L  4(SP),D1
  884.             MOVE.L  Dos_Base,A6
  885.             JMP     _LVOCurrentDir(A6)
  886.  
  887. Okay, so far so good.  Now, where the line:
  888.  
  889.             JSR     lbC0007FE
  890.  
  891. used to be, it would be replaced by:
  892.  
  893.             JSR     CurDirSUB
  894.  
  895. This happens automatically, whenever you  replace  any  label.   The  process
  896. helps itself; starting is hardest, the rest come fairly easily.
  897.  
  898. In general, where a label is used, if you have any idea of what is  happening
  899. at  all,  you should replace it with a label that will remind you of what the
  900. code is doing.  It doesn't matter what name you use (as long as it is a legal
  901. label for the assembler that you plan to use); if necessary you  can  replace
  902. it  with  something  better  later  on.   Anything nominally mnemonic will be
  903. superior to a "shop" label while you're trying to understand the code.
  904.  
  905. One last point that needs to be covered briefly is the cursor location stack.
  906. When certain functions are called, or  whenever  YOU  want  to,  the  current
  907. cursor  loacation  may  be  pushed onto ReSource's location stack.  This will
  908. allow you to easily move around in code.  Returning to our  example  program,
  909. place  the  second  line,  at  label  lbC000694, on the cursor line, and then
  910. select "CURSOR/Absolute/Forward reference".  The last line will  move  up  to
  911. the  cursor line.  You can now use "LABELS/Create single/Label" to change the
  912. name "doslibrary.MSG" into something more meaningful,  like  "DosName".   Now
  913. use  "CURSOR/Absolute/Previous  location", and you will find yourself back at
  914. the second line of the file, with a new name for the first operand.  Normally
  915. you will just use the right-Arrow and left-Arrow keys for these two functions
  916. rather than using the menus.
  917.  
  918.             MOVE.L  4,A6
  919.    lbC000694        LEA     DosName(PC),A1
  920.             JSR     _LVOOldOpenLibrary(A6)
  921.             MOVE.L  D0,Dos_Base
  922.             BNE.S   OpenedOK
  923.             MOVE.L  #AT_Recovery!AG_OpenLib!AO_DOSLib,D7
  924.             JSR     _LVOAlert(A6)
  925.             BRA.S   NoDos
  926.  
  927.    OpenedOK        JSR     lbC000142
  928.    NoDos        ADDQ.W  #8,SP
  929.             RTS
  930.  
  931.    DosName        dc.b    'dos.library',0
  932.  
  933. 1.4    About Menus
  934. The menus in ReSource fully support drag-selecting, and  multiple  selection.
  935. Many  options  within  ReSource have a "checked" menu, which in most cases is
  936. "hot".  This means that even though ReSource may be busy doing something,  if
  937. you make a selection in the menus that effects the current operation, it will
  938. take  effect  IMMEDIATELY.   For  example,  while saving the source code to a
  939. ".asm" file, if you select "OPTIONS 1/Symbols/Off", from that point  on,  the
  940. output file will not show any symbols.
  941.  
  942. Similarly, if you selected "OPTIONS 1/DCB statements/On" during the save, DCB
  943. statements would be used in the output file from that point on.  This feature
  944. is handy during the execution of macros, as you will see in  the  section  on
  945. macros.
  946.  
  947. 1.5    About Keys
  948. As mentioned previously, any function except the "PROJECT/Abort" function can
  949. be bound to any key.  All non-qualifier keys can be used, with or without any
  950. of the following combinations of qualifier keys:
  951.  
  952.     shift - left or right, or caps lock, all treated as one
  953.     alt   - left or right, both treated as one
  954.     ctrl    shift-ctrl    alt-ctrl    shift-alt    shift-alt-ctrl
  955.     left-Amiga    right-Amiga
  956.  
  957. For example, in order to rebind the "Open load file" function to  right-Amiga
  958. O,  select "KEY REBINDINGS/Rebind key", then select "PROJECT/Open load file",
  959. then press and hold down the right-Amiga key, press and release the "O"  key,
  960. and  finally release the right Amiga key.  From then on, instead of using the
  961. menus for opening a file, you could just press right-Amiga O.  To  make  this
  962. binding  permanent,  you  would  save  the  current  bindings  to  a ReSource
  963. KEYTABLE.  Select "KEY BINDINGS/Save", and type in the name of a file to save
  964. the key bindings to.  If you want these bindings used every  time  you  start
  965. ReSource, you need to save the key bindings as "S:RS.keytable".
  966.  
  967. With many programs, when you press and hold down a key, for example the down-
  968. arrow key, to scroll down, a backlog of key  repeats  will  form,  making  it
  969. difficult  to  stop  the  scrolling,  even after releasing the offending key.
  970. Where this would be a problem, the repeats are flushed,  making  key  control
  971. better.
  972.  
  973. 1.6 About the Mouse
  974. ReSource uses some of the most sophisticated scrolling  techniques  available
  975. to move smoothly through a file.  The mouse may be used to set both scrolling
  976. direction  and  speed.   Press  and hold down the left mouse button while the
  977. pointer is near the vertical center of the ReSource screen.  Gently move  the
  978. mouse  toward  the  bottom  of  the screen, and text will start moving up the
  979. screen continously.  If you move the mouse toward the top of the screen, text
  980. will move down.  The further you move the mouse pointer vertically from where
  981. you started, the greater the scrolling speed.
  982.  
  983. At the slowest rate, the display is shifted one pixel at a time followed by a
  984. short delay.  The second slowest rate is the same with no delays.  The  third
  985. moves  2 pixels at a time, fourth slowest is 4 pixels at a time, and the next
  986. rate is 8 pixels at a time.  It is possible to select any of these  rates  by
  987. using  menus/keys.  Mouse scrolling also lets you scroll at rates faster than
  988. 8 pixels at a time.  By moving the mouse vertically  further  away  from  the
  989. point  where the left button was pressed, up to several hundred lines of text
  990. will be skipped between display refreshes.
  991.  
  992. Several functions can be used during mouse scrolling; one of the most  useful
  993. is  automatic label creation.  To do this, hold down the left-Amiga key while
  994. scrolling.  This gives  close  control  over  the  disassembly  process;  you
  995. examine the code as it scrolls up, and ReSource creates the necessary labels.
  996. Sometimes code will appear which really should be displayed as ASCII.  Do not
  997. allow  ReSource  to  create labels from this "code".  This is one of the main
  998. reasons that most people examine the code while creating labels; when you see
  999. something that isn't being displayed correctly, fix it, or just skip  it  for
  1000. now.   It  will  probably  be  fixed later when it is referenced by some code
  1001. further on in the program.  A better way to parse code  is  to  use  "LABELS/
  1002. Create multiple/All" and "CURSOR/Relative/Next  unparsed  code"  alternately.
  1003. This is both quicker and safer than using the process outlined above.
  1004.  
  1005. If you are unsure  which  display  method  (code/ASCII/bytes/words/longwords)
  1006. should  be  used for any part of a file, you can have the display lock on one
  1007. of these display types temporarily.  While holding  the  left  mouse  button,
  1008. even  while  scrolling, press and hold down the CTRL key.  Everything will be
  1009. shown as code, regardless of how it is normally shown.  Press the  left-SHIFT
  1010. key, and everything will be shown as bytes.  Similarly, the left-ALT key will
  1011. give you ASCII, left-SHIFT and left-ALT together will give you words, and all
  1012. three  (left-ALT, left-SHIFT, and CTRL) will display everything as longwords.
  1013. If you wish to change the display type (data  type)  permanently,  you  would
  1014. normally  use  the  "DISPLAY/Set  data  type/" functions, but while using the
  1015. mouse and the above qualifier keys, it is also possible to set the data  type
  1016. by pressing the right mouse button.  Be sure that the location where you want
  1017. the new data type to start is at the top of the screen.
  1018.  
  1019. When the left mouse button is held down, as well as the ctl key, symbols  and
  1020. full-line  comments  are temporarily disabled, as well as optimization.  This
  1021. allows you to quickly see the value of any symbols present in code.
  1022.  
  1023. While using the mouse to scroll, if the left Amiga key is held  down,  labels
  1024. are created using forward references.  If the left mouse  button  is  pressed
  1025. while  the  pointer  is  within 3 pixels of the right screen border, ReSource
  1026. will assume that you are holding the left-Amiga key down, until you  let  the
  1027. left  mouse  button  go.   This makes it easy to create labels single-handed.
  1028. You don't have to keep the pointer on the right  while  scrolling,  only  its
  1029. position when you actually press the LMB is important.
  1030.  
  1031. If you press the left-Amiga key while in one-button-parse, and  then  release
  1032. it, ReSource will again test for the mouse position.
  1033.  
  1034. If ReSource's window is selected (activated) when the intuition pointer is on
  1035. the far left of the screen, a screen update will *not*  be  performed.   This
  1036. may  be  necessary  after  saving  to  a ".asm" file, when the source profile
  1037. information is to be saved to a file.
  1038.  
  1039. 1.7    About Load Files
  1040. There are six functions that deal with loading.  These are:
  1041.  
  1042.     "PROJECT/Open load file"
  1043.     "PROJECT/Open  binary  file"
  1044.     "PROJECT/Restore"
  1045.     "PROJECT/Dismble memory"
  1046.     "PROJECT/Read tracks"
  1047.     "PROJECT/O'lay binary image"
  1048.  
  1049. The first of these will examine the start of the file, to check if it  is  an
  1050. Amiga®  load  file.   Amiga®  load  files  include  all  executable  programs
  1051. (excepting those using overlays), libraries, device drivers, and fonts.  With
  1052. this type of load, ReSource examines, then strips out, all hunk,  relocation,
  1053. and  debug  symbol  information.   This  information  is not lost, it is used
  1054. internally to ReSource, to make better decisions about data type setting, etc.
  1055.  
  1056. ReSource was designed with speed as the PRIMARY objective.  It does  not  use
  1057. memory  sparingly.   To load a file, ReSource sometimes requires a great deal
  1058. of memory, especially when disassembling large  files.   For  any  file,  the
  1059. approximate  memory  requirement  will  be 6 to 10 times the file size.  As a
  1060. further requirement, much of this is required to be contiguous.  ReSource  is
  1061. NOT practical on a 512K machine.  If you have 2 Megs of fast memory, you will
  1062. be  able  to  disassemble most programs.  Users with 1 Meg machines will feel
  1063. constrained when attempting to disassemble  30-40K  executables,  but  should
  1064. have little difficulty with programs smaller than this and most C: programs.
  1065.  
  1066. Any debug symbols will be shown as labels in their proper places  within  the
  1067. program,  and  even the relocation information is available.  For example, if
  1068. you select "DISPLAY/Hiliting/Reloc32", any relocated  pointers  are  hilited.
  1069. When  disassembling,  this  information is quite valuable, as it helps you to
  1070. tell where code is, where tables of pointers are, etc.  ReSource  also  makes
  1071. heavy  use of this information in many functions, and this is one of the main
  1072. reasons that it is so accurate in determining  data  types,  especially  when
  1073. telling  code  from  ASCII.   The  hunk  information  also  tells you whether
  1074. something was meant to load into chip memory, which immediately lets you know
  1075. that it is probably graphics or sound data.
  1076.  
  1077. When a file with overlays is loaded, only the root node is loaded.  When this
  1078. happens, the user is  notified  of  this,  and  must  select  "okay"  on  the
  1079. requester before ReSource will continue.
  1080.  
  1081. The "LABELS/Create multiple/Reloc32" function is called  automatically  after
  1082. every "Open load file", unless there was no reloc32 table in  the  file,  and
  1083. providing  that  this is not overridden by "OPTIONS2/Auto labels/OFF" option.
  1084. It may be stopped by pressing rAmiga-A, anyway.
  1085.  
  1086. If a program has the debug symbols left in it,  it  makes  the  disassembling
  1087. process  much  easier.  When the file is loaded, for each debug symbol found,
  1088. if it is nine characters long, starts with "lb", and is followed by an  upper
  1089. case "A", "B", "C", "L", or "W", at the point that the label is attached, the
  1090. data type will immediately be set to ASCII, bytes, code, longwords, or words,
  1091. respectively.   Additionally,  local  labels, of the "1$" variety, and labels
  1092. ending in "SUB" are recognized as code,  and  labels  ending  in  ".MSG"  are
  1093. recognized as ASCII.
  1094.  
  1095. Thus, if you have to disassemble a program that you previously  disassembled,
  1096. then  reassembled, most of the data types will be set for you, as the file is
  1097. loaded.
  1098.  
  1099. There is one other type of file that can be  loaded  in  using  "PROJECT/Open
  1100. load file", the ReSource data file, or ".RS" file.  It is discussed in detail
  1101. in the section entitled, "About Data Files".
  1102.  
  1103. If  ReSource   cannot  load  the  file  as  an  Amiga®  load  file,  it  will
  1104. automatically  attempt to load it as a binary file, without looking for hunk,
  1105. relocation, and debug symbol information.  If it is an Amiga® load file,  but
  1106. has  been corrupted, ReSource will refuse to load it.  You can still load it,
  1107. however, using the "PROJECT/Load binary file" function.  With this  function,
  1108. you can load any file that will fit into available memory.  Keep in mind that
  1109. ReSource will require memory 6 times the file size, of which 4 times the file
  1110. size must be contigous.  In the case of normal Amiga®  load  files,  you  may
  1111. wish to examine the hunk information in them.
  1112.  
  1113. The "PROJECT/Restore" function will attempt to load the same  file  that  you
  1114. loaded  last, this is useful when you make a mess of things, and just want to
  1115. start again.  The restore function is only usable when you loaded a file, NOT
  1116. when you disassemble memory directly, or read  tracks  from  a  floppy  disk.
  1117.  
  1118. When you are asked to select a file using the file requester, you may  cancel
  1119. the  load  immediately,  and  retain the current file.  If you hit the "okay"
  1120. gadget, and the file is not successfully loaded, (perhaps because it  is  too
  1121. large  for  available  memory), you have lost your current file.  If, at this
  1122. time, you select "cancel", ReSource will give you the chance to quit, in case
  1123. you cannot or are unwilling to load any file.  If you  don't  quit,  ReSource
  1124. will  again  offer  the  file  requester,  where  you  may  select  a file to
  1125. disassemble.
  1126.  
  1127. 1.8    About Data Files
  1128. The ReSource data file, or ".RS" file, is a file containing most of the  data
  1129. areas  internal  to  ReSource,  while any particular file is loaded.  This is
  1130. used to save your work, and later load it back  into  ReSource,  so  you  can
  1131. continue  disassembling a program some other time, without losing any of what
  1132. you have already done.  You could even send this file to a  friend,  assuming
  1133. that  they  have  purchased  ReSource.  This should be particularly useful in
  1134. disassembling  the   Amiga®   operating   system,   (Kickstart(TM)),  as  the
  1135. Kickstart(TM)  ".RS"  file  does not contain any copyrighted material, and so
  1136. can be legally distributed.  This is only true for Kickstart(TM) ".RS" files.
  1137. The executable must be cleared before you distribute ".RS" files of any other
  1138. program that is not in the Public Domain.  See "PROJECT/O'lay  binary  image"
  1139. in  the  reference section.  Be aware that you will require at least two megs
  1140. of fast memory to load a Kickstart(TM) ".RS" file.  Even the cursor  position
  1141. is  saved  in  a  .RS  file, making it easy for you to remember what you were
  1142. doing last when you saved the ".RS" file.  The ".RS" file is only  recognized
  1143. as  a  ReSource  data  file  when  using  "PROJECT/Open  load  file", not the
  1144. "PROJECT/Open binary file", although you may load it as a binary image if you
  1145. want.
  1146.  
  1147. It is the content of the file that allows ReSource to recognize a ".RS" file,
  1148. not the name of the file.  However, the file  should  have  an  extension  of
  1149. ".RS", so it is immediately recognizable by humans as a ReSource data file.
  1150.  
  1151. To save your work (it doesn't matter how you loaded it), select "PROJECT/Save
  1152. .RS", and select a filename to save to.
  1153.  
  1154. 1.9    About Output
  1155. Eventually, after disassembling a program, you will probably want to save  it
  1156. as  a  text  file,  which  you  will later assemble, perhaps after doing some
  1157. modifications.  By using the "SAVE/Save .asm" function, the entire  file  can
  1158. be  saved  as  a text file, exactly as you see it on the screen.  If you only
  1159. wish to save part of the file, use "SAVE/Save .asm/Partial".
  1160.  
  1161. Another output function is "SAVE/Save binary image". This function gives  you
  1162. a  way of performing modifications on an existing binary file (which may be a
  1163. load file).  For example, if you  have  a  program  that  has  some  annoying
  1164. feature, you could load the file using "PROJECTS/Open binary file".  Then you
  1165. could  quickly find the offending code with ReSource, and simply overwrite it
  1166. with "NOP" instructions.  You may use "SPECIAL FUNCTIONS/Zap" to enter  "NOP"
  1167. opcodes  as  "'Nq"  or  "$4E71".  Look up the hex values of any other opcodes
  1168. that you may need.  Once this has been done, select "SAVE/Save binary  image/
  1169. All",  and  you  can  use  the  file  immediately,  without going through the
  1170. complete disassemble/re-assemble/link process.
  1171.  
  1172. To find out how large the output .asm file will be,  you  can  select  "SAVE/
  1173. Calculate .asm size/ALL".  This will tell you the output size, in bytes, K's,
  1174. and as a percentage of a floppy disk (which may be larger than 100%).  If you
  1175. change any of the options, it will most probably have some effect on the size
  1176. of the output file.  To make the output .asm file smaller, most things in the
  1177. "OPTIONS 1" menu should be switched OFF, except for "DCB instructions", which
  1178. if used, can shrink the size of a .asm file considerably, especially if there
  1179. are large data areas.  Selecting "OPTIONS  2/Multiple  constants"  will  also
  1180. help  to  shrink the output size.  Either real tabs (ASCII value 9) or spaces
  1181. may be used in the output file.  Selecting "SAVE/Tabs/Real  tabs"  will  also
  1182. make  the  output  file size smaller, as will "DISPLAY/Blank lines/None".  If
  1183. the size of the output file is not a problem, then set these options to  suit
  1184. your  tastes.   Another  way to deal with limited space for .asm files, is to
  1185. save them as  two  or  more  partial  files  using  "SAVE/Save  .asm/Partial"
  1186. repeatedly.
  1187.  
  1188. Before leaving this section, a brief look at how ReSource achieves  its  fast
  1189. screen output is in order.  All  text  that  is  displayed  on  the  ReSource
  1190. screen,  with  the  exception  of  menus and requesters which are rendered by
  1191. Intuition, uses text rendering routines internal  to  ReSource.   This  makes
  1192. text  rendering  extremely fast, but also means that the font can't be easily
  1193. changed.  The text rendering routines were originally  inspired  by  Warptext
  1194. II.   The  major  difference  here is that four characters instead of one are
  1195. rendered in the main loop.  This has the obvious benefit of increasing  speed
  1196. of  rendering,  but is also the reason why the start and end of hilited areas
  1197. are sometimes displaced by up to 3 characters.  For efficiency, large cleared
  1198. areas (such as the first tab in a line) are handled separately.
  1199.  
  1200. 1.10    About Symbols
  1201. When you create a symbol, unless you have set "SAVE/Symbol table" to  "None",
  1202. the  symbol  and  its  value  will  be  stored, so that a symbol table can be
  1203. created at the beginning of the output source code file.  This  symbol  table
  1204. can take the form of an equate table, e.g.:
  1205.  
  1206.    AG_OpenLib      EQU     $00030000
  1207.    AO_DOSLib        EQU     $00008007
  1208.    AT_Recovery     EQU     $00000000
  1209.    _LVOAlert        EQU     $FFFFFF94
  1210.    _LVOClose        EQU     $FFFFFFDC
  1211.    _LVOCreateProc  EQU     $FFFFFF76
  1212.    _LVOCurrentDir  EQU     $FFFFFF82
  1213.  
  1214. Alternatively, it can take the form of an "XREF" table, e.g.:
  1215.  
  1216.             XREF    AG_OpenLib
  1217.             XREF    AO_DOSLib
  1218.             XREF    AT_Recovery
  1219.             XREF    _LVOAlert
  1220.             XREF    _LVOClose
  1221.             XREF    _LVOCreateProc
  1222.             XREF    _LVOCurrentDir
  1223.  
  1224. The symbol table is also stored in a ".RS" file.  When it is time  to  create
  1225. the  .asm  file,  you can select either "EQU" or "XREF" as the type of symbol
  1226. table to create.  Even though you may create many symbols with the same name,
  1227. the symbol table will contain only one entry for each symbol.  Thus, it  will
  1228. correctly assemble with most assemblers.  If you select the "None" option, no
  1229. symbol table will be generated.
  1230.  
  1231. 1.11    Display Preferences
  1232. To  cater  to  different  tastes,  the  manner  in  which  ReSource  displays
  1233. information  may  be varied dramatically.  Overlong lines may or may not wrap
  1234. around, code may be shown in upper case, or lower  case.   Data  declarations
  1235. may  be  shown  in upper case or lower case.  You may have blank lines appear
  1236. after conditional branches, after all branches, after system calls,  or  none
  1237. at all.  Any number may be shown in hexadecimal, decimal, binary, or ASCII if
  1238. within  the  required  range.   Leading  zeroes  may be suppressed, or shown.
  1239. Numbers below 10 in value, or below 16 in value may be globally converted  to
  1240. decimal,  or there may be no conversion.  Each line that doesn't start with a
  1241. label may instead show the  current  offset.   Section  statements,  the  END
  1242. statement,  labels,  hidden  labels,  symbols,  and two types of comments may
  1243. individually be set ON or OFF at any time.  The settings of these options can
  1244. be made permanent by selecting the required functions in Macro #19 (the  last
  1245. local macro), and saving the macro file as "S:RS.macros".  See the section on
  1246. macros  for  more  information.   Selecting  "OPTIONS  1/Labels/Off" does NOT
  1247. remove any labels, it simply stops them from being shown,  until  you  select
  1248. "OPTIONS  1/Labels/On".  For example, you might wish to search for "lbC" as a
  1249. string inside a comment,  and  unless  you  turn  off  labels  and  reference
  1250. recognition,  you  will  have  to  spend  a  long time searching for the real
  1251. target, as many labels will start with "lbC".
  1252.  
  1253. 1.12    About Searches
  1254. ReSource has some very powerful search functions.   You  may  select  from  a
  1255. normal  search,  or a pattern search.  You may search forward, backward, or a
  1256. special combined search, that searches in both directions at the  same  time,
  1257. which  will  find  the "nearest" occurrence of the search string.  For use in
  1258. macros, you can also search just the current line, or the accumulator.
  1259.  
  1260. The text that you see on the display will be the text that is searched.   For
  1261. the purpose of searches, tabs are set to real tabs, not spaces.  Thus, if you
  1262. wish to search for:
  1263.  
  1264.             MOVE.L  #100,D0
  1265.  
  1266. you would press "tab" where you see spaces in the above line.  When using the
  1267. pattern search, the wildcards are  those  used  in  all  ARP  programs.   For
  1268. completeness, they are repeated here.
  1269.  
  1270. 1.13    ARP and Wildcards
  1271. ARP has an extensive set of wildcards, and most ARP programs allow them to be
  1272. used.  ARP supports ALL of the AmigaDOS(TM) set of wildcards, as well as  the
  1273. more  standard  Unix style of wildcards.  ARP supports the following wildcard
  1274. characters.  Note that these are valid inside or out of quotes:
  1275.  
  1276.  
  1277.    (a|b|c)    Will match one of a, b or c.  These can be patterns.
  1278.  
  1279.    ?        Matches any single character
  1280.  
  1281.    #<pat>    Pattern repeated 0 or more times, in particular,
  1282.         #? matches anything.
  1283.  
  1284.    [char]    A set of characters, for example, [abc] or [a..c]
  1285.         specify the same set.
  1286.  
  1287.    [^char]    Match everything but this set of characters.
  1288.  
  1289.    *        0 or more occurrences of any character.
  1290.  
  1291. These can be used in combination, of course, so that *.(c|h) or  *.[ch]  will
  1292. match  any  filenames  ending  in  either .c or .h proceeded by any number of
  1293. characters, including no characters.
  1294.  
  1295. For example, if you want to search for "JSR"  or  "BSR",  you  could  specify
  1296. "?SR"  as  the  search pattern, and you would use the pattern search, not the
  1297. normal search.  Here are some more examples:
  1298.  
  1299.   lb[ABCWL] would find any occurrence of "lbA", "lbB", "lbC", "lbW", or "lbL"
  1300.   "lbM" would NOT constitute a valid match.
  1301.  
  1302.   J(MP|SR)  -$????*(A6*) would get a match on the following lines:
  1303.  
  1304.             JMP     -$00C6(A6)
  1305.             JSR     -$00C6(A6)
  1306.             JSR     -$01FE(A6)
  1307.             JMP     -$FFFF(A6)
  1308.  
  1309.    but not on the following lines:
  1310.  
  1311.             JMP     $00C6(A6)
  1312.             JSR     -$00C6(A5)
  1313.             JSR     $1FE(A6)
  1314.             JMP     (A6)
  1315.  
  1316. Note that a real tab character was used  above,  between  "J(MP|SR)"  and  "-
  1317. $????*(A6*)".   During  a  search,  it is unimportant whether tabs are set to
  1318. real tabs or spaces.
  1319.  
  1320. Reference Section
  1321.  
  1322. 2.1.1      PROJECT/Abort:
  1323. Use this to abort searches, macros,  backwards  references,  file  loads  and
  1324. saves.   As  a  matter of fact, most actions may be aborted by this function.
  1325. This is the only function  in  ReSource  which  should  NOT  be  bound  to  a
  1326. different key.  It is permanently bound to right-Amiga A, for "Abort".
  1327.  
  1328. 2.1.2      PROJECT/Open load file:
  1329. ReSource will present the ARP file requester.  When you  either  double-click
  1330. on  a  file  name,  select  a file and press "return", or click on the "okay"
  1331. gadget, ReSource will attempt to load the file as an  executable,  or  "load"
  1332. file.   If  there  are  any  debug  symbols  in the executable, these will be
  1333. stored, and will become  labels  at  the  appropriate  places  in  the  file.
  1334. Relocation  is  performed where required.  If the file has overlays, ReSource
  1335. will attempt to load  the  root  hunk.   Each  debug  symbol  encountered  is
  1336. attached  to  the  appropriate  byte in the file, and for those debug symbols
  1337. (labels) that are nine characters long,  and  start  with  "lb",  immediately
  1338. followed by 'A', 'B', 'C', 'L', or 'W', the data type at the appropriate byte
  1339. will  be  set  to  ASCII,  Bytes,  Code,  Longwords,  or Words, respectively.
  1340. Additionally, local labels, of the "1$" variety, and labels ending  in  "SUB"
  1341. are  recognized as code, and labels ending in ".MSG" are recognized as ASCII.
  1342. Any BSS hunks or uninitialized data areas found are expanded fully.  You  may
  1343. hilite  areas  where  relocation  has  been  performed by selecting "DISPLAY/
  1344. Hiliting/Reloc32".
  1345.  
  1346. You are limited to files smaller than 16 Megabytes, and  further  limited  by
  1347. how  much  memory  you  have.   To  disassemble a 100K file, you will require
  1348. approximately 850K of memory, of which at least 400K must be contiguous.   If
  1349. the  file  has  large  BSS  hunks,  this  will  greatly  increase  the memory
  1350. requirements.  If you intend to load a file, do  some  zaps,  then  save  and
  1351. later run it, use "PROJECT/Open binary file" instead, otherwise the file will
  1352. get saved with the loader information stripped.
  1353.  
  1354. 2.1.3      PROJECT/Open binary file:
  1355. Similar to "PROJECT/Open load file", except that no translation of  the  file
  1356. is  performed; the file is read in "as-is". This allows you to see the loader
  1357. information in executables, object files, etc.  You can  also  load  in  text
  1358. files,  data  base files, in fact any file whatsoever, memory permitting.  If
  1359. you select "PROJECT/Open load file" for a non-executable file, the file  will
  1360. be  loaded as a binary image instead, therefore "PROJECT/Open binary file" is
  1361. not really required except when you wish to force  an  "as-is"  load  for  an
  1362. executable  file.   If  you  wish to do some zaps (small modifications) to an
  1363. executable file, (or a ".RS" file, for that matter) without going through the
  1364. disassemble/edit/reassemble/link cycle, you could load  the  file  with  this
  1365. function,  do  the  zaps  (see  "SPECIAL FUNCTIONS/Zap"), then use "SAVE/Save
  1366. binary image/All" to save the modified program.
  1367.  
  1368. 2.1.4      PROJECT/Restore file:
  1369. Useful only when the current buffer was  loaded  using  "PROJECT/Open  binary
  1370. file"  or  "PROJECT/Open  load  file".   This function will attempt to load a
  1371. file, with the same name as the current file, using the  same  function  that
  1372. loaded  the current file originally.  Do not use this function if the current
  1373. buffer was loaded from tracks, or directly from memory.
  1374.  
  1375. 2.1.5      PROJECT/Dismble memory:
  1376. Disassembles a block of memory directly.  You will be asked to supply a start
  1377. and end address for the memory region to be disassembled.  The memory is  NOT
  1378. copied  to a separate buffer, it is disassembled "as-is", which means that if
  1379. you hold down the left mouse button, in some areas you  can  see  the  memory
  1380. being  dynamically  updated.   It  also  means  that  you  can  modify memory
  1381. directly.  Anywhere.  For each address that you supply, if the number  starts
  1382. with  a "$", the number is assumed to be hexadecimal.  If it starts with "%",
  1383. it is assumed to be a binary number.  If neither, decimal is assumed.  If you
  1384. wish to work on a COPY of a block of memory, to avoid modifying the original,
  1385. or perhaps because the original will not be around for long, disassemble  the
  1386. memory  directly,  and  save  the  data with the "PROJECT/Save .RS" function.
  1387. Then use "PROJECT/Open load file" to load the ".RS" file normally.
  1388.  
  1389. 2.1.6      PROJECT/Read tracks:
  1390. You will be asked to supply the parameters for the track to read.  The  first
  1391. parameter  must  be  either  "DF0:", "DF1:", "DF2:", or "DF3:" (lower case is
  1392. okay).  This represents the drive that holds the disk to be read  from.   The
  1393. second  parameter  is  the number of the cylinder to start reading from.  The
  1394. third parameter is the number of the last cylinder to be read, plus one.  For
  1395. example, if you wanted to read the first cylinder from the disk in DF0:,  the
  1396. parameters  would  be  "DF0:   0  1".   The fourth parameter is optional, and
  1397. represents the number of extra sectors to read.  For example, if  you  wished
  1398. to read only the very first sector from DF1:, the parameters would be "DF1: 0
  1399. 0  1".   If  you  wished to read the first sector from the directory track of
  1400. DF2:, the parameters would be "DF2: 40 40 1".  The fifth  parameter  is  also
  1401. optional,  and  it  represents  the  sector  offset,  to start the read.  For
  1402. example, if you wished to read sectors nine and ten on  cylinder  79  of  the
  1403. disk in DF3:, the parameters would be "DF3: 79 79 2 9".
  1404.  
  1405. 2.1.7      PROJECT/O'lay binary image:
  1406. This function prompts you for a filename.  ReSource will attempt to open  the
  1407. file,  and  read  the contents, overlaying the current file.  This is NOT the
  1408. same as opening a file normally,  as  all  labels,  symbols,  comments,  data
  1409. types,  etc.,  stay  as they are.  Only the actual contents of the executable
  1410. itself are overwritten.  For example, you may wish to pass on a ".RS" file to
  1411. someone, but because the program you have disassembled  is  copyrighted,  you
  1412. cannot  legally  distribute  the  normal  ".RS"  file,  as  it  contains  the
  1413. executable.  By  using  this  function,  and  inputting  a  filename  of  "*"
  1414. (asterisk),  ReSource will completely clear the executable within the current
  1415. file.  You may then save to a ".RS" file,  which  may  then  be  distributed,
  1416. devoid  of  the  executable.   If another person has previously purchased the
  1417. program that you have disassembled, they may load it into ReSource,  and  use
  1418. "SAVE/Save  binary  image/All",  to save the executable to a file.  They then
  1419. load the special ".RS" file which you created.  Next, they then use "PROJECT/
  1420. O'lay binary image", supplying as a filename, the name of the file previously
  1421. saved with the "SAVE/Save binary image/All" function.  This effectively  puts
  1422. the  executable  back into the ".RS" file.  The other save functions may then
  1423. be used, to save to a .asm file, for example.
  1424.  
  1425. Please make sure the executable section IS cleared  before  you  share  ".RS"
  1426. files that are disassemblies of copyrighted material.  Failure to do this may
  1427. result in your meeting many new people - mostly lawyers.
  1428.  
  1429. 2.1.8      PROJECT/Save .RS:
  1430. Use this function to save what you are currently working  on,  regardless  of
  1431. how  far you have gotten in disassembling it.  EVERYTHING is saved, even your
  1432. current position within the file.  Actually, if you  disassemble  the  Amiga®
  1433. operating  system  directly,  the ".RS" file that you create will NOT contain
  1434. the executable, therefore the ".RS" files can be legally distributed, as they
  1435. contain no copyrighted material.  This is not the case for other ".RS" files,
  1436. as the executable will be saved along with  other  information.   Please  see
  1437. "PROJECT/O'lay binary image", above.
  1438.  
  1439. 2.1.9      PROJECT/About:
  1440. Get information about the version number, author,  agents,  and  people  that
  1441. helped in the development of ReSource.
  1442.  
  1443. 2.1.10     PROJECT/Quit:
  1444. Asks you for confirmation, then quits without saving.  If  this  function  is
  1445. used  within  an  executing  macro,  it  will  NOT  ask  the   operator   for
  1446. confirmation.  If any new macros have been defined, without being saved to  a
  1447. macro file, this fact will be mentioned in the quit requester.
  1448.  
  1449. 2.2.1.1    DISPLAY/Hiliting/None:
  1450. Use the hiliting functions to select attributes for which the data with those
  1451. attributes will be shown  with  the  foreground/background  colors  inverted.
  1452. Selecting this function will disable all types of hiliting.
  1453.  
  1454. 2.2.1.2    DISPLAY/Hiliting/BSS hunks:
  1455. Data within BSS hunks and uninitialized data areas will be hilited.
  1456.  
  1457. 2.2.1.3    DISPLAY/Hiliting/Data hunks:
  1458. Everything within data hunks will be hilited.  Data hunks often will  contain
  1459. only data constants, but may also contain code.
  1460.  
  1461. 2.2.1.4    DISPLAY/Hiliting/Code hunks:
  1462. Everything within code hunks will be hilited.  Code hunks often will  contain
  1463. only code, but may also contain data constants.
  1464.  
  1465. 2.2.1.5    DISPLAY/Hiliting/Chip load hunks:
  1466. Data within code or data hunks that MUST be loaded into  chip  memory  (only)
  1467. will be hilited.  Data falling into this category will usually be graphics or
  1468. sound data, to be accessed directly by the blitter, copper or DMA.
  1469.  
  1470. 2.2.1.6    DISPLAY/Hiliting/Fast load hunks:
  1471. Similar to the above function, except that the data is forced  to  load  into
  1472. FAST memory only.
  1473.  
  1474. 2.2.1.7    DISPLAY/Hiliting/Reloc32:
  1475. Being able to see where relocation has been  performed  is  extremely  useful
  1476. when disassembling a program.  If it were not for the relocation information,
  1477. disassembling  programs  would  be  many times harder.  ReSource makes use of
  1478. this information internally, especially when filling in data types.
  1479.  
  1480. 2.2.1.8    DISPLAY/Hiliting/Symbol scan:
  1481. When you use the "LABELS/Create single/Label -  fwd  ref"  or  "LABELS/Create
  1482. multiple/All",  all  data scanned for references are marked as being scanned.
  1483. Use this function to hilite data  falling  into  this  category.
  1484.  
  1485. 2.2.1.9    DISPLAY/Hiliting/Data type uncertain:
  1486. For most labels that ReSource creates automatically, it  is  certain  of  the
  1487. data  type  that  it  assigns.  Sometimes though, it cannot be 100% sure, and
  1488. this function will hilite all lines that fall into this category.
  1489.  
  1490. 2.2.1.10   DISPLAY/Hiliting/Data type known:
  1491. Similar to the above function, only the lines where ReSource WAS  certain  of
  1492. the  data  type  will be hilited.  This will also include lines that YOU have
  1493. set using "DISPLAY/Set data type/" (see below).
  1494.  
  1495. 2.2.1.11   DISPLAY/Hiliting/Internally produced refs:
  1496. All lines which have a label  that  was  created  by  ReSource,  rather  than
  1497. directly by the user, will be hilited.
  1498.  
  1499. 2.2.1.12   DISPLAY/Hiliting/Uninitialized data:
  1500. When selected, any uninitialized data areas will be hilited.
  1501.  
  1502. 2.2.1.13   DISPLAY/Hiliting/Optimize override:
  1503. When selected, any code that has the optimize  overrride  attribute  bit  set
  1504. will be hilited.
  1505.  
  1506. 2.2.1.14   DISPLAY/Hiliting/DCB override:
  1507. This function will hilite any areas that have been selected by "DISPLAY 2/DCB
  1508. override/Set".
  1509.  
  1510. 2.2.1.15   DISPLAY/Hiliting/Optimizations:
  1511. When selected, any code that ReSource  has  optimized  in  any  way  will  be
  1512. hilited.
  1513.  
  1514. 2.2.1.16   DISPLAY/Hiliting/Symbols:
  1515. When selected, all symbols will be hilited.  A symbol in ReSource is  defined
  1516. as  a character string you assign to a number.  This string will be displayed
  1517. in place of the number, and will be hilited by this function.
  1518.  
  1519. 2.2.2      DISPLAY/Set data type/:
  1520. When you are certain of which type of data that you are  looking  at,  select
  1521. from  one of the sub-menu items: Code, ASCII, Bytes, Words, Longwords.  Under
  1522. certain conditions, ReSource will override the previously set data type:
  1523.  
  1524. Attempts to set the data type to ASCII or CODE in a BSS or uninitialized data
  1525. area will instead set the data type to BYTES.  Regardless of the  setting  of
  1526. the attributes bits, data in a BSS hunk or in an uninitialized data area will
  1527. *always* show as "ds.b", "ds.w" or "ds.l".
  1528.  
  1529. If a line is displayed such that a reloc32 longword will overlap to the  next
  1530. line,  the  data  type  at  the start of that line is changed to bytes/words,
  1531. effectively preventing the overlap.
  1532.  
  1533. If data type "word", "longword" or "code" is selected at an  odd  address,  a
  1534. DisplayBeep() is generated.
  1535.  
  1536. If a label is defined for an uninitialized data or BSS  area,  and  the  data
  1537. type  for  the  previous word was set to longword, ReSource will override the
  1538. previous data type in order to avoid hiding the label.   This  will  also  be
  1539. true  for  other  combinations  of data type sizes, such as when the previous
  1540. byte had its data type set to words.  This means that you  should  no  longer
  1541. see any hidden labels in a BSS or uninitialized data area.
  1542.  
  1543. 2.2.3      DISPLAY/Set numeric base/:
  1544. By default, all  numbers  are  shown  in  hexadecimal  (base  16).   You  can
  1545. individually change this to ASCII, DECIMAL, BINARY, or back to HEXADECIMAL on
  1546. any  line  by  selecting  from  the  appropriate sub-item.  It is possible to
  1547. change the default to decimal for numbers less than  16,  or  less  than  10,
  1548. using the decimal conversion function (see below).
  1549.  
  1550. The function "DISPLAY/Set  numeric  base/ASCII"  will  enable  virtually  any
  1551. number  at  all  to  be  shown  as  ASCII,  providing that no non-valid ASCII
  1552. characters are present.  Be aware that the following lines:
  1553.  
  1554.         dc.l    $4E
  1555.         dc.l    $4E00
  1556.         dc.l    $4E004E00
  1557.         dc.l    $4E4E00
  1558.         dc.l    $4E000000
  1559.         dc.l    $444F53
  1560.         dc.l    $444F5300
  1561.         dc.l    $4B49434B
  1562.  
  1563. will, by using the ASCII numeric base, be shown as:
  1564.  
  1565.         dc.l    'N'
  1566.         dc.l    ('N'<<8)
  1567.         dc.l    $4E004E00
  1568.         dc.l    ('NN'<<8)
  1569.         dc.l    ('N'<<24)
  1570.         dc.l    'DOS'
  1571.         dc.l    ('DOS'<<8)
  1572.         dc.l    'KICK'
  1573.  
  1574. Note that the third line contained a  non-valid  ASCII  character.   Although
  1575. some  others  contained zeroes in the lower byte(s), they can be safely shown
  1576. as being an ASCII value shifted 8/16/24 to the left.
  1577.  
  1578. 2.2.4      DISPLAY/Decimal conversion/:
  1579. By default, all numbers are shown in hexadecimal.  You can have numbers  less
  1580. than  16,  or  numbers less than 10, shown in decimal throughout the file, by
  1581. selecting one of the appropriate sub-items.
  1582.  
  1583. 2.2.5      DISPLAY/Blank lines/:
  1584. To better define subroutines, and logical blocks of code, ReSource can insert
  1585. blank lines in the source code.  You may  select  whether  a  blank  line  is
  1586. inserted  after  each  conditional  branch,  unconditional branch, return, or
  1587. system call.   Additionally,  selecting  "DISPLAY/Blank  lines/Entry  points"
  1588. will create a blank line where data ends, and code starts.
  1589.  
  1590. You may select more than one, in which case a blank line  will  appear  after
  1591. any  line which falls into any of the selected categories.  A line will never
  1592. be followed by more than one blank line,  regardless  of  how  many  selected
  1593. categories it falls into.
  1594.  
  1595. 2.2.6.1    DISPLAY/Cursor address/Relative:
  1596. The cursor address will be shown in the title bar, as  a  hexadecimal  offset
  1597. from the start of the file.
  1598.  
  1599. 2.2.6.2    DISPLAY/Cursor address/Absolute:
  1600. The cursor address will be shown in the title bar, as a hexadecimal  absolute
  1601. machine  address.   This  allows  you  to quickly find the cursor position in
  1602. memory with other utilities, such as MetaScope, perhaps to  carry  out  large
  1603. scale modifications.
  1604.  
  1605. 2.2.7.1    DISPLAY/Titlebar info/Filename:
  1606. Information is displayed in the title bar in several fields.  From the  left,
  1607. the  first is the program name.  The second is a decimal number, representing
  1608. the cursor position relative to the file size,  and  is  a  percentage.   The
  1609. third  field  is  a hexadecimal number, representing the cursor position, and
  1610. can be shown either as an offset from  the  start  of  the  file,  or  as  an
  1611. absolute  memory  location.   The  fourth field is the one that this function
  1612. relates to.  By selecting this function, the current file name will be shown.
  1613. If user feedback is ON, informative messages will sometimes be shown in  this
  1614. field also.
  1615.  
  1616. 2.2.7.2    DISPLAY/Titlebar info/Attributes:
  1617. The last field of the title bar will  display  information  representing  the
  1618. current  attributes of the cursor byte.  This information is NOT required for
  1619. general program usage, and was originally  included  for  debugging  purposes
  1620. only, and left in to satisfy those that want to know how the attributes table
  1621. in  ReSource  works.   The  attributes  table  is  four times the size of the
  1622. current file, plus 16 bytes.  It is used internally as  a  large  bitmap,  to
  1623. store  information about each and every byte in the current file.  Because it
  1624. is four times the file size, 32 bits are  available  for  each  byte  in  the
  1625. current file.  For each character in the string displayed, if lower case, the
  1626. bit  that  that character represents is clear, if upper case, the bit is set.
  1627. Going from the left, the bit definitions are:
  1628.  
  1629.     S:  Start of a line of code/data
  1630.     B:  Bss hunk
  1631.     D:  Data hunk
  1632.     C:  Code hunk
  1633.     R:  Reloc32 area
  1634.     F:  First byte of reloc32 area
  1635.     L:  Label attached to this byte
  1636.     S:  Symbol attached to this byte
  1637.     F:  Full-line comment attached to this byte
  1638.     E:  End-of-line comment attached to this byte
  1639.     P:  Parsed previously (symbol scan)
  1640.     I:  Internally referenced
  1641.     L:  Low priority.  The data type has been set, but can be overridden by
  1642.         internal routines.  The data type can always be overridden by the
  1643.         user.  This bit was generally set when ReSource had to decide on a
  1644.         data type to set for a byte, but when it did so, it wasn't really
  1645.         sure that it was correct.
  1646.     A:  Show numeric operands as ASCII if possible.  Decimal conversion
  1647.         is on a higher priority than this bit.
  1648.     B:  Show numeric operands as Binary.  Decimal conversion is on a higher
  1649.         priority than this bit.
  1650.     D:  Show numeric operands as Decimal if possible.
  1651.     F:  Data in this hunk is to be loaded into FAST memory only.
  1652.     C:  Data in this hunk is to be loaded into CHIP memory only.
  1653.      :  [Next 4 bits are reserved for future use]
  1654.     U:  User should check the data type that has been set, as ReSource wasn't
  1655.         really sure that it chose the correct one.  Use "CURSOR/Relative/Next
  1656.         uncertain D/T" to find the next occurrence.  If such a line is already
  1657.         the current line when you use that function, it will clear this bit.
  1658.     H:  High priority.  The data type has been set either by the user, or by
  1659.         ReSource when it was quite certain that it set the data type
  1660.         correctly.  This does not mean that it cannot make mistakes, it
  1661.         simply means that if some operation attempts to set the data type for
  1662.         this byte, it will NOT override the currently set data type.  This
  1663.         will not ever stop the user from redefining the data type, however.
  1664.     C:  This line is code.
  1665.     dddd:  Data type hasn't been set yet
  1666.     ddDd:  Data type is bytes
  1667.     dDdd:  Data type is words
  1668.     dDDd:  Data type is longwords
  1669.     Dddd:  Data type is bytes, within a BSS hunk or uninitialized data area.
  1670.     DddD:  Data type is ASCII.
  1671.     DDDd:  Data type is words, within a BSS hunk or uninitialized data area.
  1672.     DDDD:  Data type is longwords, within a BSS hunk or uninitialized data area.
  1673.  
  1674. 2.2.7.3    DISPLAY/Titlebar info/Accumulator:
  1675. The third field of the title bar will display  information  representing  the
  1676. contents  of  the  ACCUMULATOR.  This is a 240 byte buffer, used as a central
  1677. number and string processor, which will find most of its uses within  macros.
  1678. Only  the  first 30 characters or so can be shown in the title bar.  However,
  1679. often the string will not be longer than that anyway.  For  more  information
  1680. on the accumulator, see the functions within the "STRINGS" menu.
  1681.  
  1682. 2.2.8      DISPLAY/Wrap/:
  1683. With wrap on, any lines longer than the current display width will  be  shown
  1684. on several lines.  Otherwise, any lines longer than the current display width
  1685. will be truncated.
  1686.  
  1687. 2.2.9      DISPLAY/Block-fill/:
  1688. To use the "Block fill"  function,  the  start  and  end  addresses  must  be
  1689. specified  by  selecting  "DISPLAY/Block  fill/Set  start" and "DISPLAY/Block
  1690. fill/Set end" at the appropriate locations in the file.  The block-fill start
  1691. and end addresses will default to the actual  start  and  end  of  the  file.
  1692. Selecting  "DISPLAY/Block-fill/Fill will copy the data type attributes of the
  1693. first byte (as defined by "Set start", from the start location up to, but not
  1694. including, the end location.
  1695.  
  1696. 2.2.10     DISPLAY/Fill-in data types:
  1697. To  understand  what  this  function does, you will need to know how ReSource
  1698. keeps track of data types.  Suffice it to say, when you  set  the  data  type
  1699. anywhere  within  a  file, that data type is immediately echoed forward, to a
  1700. maximum of several hundred bytes, but will not change any other places  where
  1701. the  data  type  has  already  been set, or where there is a label on a line.
  1702. Where there is large areas of a file where the data type has  not  been  set,
  1703. this  function  attempts  to set the data type appropriately.  All of this is
  1704. done on the first pass.  On the second pass, the length of each line is  set.
  1705. This  is  mostly noticeable when strings are displayed.  Much of this is done
  1706. on-the-fly, during normal disassembly, so this function shouldn't be required
  1707. too often.  It is still a good  idea  to  use  "DISPLAY/Fill-in  data  types"
  1708. before  saving  to  either a ".asm" or ".RS" file, however these are the only
  1709. occasions when it should be required.
  1710.  
  1711. 2.2.11     DISPLAY/Fill-in D/T Fwd:
  1712. Similar to the above function, except that both passes will  start  from  the
  1713. current  cursor location, and NOT the start of the file.  Also, the action of
  1714. this function will stop at the end of the current section, OR the end of  the
  1715. file, whichever occurs first.  Useful if you need to make changes to data and
  1716. BSS areas towards the end of the file.
  1717.  
  1718. 2.2.12     DISPLAY/Set counter:
  1719. If cursor address has been set to "relative", the current offset in a file is
  1720. shown in the title bar, in hexadecimal.  This is normally zero at  the  start
  1721. of the file.  You can change this, so that it is zero at somewhere other than
  1722. the  start of the file, by using this function.  You may use this function to
  1723. measure the size of a hunk, for example.  To "reset"  the  counter,  use  the
  1724. function  "DISPLAY/Reset  counter".   If  cursor  address  has  been  set  to
  1725. "absolute", it will correctly display the  current  address  of  the  cursor,
  1726. regardless of this function.
  1727.  
  1728. 2.2.13     DISPLAY/Reset counter:
  1729. Similar to the above function, except that the title bar counter will display
  1730. offsets relative to the start of the file.
  1731.  
  1732. 2.2.14     DISPLAY/Flip case - code:
  1733. If code is currently being displayed using upper case,  it  will  be  instead
  1734. shown  in  lower  case,  and  vice  versa.   Note  that all searches are case
  1735. sensitive.
  1736.  
  1737. 2.2.15     DISPLAY/Flip case - data:
  1738. If data is currently being displayed using upper case, it will be instead  be
  1739. shown in lower case, and vice versa.
  1740.  
  1741. 2.3        DISPLAY 2/DCB override/:
  1742. These  functions  set  or  clear  an  attribute  bit  for  the  current  line
  1743. determining  whether  the DCB directive will be used on this line if there is
  1744. suitable data.  This bit works in conjunction with the global DCB option (see
  1745. "OPTIONS 1/DCB statements") to comprise an exclusive-OR function:  If  global
  1746. DCB's  are  ON,  this  bit will turn them off locally.  Conversely, if global
  1747. DCB's are set to OFF, this bit will enable them locally.
  1748.  
  1749. 2.4        SYMBOLS 1/:
  1750. Some background information is required here: When you  assemble  a  program,
  1751. you  will  use  symbols  such   as   "_LVOAllocMem",   "MEMF_CHIP",   "Open",
  1752. "MODE_OLDFILE", etc.  When you  disassemble  a  program,  you  see  only  the
  1753. numbers  that  equate to the symbols that you used.  To convert these numbers
  1754. back into strings, you basically tell ReSource what the "symbol base" is, and
  1755. it will do the rest.  For example, in the following line:
  1756.  
  1757.         JSR    -$0228(A6)
  1758.  
  1759. the number "-$0228" could be interpreted in  many  different  ways.   If  you
  1760. happened  to  know  that  the  A6  register  at that point in the program was
  1761. pointing to the Exec library base, you would interpret that line as:
  1762.  
  1763.         JSR    _LVOOpenLibrary(A6)
  1764.  
  1765. To make ReSource do this automatically, you would scroll so  that  this  line
  1766. became  the  cursor  line, and then select the function "SYMBOLS 1/Libraries/
  1767. Exec", or "SYMBOLS 2/E-G/Exec library".  There are hundreds of  other  symbol
  1768. bases  that  are  available,  including   libraries,   devices,   structures,
  1769. parameters, and error code names.
  1770.  
  1771. 2.4.1      SYMBOLS 1/Set Source/dest/:
  1772. Examine the following line of code:
  1773.  
  1774.         MOVE.L  #-$0228,$0022(A6)
  1775.  
  1776. If you wished to create a symbol for the second number on this line, "$0022",
  1777. you should first select "Destination".  The setting of "Set Source/dest" will
  1778. go back to "Source" with virtually  any  function  you  use,  therefore  when
  1779. creating  a symbol for the second field in a line of code, use "SYMBOLS 1/Set
  1780. Source/dest/Destination" only just prior to actually creating the symbol.
  1781.  
  1782. 2.4.2      SYMBOLS 1/Object/:
  1783. By default the number, or object, used to find the string will come from  the
  1784. cursor  line.   You  can  instead  have  ReSource  get  the  number  from the
  1785. accumulator, by selecting "Accumulator".  In this  case,  the  output  string
  1786. will be placed back into the accumulator.  To set it back, select "Cursor".
  1787.  
  1788. 2.5        SYMBOLS 2/:
  1789. Some special symbol bases are in  the  "SYMBOLS  1"  menu,  mostly  different
  1790. library  bases.   The  remainder are in alphabetical order in the "SYMBOLS 2"
  1791. menu.
  1792.  
  1793. One symbol base, "String control", should be mentioned.  This is meant to  be
  1794. used for ASCII control characters, such as DEL ($7F), BS (8), etc.
  1795.  
  1796. 2.6        OPTIMIZATION/:
  1797. ReSource can be used  to  optimize  68000  code.   With  this  release,  long
  1798. branches  may  be changed to short branches, when the branch is within range.
  1799. This is  true  even  for  forward  branches,  and  includes  conditional  and
  1800. unconditional  branches, as well as branch-to-subroutine instructions.  It is
  1801. expected that other forms of optimizing will be supported later.
  1802.  
  1803. 2.6.1      OPTIMIZATION/Local override/:
  1804. This function may be used to  override  all  optimizing  at  specific  places
  1805. within  a file.  For example, if a branch was short, it will remain short; if
  1806. a branch was not short, it will be specifically set to long.  This  attribute
  1807. bit  will  disable  all types of optimizing at all places within a file where
  1808. this  bit   is  set.   There  are  new  hiliting  functions  to  support  the
  1809. optimization  functions (see "DISPLAY/Hilite/Optimize override" and "DISPLAY/
  1810. Hilite/Optimizations").
  1811.  
  1812. 2.6.2      OPTIMIZATION/Branches/:
  1813. This function enables/disables the  optimization  of  branches  on  a  global
  1814. scale.   Optimization is temporarily disabled while holding down the ctl key,
  1815. as well as the left mouse button.
  1816.  
  1817. 2.7.1      CURSOR/Remember:
  1818. ReSource keeps a stack of cursor locations internally.  Using  this  function
  1819. will  "push"  the  current cursor location onto the top of this stack.  Other
  1820. functions that call this function are:
  1821.  
  1822.     CURSOR/Remember
  1823.     CURSOR/Absolute/End of file
  1824.     CURSOR/Absolute/Start of file
  1825.     CURSOR/Absolute/Forward reference
  1826.     CURSOR/Absolute/Second forward reference
  1827.     CURSOR/Absolute/Backward reference
  1828.  
  1829. To "pop" a cursor location, you use  the  function  "CURSOR/Absolute/Previous
  1830. locations". The stack is cleared when you load a new file, or when you select
  1831. "CURSOR/Clear loc stack".  The stack is NOT stored within ".RS" files.
  1832.  
  1833. 2.7.2      CURSOR/Clear loc stack:
  1834. See above function.
  1835.  
  1836. 2.7.3.1    CURSOR/Relative/Next byte:
  1837. The cursor location is incremented.  If  at  the  last  location  within  the
  1838. current file, a macro "fail" will result.
  1839.  
  1840. 2.7.3.2    CURSOR/Relative/Previous byte:
  1841. The cursor location is decremented.  If at  the  first  location  within  the
  1842. current file, a macro "fail" will result.
  1843.  
  1844. 2.7.3.3    CURSOR/Relative/Next line:
  1845. Scroll forward one line of code/data.  If at the last line  of  code/data  in
  1846. the file already, a macro "fail" will result.  The speed at which this scroll
  1847. is done is set by the "CURSOR/Scrolling speed" settings.
  1848.  
  1849. 2.7.3.4    CURSOR/Relative/Previous line:
  1850. Scroll backwards one line of code/data.  If at the first line of code/data in
  1851. the file already, a macro "fail" will result.  The speed at which this scroll
  1852. is done is set by the "CURSOR/Scrolling speed" settings.
  1853.  
  1854. 2.7.3.5    CURSOR/Relative/Next label:
  1855. Move cursor to the next location that has a label attached  to  it.   If  one
  1856. cannot be found, a macro "fail" will result.
  1857.  
  1858. 2.7.3.6    CURSOR/Relative/Previous label:
  1859. Move cursor to the previous location that has a label attached to it.  If one
  1860. cannot be found, the start of the file will become the new cursor position.
  1861.  
  1862. 2.7.3.7    CURSOR/Relative/Next symbol:
  1863. Move cursor to the next location that has a symbol attached to  it.   If  one
  1864. cannot  be found, a macro "fail" will result.  Note that this location may be
  1865. in the middle of a line of code.  Where the actual  operand  is  stored  will
  1866. become the new cursor position.
  1867.  
  1868. 2.7.3.8    CURSOR/Relative/Previous symbol:
  1869. Move cursor to the previous location that has a symbol attached  to  it.   If
  1870. one  cannot  be  found,  the  start  of  the  file will become the new cursor
  1871. position.  Note that this location may be in the middle of a  line  of  code.
  1872. Where the actual operand is stored will become the new cursor position.
  1873.  
  1874. 2.7.3.9    CURSOR/Relative/Next section:
  1875. Move cursor to the start of the next section (hunk).  If  this  is  the  last
  1876. section in the file, a macro "fail" will result.
  1877.  
  1878. 2.7.3.10   CURSOR/Relative/Previous section:
  1879. Move cursor to the start of this section (hunk).  If already at the start  of
  1880. a section, move to the start of the previous section.
  1881.  
  1882. 2.7.3.11   CURSOR/Relative/Next reloc32:
  1883. Move cursor to the start of the next relocated longword.  If  one  cannot  be
  1884. found,  a macro "fail" will result.  Note that this may be in the middle of a
  1885. line of code.
  1886.  
  1887. 2.7.3.12   CURSOR/Relative/Previous reloc32:
  1888. Move cursor to the start of the previous relocated longword.  Note that  this
  1889. may be in the middle of a line of code.  If one cannot be found, the start of
  1890. the file will become the new cursor position.
  1891.  
  1892. 2.7.3.13   CURSOR/Relative/Next page:
  1893. Move cursor forward 24 lines.
  1894.  
  1895. 2.7.3.14   CURSOR/Relative/Previous page:
  1896. Move cursor backwards 24 lines.
  1897.  
  1898. 2.7.3.15   CURSOR/Relative/Skip forward:
  1899. Move cursor forward approximately 4K.
  1900.  
  1901. 2.7.3.16   CURSOR/Relative/Skip backward:
  1902. Move cursor backward approximately 4K.
  1903.  
  1904. 2.7.3.17   CURSOR/Relative/Next unparsed code:
  1905. Move cursor forward to the next location that satisfies both of the following
  1906. conditions:
  1907.  
  1908.   1. The data type has been set to CODE
  1909.   2. This location has NOT been scanned for forward references previously.
  1910.  
  1911. This function is useful when combined with the  "LABELS/Create  multiple/All"
  1912. function.
  1913.  
  1914. 2.7.3.18   CURSOR/Relative/Next D/T change:
  1915. Move cursor to the next location that has its data type set differently  than
  1916. the data type at the current cursor location.
  1917.  
  1918. 2.7.3.19   CURSOR/Relative/Previous D/T change:
  1919. Move cursor to the previous location that has its data type  set  differently
  1920. than the data type at the current cursor location.
  1921.  
  1922. 2.7.3.20   CURSOR/Relative/Next uncertain D/T:
  1923. Move cursor forward to the next location that has the "Uncertain" bit set  in
  1924. the  attribute table.  This bit indicates that ReSource really wasn't sure of
  1925. the data type of this byte.
  1926.  
  1927. 2.7.3.21   CURSOR/Relative/Next backward reference:
  1928. Once you have used the "CURSOR/Absolute/Backwards  reference"  function,  you
  1929. can use this function to get to other backward references.
  1930.  
  1931. 2.7.3.22 CURSOR/Relative/Next hilite:
  1932. Move cursor forward to the next line which has  any  form  of  hiliting.   By
  1933. changing  the type of hiliting, in the DISPLAY/Hiliting" menu, you can tailor
  1934. the search for various attribute types to your own needs.
  1935.  
  1936. 2.7.4.1    CURSOR/Absolute/End of file:
  1937. Move cursor to the start of the last line of the file.
  1938.  
  1939. 2.7.4.2    CURSOR/Absolute/Start of file:
  1940. Move cursor to the start of the file.
  1941.  
  1942. 2.7.4.3    CURSOR/Absolute/Forward reference:
  1943. If there is a reference to a position within the current file and within  the
  1944. current line of code, move cursor to the location being referenced.  If there
  1945. are two forward references within the current line, the first is used.
  1946.  
  1947. It is also  possible  to  forward-reference  from  symbols  which  themselves
  1948. reference labels, i.e.:
  1949.  
  1950.         ADD.W    D0,D0
  1951.         MOVE.W    JumpBase(PC,D0.W),D0
  1952.         JMP    JumpBase(PC,D0.W)
  1953.  
  1954.   JumpBase    DC.W    FirstOffset-JumpBase
  1955.                DC.W    SecondOffset-JumpBase
  1956.                DC.W    ThirdOffset-JumpBase
  1957.                DC.W    FourthOffset-JumpBase
  1958.  
  1959.   FirstOffset  ...
  1960.  
  1961. Any of the symbols on the "DC.W" lines, are  each  defined  as  the  distance
  1962. between  two  labels.   Each  of  the  symbols on these lines is evaluated by
  1963. subtracting the offset of "JumpBase" from "FirstOffset",  or  "SecondOffset",
  1964. etc.  
  1965.  
  1966. 2.7.4.4    CURSOR/Absolute/Second forward reference:
  1967. If there is a reference to a position within the current file, and within the
  1968. current line of code, move cursor to the location of the  last  reference  on
  1969. the line.
  1970.  
  1971. 2.7.4.5    CURSOR/Absolute/Backward reference:
  1972. Starting from the start of the file, search  for  references  to  the  cursor
  1973. location.  If there are several references, you can use "CURSOR/Relative/Next
  1974. backward reference" to get to successive references.
  1975.  
  1976. 2.7.4.6    CURSOR/Absolute/Previous location:
  1977. "Pop" the cursor location from the top of the cursor location stack.  If  the
  1978. stack is empty, a macro "fail" will result.
  1979.  
  1980. 2.7.4.7    CURSOR/Absolute/Specify offset:
  1981. You will be asked to supply an offset representing how far from the start  of
  1982. the  file,  the  cursor  location  should be.  The number may be specified in
  1983. hexadecimal, decimal, or binary.  If hexadecimal, the string must start  with
  1984. "$",  if  binary,  it must start with "%".  If the given offset is not within
  1985. the current file, this function will fail.
  1986.  
  1987. 2.7.4.8    CURSOR/Absolute/Specify label:
  1988. You will be asked to supply the name of a label.  If the label is used within
  1989. the current file, its location will become the  new  cursor  location.   Note
  1990. that this may be in the middle of a line of code.
  1991.  
  1992. 2.7.4.9    CURSOR/Absolute/Specify symbol:
  1993. You will be asked to supply the name of a symbol.   If  the  symbol  is  used
  1994. within  the  current  file, its location will become the new cursor location.
  1995. Note that this may be in the middle of a line of code.   Also  note  that  if
  1996. there  is  more than one symbol of that name, ReSource will pick the one that
  1997. was defined first.
  1998.  
  1999. 2.7.4.10   CURSOR/Absolute/Specify percentage:
  2000. You will be asked to supply a decimal percentage of the current  file,  where
  2001. the  cursor  will be positioned.  In this case 0 is the beginning of the file
  2002. and 99 is the end.  Note that this may be in the middle of a  line  of  code.
  2003. The  actual  positioning  will  not  be exact.  It will generally be placed a
  2004. little before the required percentage.
  2005.  
  2006. 2.7.5      CURSOR/Copy/:
  2007. 2.7.6      CURSOR/Paste/:
  2008. 2.7.7      CURSOR/Swap/:
  2009. ReSource has 3 internal cursor "clipboards".  You can copy a cursor  location
  2010. to  any  of  these,  and  then later "paste" one of these locations, which in
  2011. effect moves the cursor to where it was when you used  the  "copy"  function.
  2012. Also, you can swap cursor locations, between the current, and a stored cursor
  2013. location.   The  contents  of  these cursor "clipboards" are cleared when you
  2014. load a new file, or restore the current one.
  2015.  
  2016. 2.7.8      CURSOR/Scrolling speed/:
  2017. Whenever you use  either  "CURSOR/Relative/Next  line"  or  "CURSOR/Relative/
  2018. Previous  line" functions, the display will scroll one real line, N pixels at
  2019. a time.
  2020.  
  2021.    Scrolling    Lines
  2022.    Speed    Scrolled    Notes
  2023.    ---------    --------    -----
  2024.    Very fast        8        Exceptionally fast scrolling, good for scanning
  2025.                 through a file.
  2026.    Fast        4        Reasonably fast scrolling, allows scanning,
  2027.                 but difficult to read.
  2028.    Normal        2        Reasonably smooth scrolling, allowing you to
  2029.                 read text fairly easily WHILE it is scrolling.
  2030.    Slow        1        Extremely smooth scrolling, allowing you to
  2031.                 easily read text WHILE it is scrolling.
  2032.    Very Slow        1        Exceptionally smooth scrolling, with a delay,
  2033.                 excellent for slowly browsing through a file.
  2034.  
  2035. 2.7.9.1    CURSOR/Normal search/Set search string:
  2036. You will be asked to supply a string, which will be used in future  searches.
  2037. Like  all  other  string  requests, you may instead supply a two byte string,
  2038. starting with escape, and followed by either another escape character,  or  a
  2039. letter  a-m,  representing  a string buffer where the string should be copied
  2040. from.  If you supply escape-escape as the string, the string currently in the
  2041. accumulator will be copied into the search string buffer.
  2042.  
  2043. 2.7.9.2    CURSOR/Normal search/Find next occurrence:
  2044. Using the currently defined  search  string,  search  forward  for  the  next
  2045. occurrence  of  that  string.   The  string  is searched for as-is, including
  2046. question marks, asterisks, etc., which in a pattern search  take  on  special
  2047. meaning.
  2048.  
  2049. 2.7.9.3    CURSOR/Normal search/Find previous occurrence:
  2050. Similar to the above function, except that the search proceeds backward.
  2051.  
  2052. 2.7.9.4    CURSOR/Normal search/Find nearest occurrence:
  2053. Similar to the above function,  except  that  the  search  proceeds  in  both
  2054. directions at the same time.  The search is done line-for-line, and the first
  2055. line that contains the search string, whether it be before the current cursor
  2056. or  after,  will become the new cursor location.  This function is handy when
  2057. you know that a string is somewhere close, but you're not sure whether it may
  2058. be just past, or just before, the current cursor location.  Note that you may
  2059. NOT use this function to find the second occurrence of a string; it will keep
  2060. finding the same two closest occurrences.
  2061.  
  2062. 2.7.9.5    CURSOR/Normal search/Search this line:
  2063. This function is useful in macros, for determining whether a given string  is
  2064. within  the  current  line.  If the search string is not found in the current
  2065. line, a macro "fail" will result, and unless your macro has prepared for this
  2066. condition with an "End conditional" directive, the macro will abort.
  2067.  
  2068. 2.7.9.6    CURSOR/Normal search/Search accumulator:
  2069. Similar to the above function, except that the accumulator is searched.
  2070.  
  2071. 2.7.10     CURSOR/Pattern search/:
  2072. These functions are identical to their counterparts above,  except  that  ARP
  2073. wildcard characters are expanded (not used literally).
  2074.  
  2075. 2.8.1.1    LABELS/Create single/End-of-line comment:
  2076. You will be asked to supply a string of less than 240 characters, which  will
  2077. become a comment to be attached to the end of the cursor line.  Only one end-
  2078. of-line  comment  is  allowed  per line; if you create one on a line that has
  2079. already got one, it will replace the old comment.
  2080.  
  2081. 2.8.1.2    LABELS/Create single/Full-line comment:
  2082. You will be asked to supply a string of less than 240 characters, which  will
  2083. become  a  comment  to be attached to the start of the cursor line.  Multiple
  2084. full-line comments are allowed, and successive  comments  will  be  displayed
  2085. AFTER  previously  defined  full-line comments.  Normally, full-line comments
  2086. will be displayed starting with a semicolon (";"). However, if you start  the
  2087. string  with a semicolon, the logic is reversed, and it becomes an extra line
  2088. of code/data.  Thus, you can insert extra lines  of  code/data,  even  before
  2089. saving  the source code to a text file.  By creating a label that starts with
  2090. a semicolon for a given line, when that code is assembled, that line of code/
  2091. data is effectively treated as a comment only, therefore you can both  insert
  2092. and  effectively  remove  code/data  using  ReSource,  during the disassembly
  2093. process.
  2094.  
  2095. 2.8.1.3    LABELS/Create single/Label:
  2096. You will be asked to supply a string of less than 240 characters, which  will
  2097. become  a  label to be attached to the cursor line.  Duplicate labels are NOT
  2098. allowed, unless they start with a semicolon (";"), an asterisk  ("*"),  or  a
  2099. number  directly  followed  by  a "$".  This last case is useful for creating
  2100. local labels, but be careful.  They are not checked for  duplication  and  if
  2101. used  imprudently  may  make  your  assembler very unhappy.  In the first two
  2102. cases, they effectively make the  rest  of  the  line  a  comment.   If  this
  2103. function is used within a macro, duplicate labels WILL be accepted.
  2104.  
  2105. When supplying a string (to a string requester) that  will  become  a  label,
  2106. symbol,  or  comment, you may use indirection to include in that string, some
  2107. other already-defined label, symbol, or comment.  Indirection means a  string
  2108. is  not  used  literally.   Rather,  it somewhat resembles a macro in that it
  2109. "points" to other information, and  is  "expanded"  when  later  encountered.
  2110. Indirection  must  start  with  an  "escape" character (just hit the "escape"
  2111. key), and must be followed  by  a  decimal  digit  between  zero  and  three,
  2112. inclusive.  This is how you specify which type of string that you require:
  2113.  
  2114.   0 = Label
  2115.   1 = Symbol
  2116.   2 = Full-line comment (the first one attached to a line only)
  2117.   3 = End-of-line comment
  2118.  
  2119. This should be immediately followed by a  hex,  decimal,  or  binary  number,
  2120. specifying  the  offset  in  the current file to which the required string is
  2121. attached.  Another escape character is  required  immediately  following  the
  2122. number,  as  a  delimiter.   You  are then free to either supply more literal
  2123. text, or you may use  indirection  several  times  within  a  single  string.
  2124. Consider the following program fragment:
  2125.  
  2126.   lbW000140    DC.W    6
  2127.         DC.W    8
  2128.         DC.W    12
  2129.  
  2130.   lbC000146    RTS
  2131.  
  2132.   lbC000148    MOVEQ    #0,D0
  2133.         RTS
  2134.  
  2135.   lbC00014C    MOVEQ    #1,D0
  2136.         RTS
  2137.  
  2138. The word values at label  "lbW000140"  correspond  to  the  distance  between
  2139. "lbC000146"  and  "lbW000140"  on  the  first  line (6), the distance between
  2140. "lbC000148" and "lbW000140" on the second line (8), and the distance  between
  2141. "lbC00014C" and "lbW000140" on the third line (12).  This is what is commonly
  2142. referred  to  as  a  "jump  table".   In  order  to make the program assemble
  2143. properly, the values 6, 8, and 12 should be  changed  to  symbols  specifying
  2144. their  true  meaning,  rather  than  just  the  value that they were when the
  2145. program was last assembled/compiled:
  2146.  
  2147.   lbW000140    DC.W    lbC000146-lbW000140
  2148.         DC.W    lbC000148-lbW000140
  2149.         DC.W    lbC00014C-lbW000140
  2150.  
  2151.   lbC000146    RTS
  2152.  
  2153.   lbC000148    MOVEQ    #0,D0
  2154.         RTS
  2155.  
  2156.   lbC00014C    MOVEQ    #1,D0
  2157.         RTS
  2158.  
  2159. The above example addresses the immediate problem of representing the offsets
  2160. symbolically.   However,  if  you  later  change  the  label  "lbC000146"  to
  2161. "NullSub",  for  instance,  the  symbol  "lbC000146-lbW000140"  will cause an
  2162. assembly error because the assembler will not  be  able  to  find  the  label
  2163. "lbC000146".  By using dynamic indirection,  whenever  the  symbol  at  label
  2164. "lbW000140" is displayed, ReSource will use whatever label is defined at that
  2165. moment.   (Because  the  escape  character  is  not normally displayable, the
  2166. following example will use a carat, "^", to represent the escape  character.)
  2167. For the line:
  2168.  
  2169.   lbW000140    DC.W    lbC000146-lbW000140
  2170.  
  2171. instead of creating  the  symbol  "lbC000146-lbW000140",  you  would  instead
  2172. specify  "^0$146^-^0$140^"  when  asked  by the "LABELS/Create single/Symbol"
  2173. function.
  2174.  
  2175. Dynamic indirection is also used internally in ReSource.   For  example,  the
  2176. "SPECIAL  FUNCTIONS/Convert  specific  EA's/"  functions  now   use   dynamic
  2177. indirection when creating symbols.
  2178.  
  2179. Functions that access labels, symbols, and  comments  will  normally  support
  2180. dynamic indirection in strings, unless the option "OPTIONS 1/Symbols/" is set
  2181. to  "OFF".   In  this  case,  the  literal  string  will  be  used.   Dynamic
  2182. indirection is relatively safe to use with symbols.  It is  possible  to  use
  2183. with  labels  and  comments,  however  some problems may arise if care is not
  2184. taken.  Duplicate labels may easily be created if dynamic indirection is used
  2185. in the specification for a label.  It should be quite safe in  any  comments,
  2186. however.   Symbols  containing  dynamic indirection will not be stored in the
  2187. EQUate or XREF tables.  It is expected that most  strings  using  indirection
  2188. will  be  symbols, that refer to labels, and therefore will not require to be
  2189. EQUated or XREF'd.
  2190.  
  2191. 2.8.1.4    LABELS/Create single/Label - fwd ref:
  2192. The current line of code will be searched for references to positions  within
  2193. the  current  file.  If any are found, ReSource will make a decision on which
  2194. type of data is at the position referenced.  It will then set the  data  type
  2195. (unless it has already been set), and create a label at that offset (unless a
  2196. label  has  already  been  defined for that location). This new label will be
  2197. immediately used for  all  references  to  that  location,  which  of  course
  2198. includes  the reference within the current line.  If there are no references,
  2199. or there is a reference, but it is outside of the range of the current  file,
  2200. then  this  function  will  do nothing.  Normally, this function will only be
  2201. used within macros, as it is easier and quicker to hold down  the  left-Amiga
  2202. key, while holding down the left mouse button, possibly while scrolling also.
  2203.  
  2204. When creating labels from forward references,  if  ReSource  detects  that  a
  2205. reference  to  an  odd  address  is coming from code, a DisplayBeep() will be
  2206. generated, and also a  macro  fail  will  result.   If  using  "LABELS/Create
  2207. multiple/All", the scan will stop.
  2208.  
  2209. 2.8.1.5    LABELS/Create single/Symbol:
  2210. You will  be  asked  to  supply  a  string,  which  will  replace  the  first
  2211. encountered  number  in  the  current line.  For example, if you supplied the
  2212. string "MyColdStartData", the following line:
  2213.  
  2214.         MOVE.L  D0,4(A0) would become:
  2215.  
  2216.         MOVE.L  D0,MyColdStartData(A0)
  2217.  
  2218. If there is more than one number mentioned in the current line, the first  is
  2219. used.   If  there  are  no  numbers  in the current line, a macro "fail" will
  2220. result.
  2221.  
  2222. If the user creates a symbol which is currently also defined as  a  label,  a
  2223. DisplayBeep() will be generated.
  2224.  
  2225. 2.8.1.6    LABELS/Create single/Symbol - dest:
  2226. Similar to the above function, except that the last  number  in  the  current
  2227. line  will be replaced with the string that you supply.  If there is only one
  2228. number, it will be replaced.  If there are no numbers in the current line,  a
  2229. macro "fail" will result.
  2230.  
  2231. 2.8.2      LABELS/Edit single/:
  2232. Similar to their above counterparts, except that if there is already a label/
  2233. symbol/comment defined, you will have the chance to edit that string,  rather
  2234. than  type  the  entire  new string into the requester.  Note that, as far as
  2235. ReSource is concerned, in the example "$0022(A1)", "$0022" is a number, NOT a
  2236. symbol, unless YOU have defined it previously.  If you try to  edit  it,  you
  2237. will  be  presented with an empty requester.  Like all requests for a string,
  2238. you can use indirection, so that ReSource gets the  string  from  either  the
  2239. accumulator,  or  from  one  the buffers A-M.  See the section on the STRINGS
  2240. menu for more details.
  2241.  
  2242. 2.8.3.1    LABELS/Replace single/Label:
  2243. Create a "shop" label at the cursor position.  A "shop" label is one that  is
  2244. 9 characters long, begins with "lb", has the data type immediately following,
  2245. and  ends with the code offset.  It may also be of some other length, and end
  2246. with ".MSG".
  2247.  
  2248. 2.8.4.1    LABELS/Remove single/Label:
  2249. Removes the label from the cursor position.
  2250.  
  2251. 2.8.4.2    LABELS/Remove single/Symbol:
  2252. Removes any symbols in the current line.
  2253.  
  2254. 2.8.4.3    LABELS/Remove single/End-of-line comment:
  2255. Removes the end-of-line comment from the current line, if any.
  2256.  
  2257. 2.8.4.4    LABELS/Remove single/Full-line comment:
  2258. Removes the first full-line comment attached to the current line.
  2259.  
  2260. 2.8.4.5    LABELS/Remove single/All:
  2261. Removes any label, symbols, comments from the current line.  Also,  the  data
  2262. type for the current cursor position is set to 'uncertain', and the 'start of
  2263. line'  bit  is  cleared.   This is useful when a bogus reference was made, as
  2264. when ReSource (or you) thought code was being scanned, and  it  was  actually
  2265. data or ASCII.
  2266.  
  2267. 2.8.5.1    LABELS/Create multiple/Reloc32:
  2268. For each reloc32 pointer within the current file, determine and set the  data
  2269. type  being  referenced,  and create a label at that location.  This function
  2270. will be called automatically whenever you load a load file that has at  least
  2271. one reloc32 pointer, unless you override this option by selecting "OPTIONS 2/
  2272. Auto labels/OFF".
  2273.  
  2274. 2.8.5.2    LABELS/Create multiple/All:
  2275. Starting at the current address, the  "LABELS/Create  single/Symbol  -  dest"
  2276. function is executed, and if ReSource thinks that there was valid code in the
  2277. current  line,  the "CURSOR/Relative/Next line" function is executed, and the
  2278. entire function loops, otherwise the function exits.  This function can  make
  2279. the disassembly process very fast.  Care must be taken when ReSource finishes
  2280. parsing  a section of code to ensure that the next section selected is really
  2281. code.  Otherwise, there is a very slight chance that what ReSource thinks  is
  2282. valid code is really ASCII, and invalid labels will be created.  The best way
  2283. to  accomplish  this is to select "CURSOR/Relative/Next unparsed code" before
  2284. selecting this function again.
  2285.  
  2286. When creating "shop" ASCII labels, if no valid text can be found  to  use  in
  2287. the  label  name,  instead  of creating a label starting with "lbA", ReSource
  2288. creates the label "ascii.MSG", or "ascii.MSG0", or "ascii.MSG1", etc.
  2289.  
  2290. References  to   the   START+$FFFFFFFC   and  START+$FFFFFFF8  are  shown  as
  2291. "ProgStart-4"  and  "ProgStart-8"  respectively.  If the label "ProgStart" is
  2292. not defined anywhere, it will be displayed as a label attached to  the  first
  2293. byte  of  the  current file.  You can still have some other label attached to
  2294. the start of the file.
  2295.  
  2296. 2.9        LOCAL MACROS/:
  2297. 2.10        GLOBAL MACROS/:
  2298. Much background information is required here: The macro facilities  available
  2299. in  ReSource are quite extensive.  There are a maximum of 38 macros available
  2300. on line at one time.  These are divided into two banks of 19  macros,  called
  2301. "LOCAL  MACROS"  and "GLOBAL MACROS".  The idea being that the 'local' macros
  2302. are for your own personal use, and global macros are meant to be  distributed
  2303. to others.  Therefore, you can load a 'global macros' file, and use them, but
  2304. still have access to your own personal macros.
  2305.  
  2306. The 19th local macro is special, in that it is executed when  you  first  run
  2307. ReSource,  after  the  first  file  is loaded.  This macro will often contain
  2308. functions to set the various options to your personal taste, but may  contain
  2309. anything you care to put into it.
  2310.  
  2311. When first creating a macro, you will be asked to supply a name for it.  This
  2312. name will be shown in the MACRO menu immediately after, and if you save  that
  2313. bank of macros to a file, the names of the macros are also saved.
  2314.  
  2315. The functions "LOCAL MACROS/Execute/-unused-"  and  "GLOBAL  MACROS/Execute/-
  2316. unused-" are used to give macros in either bank a name.  These names are also
  2317. saved when you save a bank of macros, and when you load the macro file later,
  2318. these  names  will  immediately appear in the menus, making it much easier to
  2319. remember what previously created macros did.
  2320.  
  2321. The size of a macro is limited only by how much memory you have.  To create a
  2322. macro, select one of the sub-items in "LOCAL MACROS/Create/End/"  or  "GLOBAL
  2323. MACROS/Create/End/".   If  the  current  name for the macro is "-empty-", you
  2324. will be asked to supply a new name for the macro.  If you create a  macro  of
  2325. zero  length,  the  name for that macro will revert to "-empty-".  To execute
  2326. the macro, simply select the appropriate sub-item in "LOCAL  MACROS/Execute/"
  2327. or "GLOBAL MACROS/Execute/".
  2328.  
  2329. You have control over the speed at which macros execute.  The following chart
  2330. indicates whether there will be a delay, and for how long,  and  whether  the
  2331. display will be refreshed between executing functions within the macro.
  2332.  
  2333.    Speed Selected  Delay   Refresh
  2334.    --------------  -----   -------
  2335.      Very Fast      No       No
  2336.      Fast         No       Yes
  2337.      Slow        .1 sec    Yes
  2338.      Very Slow     .5 sec    Yes
  2339.  
  2340. To have complete control over execution of the macro, select  "LOCAL  MACROS/
  2341. Execution  speed/Wait  on  mouse".   With  this  selected, you must press and
  2342. release the left mouse button for each and every function within the macro to
  2343. be executed.  Combined with the "ShowMacros" utility (see further on in  this
  2344. section, and "ShowMacos.doc"), this is an excellent way of finding bugs in  a
  2345. macro that you (or someone else) has created.
  2346.  
  2347. Macros may be nested within macros, provided that the nesting depth does  not
  2348. exceed (approx.) 30.
  2349.  
  2350. While you are creating a macro, you might find that you have to execute  some
  2351. functions  to continue the macro definition, but you don't want them included
  2352. in the macro itself.  When this occurs, select "LOCAL  MACROS/Suspend  learn/
  2353. suspend",  select  the  various  functions  that need to be done, then select
  2354. "LOCAL MACROS/Suspend learn/Normal" to continue the macro definition.
  2355.  
  2356. There are many functions that will make a macro fail, when  it  is  executed.
  2357. For  example,  using  a  cursor movement function that would place the cursor
  2358. outside of the current file, will cause a macro 'fail'.  A failed search will
  2359. also cause a macro 'fail'.  When executing a macro,  if  ReSource  detects  a
  2360. macro  'fail', it searches forward in the macro definition for a "Conditional
  2361. end" directive.  Is none is found, all macro processing  aborts  immediately.
  2362. If  one  IS found, macro processing continues normally from that point in the
  2363. macro definition.  If, while searching for a "End conditional"  directive,  a
  2364. "Start  conditional"  directive  is  found,  the  next  "End  conditional" is
  2365. skipped.  Thus, conditional macro processing may be nested.
  2366.  
  2367. There are five macro labels available.   These  are  placed  into  the  macro
  2368. definition,  and  you  can  insert "goto previous macro label" and "goto next
  2369. macro label" directives into the macro definition,  which  when  found,  will
  2370. start  a  search either forward or backward, for the appropriate macro label.
  2371. When found, macro processing will proceed normally from that  point  forward.
  2372. Thus,  you can loop a macro.  If a search is made backwards for a macro label
  2373. that is non-existent, macro processing will continue from the  start  of  the
  2374. macro definition.  If a search is made forward for a macro label that is non-
  2375. existent,  the  macro  will  exit, possibly to another macro that called this
  2376. one.  For example, the following macro will continuously  scroll  forward  to
  2377. the  end of the file, then scroll backwards, one line at a time, to the start
  2378. of the file, then forward to the end of the file again,  etc.,  indefinitely,
  2379. stopping only when you select "PROJECT/Abort":
  2380.  
  2381.     LOCAL MACROS/Set macro label/#1
  2382.     CURSOR/Relative/Next line
  2383.     LOCAL MACROS/Previous macro label/#1
  2384.     LOCAL MACROS/Directives/End conditional
  2385.     LOCAL MACROS/Set macro label/#2
  2386.     CURSOR/Relative/Previous line
  2387.     LOCAL MACROS/Previous macro label/#2
  2388.     LOCAL MACROS/Directives/End conditional
  2389.     LOCAL MACROS/Previous macro label/#1
  2390.  
  2391. Notice that the directive "Start conditional" was not required in  the  above
  2392. example, as conditional sections were NOT nested.
  2393.  
  2394. When you are creating a macro, and you are asked for a string (even the  name
  2395. of  a  file  to load), if you select "okay" or press return after supplying a
  2396. string, the string will be stored in the macro definition, and will  be  used
  2397. when  the  macro  is  later executed, unless at the time that you execute the
  2398. macro, "LOCAL MACROS/Interactive/" has been set to "ON". In  this  case,  you
  2399. will  be  prompted for any strings that are requested during the execution of
  2400. the macro.  Normally, this will not be required, but it does  give  you  more
  2401. control  over  an  executing  macro,  especially if it was created by someone
  2402. other than yourself.
  2403.  
  2404. If, when creating a macro, you are asked for a string, and you want to  force
  2405. the  user  to  input  a  string during the execution of the macro, you should
  2406. select the "cancel" gadget in the string  requester.   Any  string  that  you
  2407. typed into the requester will still be used while creating the macro, however
  2408. when  the  macro  is  executed, the user is forced to input a new string each
  2409. time, even though 'Interactive' may be set to  "OFF".   Instead  of  actually
  2410. supplying  a  string  literal  to  a  string  requester,  you may instead use
  2411. indirection, to force the string to get copied from either  the  accumulator,
  2412. or from one of the buffers A-M.  For example, if the accumulator contains the
  2413. string  "MOVE", and you wish to create a label called "MOVE", select "LABELS/
  2414. Create single/Label", and when asked for the label name, press the escape key
  2415. twice, and select the "okay" gadget, or  press  "return".   If  the  required
  2416. string  was  in buffer C, instead of pressing the escape key twice, you would
  2417. press it once, followed immediately by "C".
  2418.  
  2419. Buffers A-M are simply 13 separate 240-byte string buffers, in which you  can
  2420. store  any  strings  that  you  like.  A more appropriate name might be 'text
  2421. registers'.  Buffers L and M are special, in that  if  you  select  "STRINGS/
  2422. Define  string/M",  if buffer L is not empty, the string contained in it will
  2423. be used as the prompt,  in  the  requester.   This  is  handy  during  macros
  2424. functions  where  you  want to get a string from the user.  The user can then
  2425. see what the string is required for.
  2426.  
  2427. Normally, every function you put into a macro definition  will  be  executed.
  2428. This  does  not  always  have to be the case.  The "LOCAL MACROS/Commentary/"
  2429. functions sets the commentary level.  When creating a macro, if you  set  the
  2430. commentary  level  to  "None", it is like specifying "The functions following
  2431. are absolutely essential to the execution of this macro".   If  you  set  the
  2432. commentary level to "Full" during the creation of a macro, you are specifying
  2433. "The  functions  following  are by no means required, they are simply running
  2434. commentary, perhaps explaining what is happening in the macro at this point".
  2435. Thus, by setting the commentary level during the creation of a macro, you are
  2436. letting ReSource know how important the  functions  are,  that  follow.   The
  2437. commentary  level  may be changed many times during a macro, and for tutorial
  2438. macros, such as showing someone how to disassemble/zap a particular  program,
  2439. the  commentary  level  should  be  set appropriately.  When it comes time to
  2440. execute the macro, if the commentary level is  set  to  "Full"  by  the  user
  2441. before  the  macro  starts  executing, ALL functions within the macro will be
  2442. executed normally.  If the commentary level was set to something  other  than
  2443. "Full", only those functions in the macro that were set to a commentary level
  2444. lower  than  that  presently  set, will be executed; the rest will be skipped
  2445. over.  Examine the following example macro:
  2446.  
  2447.     LOCAL MACROS/Commentary level/Full
  2448.     CURSOR/Relative/Next line
  2449.     LOCAL MACROS/Commentary level/Heavy
  2450.     CURSOR/Relative/Next line
  2451.     LOCAL MACROS/Commentary level/Normal
  2452.     CURSOR/Relative/Next line
  2453.     LOCAL MACROS/Commentary level/Light
  2454.     CURSOR/Relative/Next line
  2455.     LOCAL MACROS/Commentary level/None
  2456.     CURSOR/Relative/Next line
  2457.  
  2458. If you set the commentary level to "None" and execute this macro, the  cursor
  2459. will  move  down  one  line.  If you set the commentary level to "Light", and
  2460. execute this macro, the cursor will move down two  lines.   If  you  set  the
  2461. commentary  level to "Full" and execute this macro, the cursor will move down
  2462. five lines.  Using the "SPECIAL FUNCTIONS/Dos command" function, you can  use
  2463. the  "SAY"  command,  to  add  speech  to  macros,  to give excellent running
  2464. commentary to tutorial macros.
  2465.  
  2466. While executing a macro, if you have set the  execution  speed  to  "Wait  on
  2467. mouse", you can use other functions, perhaps to scroll backwards or forwards,
  2468. to  see  what  effect  the last function had on the file.  When you press the
  2469. left mouse button to single-step the next function in the macro,  the  cursor
  2470. address  is  restored in case you didn't return the cursor to the appropriate
  2471. place within the file.  If this was not  done,  macro  processing  would  not
  2472. proceed normally from that point on.
  2473.  
  2474. When you load a macro file,  only  the  numbered  macros  in  the  file  will
  2475. actually  overwrite  macros  already  in  ReSource.   If  the macro file only
  2476. contains one macro, then only the one macro will be overwritten, and the rest
  2477. will remain untouched.  Thus, it is possible for a macro to load other  macro
  2478. files, giving an "overlay" effect.
  2479.  
  2480. Whenever functions within a macro are being executed, a very small  group  of
  2481. pixels within the title bar are constantly changed.  This is the only visible
  2482. feedback  that  you will see while executing a macro when the execution speed
  2483. is set to "Very fast".  This is also done during searches, etc.
  2484.  
  2485. While a macro is  executing,  if  the  "CANCEL"  gadget  is  selected  for  a
  2486. requester, the macro will abort immediately.
  2487.  
  2488. ReSource macro files may be disassembled, examined, edited, reassembled,  and
  2489. reused.  "ShowMacros" is a support utility on the ReSource distribution disk.
  2490. It  is  used  to  disassemble a ReSource macro file into an assembly language
  2491. source code file suitable for reassembly.  The output is compatible with both
  2492. the CAPE(TM) and Metacomco assemblers, and the output file  may  be  used  by
  2493. ReSource  as  a macro file immediately.  If not using the CAPE(TM) assembler,
  2494. after assembly you may have to strip the loader information  from  the  file.
  2495. To  do  this,  simply  load  the  file into ReSource as a load file, and then
  2496. immediately save as a binary image file.  Guidelines for  editing  the  macro
  2497. file source can be found in a separate file, "ShowMacros.doc".
  2498.  
  2499. 2.11.1.1    STRINGS/Get/Label:
  2500. If there is a label defined at the cursor location, it will be copied to  the
  2501. accumulator.
  2502.  
  2503. 2.11.1.2    STRINGS/Get/Symbol:
  2504. Copy the first symbol on the current line to the accumulator.
  2505.  
  2506. 2.11.1.3    STRINGS/Get/Symbol - dest:
  2507. Copy the second symbol on the current line to the accumulator.
  2508.  
  2509. 2.11.1.4    STRINGS/Get/Symbol value:
  2510. Get the value of the first number on the current line, and write text to  the
  2511. accumulator,  representing  that  value in hex, decimal, or binary, as set by
  2512. the "STRINGS/Accumulator/" options.  The 'operand size' will be set  by  this
  2513. function.
  2514.  
  2515. 2.11.1.5    STRINGS/Get/Symbol value - dest:
  2516. Get the value of the second number in the current line, and write text to the
  2517. accumulator, representing that value in hex, decimal, or binary,  as  set  by
  2518. the  "STRINGS/Accumulator/"  options.  The 'operand size' will be set by this
  2519. function.
  2520.  
  2521. 2.11.1.6    STRINGS/Get/End-of-line comment:
  2522. Copy the end-of-line comment attached to the current line to the accumulator.
  2523.  
  2524. 2.11.1.7    STRINGS/Get/Full-line comment:
  2525. Copy the first full-line comment attached to the current line to the
  2526. accumulator.
  2527.  
  2528. 2.11.1.8    STRINGS/Get/Search string:
  2529. Copy the current search string to the accumulator.
  2530.  
  2531. 2.11.1.9    STRINGS/Get/Filename:
  2532. Copy the current filename to the accumulator.
  2533.  
  2534. 2.11.1.10   STRINGS/Get/Save .asm name:
  2535. If the current file has already been saved as source code (to a ".asm" file),
  2536. copy the filename used to the accumulator.   If  the  current  file  has  not
  2537. already  been  saved, the name will be the same as the current filename, with
  2538. ".asm" appended.  If "SAVE/Calculate .asm size" has been last used, the  name
  2539. will be "NIL:".
  2540.  
  2541. 2.11.1.11   STRINGS/Get/Save .RS name:
  2542. If the current file has already been saved to a .RS file, copy  the  filename
  2543. used to the accumulator.  If the current file has not already been saved, the
  2544. name  will  be  the same as the current filename, with ".RS" appended, unless
  2545. ".RS" is already appended.
  2546.  
  2547. 2.11.1.12   STRINGS/Get/Macros filename:
  2548. Copy the current macros filename to the accumulator.
  2549.  
  2550. 2.11.1.13   STRINGS/Get/Keytable filename:
  2551. Copy the current keytable filename to the accumulator.
  2552.  
  2553. 2.11.1.14   STRINGS/Get/Cursor longword:
  2554. Write the data where  the  cursor  is  to  the  accumulator  in  hexadecimal,
  2555. decimal, or binary, depending on the setting of "STRINGS/Accumulator/".  This
  2556. may  be  a  byte,  word,  or  longword, depending on the setting of "STRINGS/
  2557. Operand size".
  2558.  
  2559. 2.11.1.15   STRINGS/Get/Cursor offset:
  2560. The currently displayed cursor location is written into  the  accumulator  in
  2561. the current numeric base  as  a  longword  (the  "operand  size"  is  set  to
  2562. longwords).
  2563.  
  2564. 2.11.1.16   STRINGS/Get/Accumulator length:
  2565. The length of the string currently in the accumulator  is  written  into  the
  2566. accumulator  in  the current numeric base.  The 'operand size' setting is not
  2567. affected, but is used to decide how many leading zeroes to use.
  2568.  
  2569. 2.11.1.17   STRINGS/Get/Partial save size:
  2570. The number representing the difference between the partial save end  and  the
  2571. partial  save  start  is  written  into   the   accumulator  in  the  current
  2572. numeric base.  The 'operand size' is set to longwords.
  2573.  
  2574. 2.11.1.18   STRINGS/Get/File:
  2575. You will be asked to supply the name of a file, of which up to 240 characters
  2576. will be copied into the accumulator.  The data is copied "as-is", no  hex  to
  2577. ASCII translation is performed.
  2578.  
  2579. 2.11.1.19   STRINGS/Get/Attribute bits:
  2580. The attribute bits for the current location are copied into the  accumulator,
  2581. using  the  current  numeric  base (hex/decimal/binary).  The definitions for
  2582. these bits are described under "DISPLAY/Titlebar info/Attributes".
  2583.  
  2584. 2.11.2.1    STRINGS/Put/Label:
  2585. If the string within the accumulator is not used as a label  anywhere  within
  2586. the  current  file, it will be used as a label on the current line.  If it is
  2587. already used as a label, then a digit is appended to  it,  and  again  it  is
  2588. tested to see if a label already exists of that name.  This continues until a
  2589. unique  label  is  created,  then that label is attached to the current line.
  2590. This is a safe way of creating labels during macros.
  2591.  
  2592. 2.11.2.2    STRINGS/Put/Attributes:
  2593. If the accumulator contains a valid number, that number  will  overwrite  the
  2594. attributes  for  the  current  location.   The definitions for these bits are
  2595. described under "DISPLAY/Titlebar info/Attributes".
  2596.  
  2597. 2.11.2.3    STRINGS/Put/Base register:
  2598. The support for base register-relative addressing allows any address register
  2599. to be used.  This can be done by using either "STRINGS/Put/Base register", or
  2600. "SPECIAL FUNCTIONS/Specify base register".  To use this  function,  you  must
  2601. first  place  a  number between 0 and 7 inclusive, into the accumulator.  The
  2602. current base register in use will  be  visible  in  the  "SPECIAL  FUNCTIONS/
  2603. Convert  xx(An) EA's" function; you may see "xx(A6)" instead of "xx(A4)", for
  2604. example.  For use in macros that must be able to calculate and enter the base
  2605. register number, this function must be used rather than  "SPECIAL  FUNCTIONS/
  2606. Specify base".
  2607.  
  2608. 2.11.3.1    STRINGS/Edit functions/Clip start:
  2609. You will be asked to supply a string.  Starting from the left, each character
  2610. in the supplied string is compared to the character  in  the  accumulator  at
  2611. that  position, and if they are equal, the next character is compared, and so
  2612. on.  When either the end of one of the strings is found, or when  a  mismatch
  2613. is  found,  the  characters in the accumulator that matched are deleted.  The
  2614. question mark ("?") is used as a wildcard, and you can use the asterisk  once
  2615. only,  to  "delete  everything  until and including" the following character.
  2616. Examples follow:
  2617.  
  2618.    Accumulator     User-supplied string    Resulting accumulator
  2619.    -----------------------------------------------------------------
  2620.    MOVE.L        M            OVE.L
  2621.    MOVE.L        MUVE.L        OVE.L
  2622.    MOVE.L        MOV.L        E.L
  2623.    MOVE.L        move.l        MOVE.L
  2624.    MOVE.L        M?V         E.L
  2625.    MOVE.L        ???         E.L
  2626.    MOVE.L        *.          L
  2627.    MOVE.L        *M          OVE.L
  2628.    MOVE.L        ?MOVE.L        OVE.L
  2629.    _LVOAllocMem    _LVO        AllocMem
  2630.    $00000004        $000000        04
  2631.  
  2632. 2.11.3.2    STRINGS/Edit functions/Clip end:
  2633. Similar to the above function, except clipping is performed on the end of the
  2634. accumulator string.  The question mark is still used as a wildcard,  but  the
  2635. asterisk does not have a special meaning in this function.  Examples follow:
  2636.  
  2637.    Accumulator     User-supplied string    Resulting accumulator
  2638.    -------------------------------------------------------------
  2639.    MEMF_PUBLIC     ?PUBLIC        MEMF
  2640.    MEMF_PUBLIC     ???         MEMF_PUB
  2641.    MEMF_PUBLIC     ?LC         MEMF_PUBLI
  2642.    meMcollAOVL_    OVL_        meMcollA
  2643.  
  2644. 2.11.3.3    STRINGS/Edit functions/Prepend:
  2645. You will be asked to supply a string, which will be prepended  to  (added  to
  2646. the  beginning of) the accumulator, providing that the resulting string is no
  2647. longer than 240 characters.  Examples follow:
  2648.  
  2649.    Accumulator     User-supplied string    Resulting accumulator
  2650.    -------------------------------------------------------------
  2651.    PUBLIC        MEMF_        MEMF_PUBLIC
  2652.    AllocMemSUB     _            _AllocMemSUB
  2653.    PUBLIC        CHIP        CHIPPUBLIC
  2654.  
  2655. 2.11.3.4    STRINGS/Edit functions/Append:
  2656. You will be asked to supply a string, which will be appended to (added to the
  2657. end of) the accumulator, providing that the resulting  string  is  no  longer
  2658. than 240 characters.  Examples follow:
  2659.  
  2660.    Accumulator     User-supplied string    Resulting accumulator
  2661.    -------------------------------------------------------------
  2662.    PUBLIC        MEMF_        PUBLICMEMF_
  2663.    AllocMemSUB     _            AllocMemSUB_
  2664.    PUBLIC        CHIP        PUBLICCHIP
  2665.    AllocMem        SUB         AllocMemSUB
  2666.  
  2667. 2.11.3.5    STRINGS/Edit functions/Reverse:
  2668. The contents of the accumulator are reversed.  Examples follow:
  2669.  
  2670.    Accumulator     Resulting accumulator
  2671.    -------------------------------------
  2672.    PUBLIC        CILBUP
  2673.    AllocMemSUB     BUSmeMcollA
  2674.    AllocMem        meMcollA
  2675.  
  2676. 2.11.3.6    STRINGS/Edit functions/Lower case:
  2677. Any upper case characters in the accumulator are changed to their lower  case
  2678. counterparts.  Examples follow:
  2679.  
  2680.    Accumulator     Resulting accumulator
  2681.    -------------------------------------
  2682.    PUBLIC0123      public01243
  2683.    AllocMemSUB     allocmemsub
  2684.    AllocMem        allocmem
  2685.  
  2686. 2.11.4      STRINGS/Operand size/:
  2687. Some functions in ReSource require to know whether to work at the byte, word,
  2688. or longword level.  For example, "STRINGS/Get/Cursor value" could get a byte,
  2689. word, or longword  from  the  cursor  position,  and  this  is  your  way  of
  2690. specifying  at which level you wish those functions to work.  Generally, they
  2691. specify the size of the numeric operand in the accumulator.   Some  functions
  2692. that  write  a  numeric  value into the accumulator will set the operand size
  2693. themselves, others that get the value out of the accumulator need to know the
  2694. operand size.
  2695.  
  2696. 2.11.5      STRINGS/Accumulator/:
  2697. Options control whether to write the results of any maths  functions  to  the
  2698. accumulator in hex, decimal, or binary.
  2699.  
  2700. 2.11.6.1    STRINGS/Maths functions/Increment:
  2701. Some background information is required here: All maths functions  make  some
  2702. change  to  the  number  within  the  accumulator.   If the string within the
  2703. accumulator is not a valid number (hex, decimal or binary), the function will
  2704. fail.  Some functions are immediate, others will ask the user for a  required
  2705. operand, such as what to add to the accumulator.
  2706.  
  2707. The increment function adds one to the accumulator.  If the resulting  number
  2708. develops  a  carry  (using  the  current  operand  size), a macro 'fail' will
  2709. result.  Thus, loops in macros can exit after a given number  of  iterations,
  2710. rather than a failed search, etc.
  2711.  
  2712. 2.11.6.2    STRINGS/Maths functions/Decrement:
  2713. Similar to the above  function,  except  that  one  is  subtracted  from  the
  2714. accumulator.   If a carry results, a macro 'fail' will occur.  Thus, loops in
  2715. macros can exit after a given number of  iterations,  rather  than  a  failed
  2716. search, etc.
  2717.  
  2718. 2.11.6.3    STRINGS/Maths functions/Add:
  2719. You will be asked for a number, to be added to the accumulator.  If  a  carry
  2720. results, a macro 'fail' will occur.
  2721.  
  2722. 2.11.6.4    STRINGS/Maths functions/Subtract:
  2723. You will be asked for a number, to be subtracted from the accumulator.  If  a
  2724. carry results, a macro 'fail' will occur.
  2725.  
  2726. 2.11.6.5    STRINGS/Maths functions/Multiply:
  2727. You will be asked for a number, to be multiplied by  the  number  within  the
  2728. accumulator.   If  a  carry  results, a macro 'fail' will occur.  Full 32-bit
  2729. multiplies are supported, however the setting of 'operand size' is used  when
  2730. determining the size of the operands.
  2731.  
  2732. 2.11.6.6    STRINGS/Maths functions/Divide:
  2733. You will be asked for a number.  The contents  of  the  accumulator  will  be
  2734. divided by the number that you specify.  The divide function does NOT operate
  2735. on  32-bit  operands,  but  otherwise  will work at the currently set operand
  2736. size.  If the current operand size is set to longwords, the  divide  will  be
  2737. performed on the lower 16 bits only.
  2738.  
  2739. 2.11.6.7    STRINGS/Maths functions/Negate:
  2740. The number within the accumulator is negated, using the currently set operand
  2741. size.  If the result is zero, a macro 'fail' will result.
  2742.  
  2743. 2.11.6.8    STRINGS/Maths functions/Logical NOT:
  2744. The number within the accumulator is NOT'd  in  bitwise  fashion,  using  the
  2745. currently  set  operand  size.   If  the  result is zero, a macro 'fail' will
  2746. result.
  2747.  
  2748. 2.11.6.9    STRINGS/Maths functions/Logical AND:
  2749. You will be asked to supply a number, which will be bitwise  AND'd  with  the
  2750. contents  of  the  accumulator,  and  the  result  is  stored  back  into the
  2751. accumulator.  If the result is zero, a macro 'fail' will result.
  2752.  
  2753. 2.11.6.10   STRINGS/Maths functions/Logical OR:
  2754. You will be asked to supply a number, which will be  bitwise  OR'd  with  the
  2755. contents  of  the  accumulator,  and  the  result  is  stored  back  into the
  2756. accumulator.  If the result is zero, a macro 'fail' will result.
  2757.  
  2758. 2.11.6.11   STRINGS/Maths functions/Exclusive OR:
  2759. You will be asked to supply a number, which will  be  bitwise  exclusive-OR'd
  2760. with  the contents of the accumulator, and the result is stored back into the
  2761. accumulator.  If the result is zero, a macro 'fail' will result.
  2762.  
  2763. 2.11.6.12   STRINGS/Maths functions/ROR:
  2764. The contents of the accumulator will be bitwise rotated once right,  and  the
  2765. result  is stored back into the accumulator.  The accumulator size is used to
  2766. determine whether 8, 16, or all 32 bits will be rotated.  If the  accumulator
  2767. does not contain a valid numeric value, a macro 'fail' will result.
  2768.  
  2769. 2.11.6.13   STRINGS/Maths functions/ROL:
  2770. The contents of the accumulator will be bitwise rotated once  left,  and  the
  2771. result  is stored back into the accumulator.  The accumulator size is used to
  2772. determine whether 8, 16, or all 32 bits will be rotated.  If the  accumulator
  2773. does not contain a valid numeric value, a macro 'fail' will result.
  2774.  
  2775. 2.11.7      STRINGS/Define string/:
  2776. These functions allow to you define the contents of either  the  accumulator,
  2777. or  one of the string buffers A-M.  Whenever you are asked for a string using
  2778. the simple string requester (NOT the large file requester),  you  can  either
  2779. type in a string literal, or input an escape character (just press the escape
  2780. key),  followed by either another escape character, or one of the letters A-M
  2781. inclusive.  If the second character is the escape character, the string being
  2782. requested will be  copied  from  the  accumulator  instead.   If  the  second
  2783. character  that  you typed (after the escape character) is one of the letters
  2784. A-M, then the  string  being  requested  will  instead  be  copied  from  the
  2785. appropriate buffer A-M.  This applies even when you are defining the contents
  2786. of  one  of  the  string buffers.  This method of using indirection should be
  2787. particularly handy in sophisticated macros.
  2788.  
  2789. The maximum string length in any buffer (including the  accumulator)  is  240
  2790. characters.
  2791.  
  2792. 2.11.8     STRINGS/Swap with buffer/:
  2793. The contents of the accumulator is swapped with the contents  of  the  buffer
  2794. that you select.
  2795.  
  2796. 2.11.9     STRINGS/Input buffer/:
  2797. The Input and Output buffers  can  be  used  to  buffer  textual  information
  2798. between  a file and the accumulator within ReSource.  To transfer information
  2799. into ReSource, you load the input buffer, using "Load", and transfer  a  line
  2800. at  a  time to the accumulator, using "Read line".  Each time you read a line
  2801. from  the  input  buffer,  it  replaces  the  contents  of  the  accumulator.
  2802. Successive  uses  of  "Read  line"  will  get successive lines from the input
  2803. buffer.  A line means all text up to  a  line  feed,  to  a  maximum  of  240
  2804. characters.   The  line  feed  is  NOT  transferred, as the line will be null
  2805. terminated within the accumulator.  To start reading lines from the start  of
  2806. the  buffer again, use "Restart".  For example, you may have a list of labels
  2807. that you wish to put into the current file.  Use "Load" to get  the  list  of
  2808. labels into the input buffer, then create a macro something like:
  2809.  
  2810.     CURSOR/Relative/Next label
  2811.     STRINGS/Input buffer/Read line
  2812.     STRINGS/Put label
  2813.     LOCAL MACROS/Previous macro label/#1
  2814.  
  2815. The first function will advance the cursor to the  next  label.   The  second
  2816. function  reads  the  next  label  to  use  into  the accumulator.  The third
  2817. function will replace the current label with the one in the accumulator.  The
  2818. last function ("LOCAL MACROS/Previous macro label/#1") is optional.  It  will
  2819. make  the  function repeat for the entire file, or the entire list of labels,
  2820. whichever ends first.
  2821.  
  2822. 2.11.10    STRINGS/Output buffer/:
  2823. The output buffer is used to hold information that  you  wish  to  save  from
  2824. ReSource.   The  idea here is that you append the contents of the accumulator
  2825. to the end of the output buffer, and eventually save the entire  contents  of
  2826. the output buffer to a file.  For example, you might wish to create a list of
  2827. labels  for  the  current file (see "STRINGS/Input buffer/:").  The following
  2828. macro will do this:
  2829.  
  2830. Note: Prior to actually running this macro, you should ensure that the cursor
  2831. is at the start of file, and use the function "STRINGS/Output  buffer/Clear",
  2832. to ensure the output buffer is empty.
  2833.  
  2834.     CURSOR/Relative/Next label
  2835.     STRINGS/Get/Label
  2836.     STRINGS/Edit functions/Append
  2837.     STRINGS/Output buffer/Append accumulator
  2838.     LOCAL MACROS/Previous macro label/#1
  2839.  
  2840. The first line will move the cursor to the  next  label  in  the  file.   The
  2841. second  function  will put the current label into the accumulator.  The third
  2842. function will prompt you for a string to append to the accumulator.   A  line
  2843. feed  (ASCII  value  10) is required here, to do this, first click inside the
  2844. requester string gadget, hold down the ctl key, and  press  "J",  then  press
  2845. return  or  click on the "OKAY" gadget.  The fourth function, "STRINGS/Output
  2846. buffer/Append accumulator", will add the current contents of the  accumulator
  2847. to  the  end  of  the Output buffer.  Memory is dynamically allocated for the
  2848. output buffer, so maximum size is only determined  by  how  much  memory  you
  2849. have.   The  fifth function is optional, use it if you want the macro to loop
  2850. until all labels in the current file are added to the  list.   Once  this  is
  2851. done,  use  "STRINGS/Output  buffer/Save" to save the current contents of the
  2852. output buffer.  You will be asked for a filename to use.  In  practice,  most
  2853. people will probably combine several pieces of information for each line that
  2854. gets  appended  to  the  output buffer, such as label, followed by its offset
  2855. from the start of the file, or its data type, etc.
  2856.  
  2857. 2.12.1     SPECIAL FUNCTIONS/Repeat last command:
  2858. Repeat the last function used.  Cursor movement functions are  NOT  repeated,
  2859. except  the  search  functions.   This  function  should  be bound to a high-
  2860. priority key, such as the space bar, for best effect.
  2861.  
  2862. 2.12.2     SPECIAL FUNCTIONS/Dos Command:
  2863. You will be asked for a string, which will be given as the operand to the Dos
  2864. "execute" function.  Anything that you normally type into a CLI  window,  you
  2865. can  give  as a command.  Any output will go to the CLI window from which you
  2866. started ReSource, unless  you  redirect  the  output  elsewhere.   The  "Run"
  2867. command must be in your C: directory.
  2868.  
  2869. 2.12.3     SPECIAL FUNCTIONS/Zap:
  2870. You will be asked for a number/string, which will  overwrite  the  byte/word/
  2871. longword/characters  at the cursor position.  The current setting of 'operand
  2872. size' is  used.   Using  "PROJECT/Open  binary  file",  then  this  function,
  2873. followed  by  "SAVE/Save binary image/ALL", you can quickly modify a program,
  2874. without having to  go  through  the  disassemble/edit/reassemble/link  cycle.
  2875. However, when using this method of modification, you are restricted as to the
  2876. size  of  changes  that  may be legally made.  For example, you cannot insert
  2877. extra code or data, nor can you delete it.  You may "NOP" it instead, though.
  2878.  
  2879. If the string that you supply starts with a single quote ("'"), the following
  2880. characters are treated as a string, and are copied  to  the  cursor  position
  2881. "as-is".
  2882.  
  2883. If the string that you supply  starts  with  "$",  the  following  number  is
  2884. assumed  to  be  hexadecimal.  If the string that you supply starts with "%",
  2885. the number that follows is assumed to be binary, otherwise it is  assumed  to
  2886. be a decimal number.
  2887.  
  2888. If the string you supply starts with "l.", "w." or "b.", the number following
  2889. will be treated as a longword, word, or byte, respectively.   In  this  case,
  2890. the  accumulator  operand  size does not matter.  The case of the letter "l",
  2891. "w", or "b" may be upper or lower.
  2892.  
  2893. 2.12.4     SPECIAL FUNCTIONS/Screen/:
  2894. "Front" moves ReSource's screen in front of all other screens.  "Back"  moves
  2895. ReSource's screen behind all other screens.
  2896.  
  2897. 2.12.5     SPECIAL FUNCTIONS/Set task priority:
  2898. You will be asked for a number, representing the priority at which to set the
  2899. current task.  For example, if you have a  program  being  assembled  in  the
  2900. background, and you don't want it to slow down the operation of ReSource, you
  2901. might  set  the  task  priority  to  one  or  two.   Negative numbers are not
  2902. supported.  Sorry!  However, "$FF"  will  effectively  mean  "-1"  with  this
  2903. function.
  2904.  
  2905. 2.12.6     SPECIAL FUNCTIONS/Origin/:
  2906. There is sometimes a requirement to disassemble a block of code, as if it  is
  2907. loaded  to some particular area of memory, other than that to which it is now
  2908. loaded.  For example, if you disassemble Kickstart(TM), and save  the  binary
  2909. image,  then  later load this into ReSource, it will not disassemble properly
  2910. unless ReSource "thinks" that its origin is $FC0000.  To do  this,  load  the
  2911. file,  then  use  the "Specify" option.  Both the "Specify" and "Set" set the
  2912. origin to an absolute address; the "Set" option is  the  same  as  "Specify",
  2913. except that it assumes that the current loading address is to be used.  These
  2914. options  are  really  only useful if the file is loaded as a binary image, or
  2915. from track, or memory.  If loaded from an executable, the reloc32 information
  2916. will ensure that proper relocation is done where needed.  It  is  because  no
  2917. reloc32  information  is  available when loading files other than load files,
  2918. that this function is required.  To  remove  the  origin,  so  that  it  uses
  2919. whatever actual address the file is loaded to, use the "Clear" option.
  2920.  
  2921. 2.12.7     SPECIAL FUNCTIONS/Convert xx(An) EA's/:
  2922. These functions were specifically designed to be used when disassembling  'C'
  2923. programs,  in which an address register is frequently used as a base register
  2924. for accessing data, throughout all or most of  the  program.   Let's  use  an
  2925. example program here:
  2926.  
  2927.         SECTION test000000,CODE
  2928.         LEA    lbB00011E,A4    ; scanning has already been done
  2929.         LEA    0(A4),A1
  2930.         MOVE.L  $000C(A4),D0
  2931.         ...            ; rest of code
  2932.  
  2933.         SECTION test00011E,DATA
  2934.    lbB00011E    dc.b    'dos.library',0
  2935.         dc.l    $00010001
  2936.         END
  2937.  
  2938. In the above example program, the A4 register points to the start of the data
  2939. segment.  There are three ways to tell ReSource where the A4 register points;
  2940. in the above example, the "This operand" function  could  be  used  with  the
  2941. cursor  at  start  of file, or the "This address" function could be used with
  2942. the cursor at offset $00011E,  or  the  "Specify"  function  could  be  used,
  2943. supplying  a  parameter  of  "$11E".   Basically,  with this function you are
  2944. telling ReSource where the  A4  register  can  be  assumed  to  be  pointing,
  2945. relative  to  the  start  of  the  program.  After you do this, any effective
  2946. address that involves a word  offset  to  the  A4  register,  will  be  shown
  2947. symbolically.   If  you  have  selected  "Convert  xx(An) EA's/Absolute", the
  2948. effective addresses will be shown as absolute addresses.  Thus,  the  example
  2949. program above will appear as:
  2950.  
  2951.         SECTION test000000,CODE
  2952.         LEA    lbB00011E,A4
  2953.         LEA    lbB00011E,A1
  2954.         MOVE.L  lbL00012A,D0
  2955.         ...            ; rest of code
  2956.  
  2957.         SECTION test00011E,DATA
  2958.    lbB00011E    dc.b    'dos.library',0
  2959.    lbL00012A    dc.l    $00010001    ; This label will be created after
  2960.         END            ; left-Amiga mouse-button is used.
  2961.  
  2962. On the other hand, if you had selected "Convert  xx(An)  EA's/Relative",  the
  2963. effective  addresses would be shown as symbolic word offsets, and our example
  2964. program would look like this:
  2965.  
  2966.         SECTION test000000,CODE
  2967.         LEA    DT,A4        ; Note the new base label "DT"
  2968.         LEA    lbB00011E-DT(A4),A1
  2969.         MOVE.L  lbL00012A-DT(a4),D0
  2970.         ...            ; rest of code
  2971.  
  2972.         SECTION test00011E,DATA
  2973.    DT
  2974.    lbB00011E    dc.b    'dos.library',0
  2975.    lbL00012A    dc.l    $00010001    ; This label will be created after
  2976.         END            ; left-Amiga mouse-button is used.
  2977.  
  2978. The advantage here is that labels can automatically  be  created  where  they
  2979. could not before.  After more iterations, our code could look like this:
  2980.  
  2981.         SECTION test000000,CODE
  2982.         LEA    DT,A4
  2983.         LEA    DOSName-DT(A4),A1
  2984.         MOVE.L  Mem_Parms-DT(a4),D0
  2985.         ...            ; rest of code
  2986.  
  2987.         SECTION test00011E,DATA
  2988.    DT
  2989.    DOSName    dc.b    'dos.library',0
  2990.    Mem_Parms    dc.l    MEMF_CLEAR!MEMF_PUBLIC
  2991.         END
  2992.  
  2993. If this conversion process is not used, it is likely that  the  program  will
  2994. not  successfully re-assemble, as different assemblers will assemble the same
  2995. source code into  different  length  opcodes.   For  example,  the  Metacomco
  2996. assembler  normally  use  does  virtually no optimizing, and so the resulting
  2997. program  is  often  larger than the original, even if the source code has not
  2998. been modified.  For example, take the line:
  2999.  
  3000.         MOVE.L  4,A6
  3001.  
  3002. If absolute long addressing is used, the instruction above will  be  6  bytes
  3003. long,  whereas  if absolute short addressing is used, it will be only 4 bytes
  3004. long.  Where you wish to do EA conversions in only a portion  of  a  program,
  3005. you can set the lower and upper limits.
  3006.  
  3007. Changing to absolute EA's will increase the size of  the  resulting  program,
  3008. unless  you  convert  back to relative addressing, within the source code.  I
  3009. believe that one of the features of BLINK (from the Software Distillery)  can
  3010. help to make this conversion, during the link process.
  3011.  
  3012. This function will work for lines such as "MOVE.L #START+$xxxxxx,A5", as well
  3013. as the more usual "LEA START+$xxxxxx,A4".
  3014.  
  3015. Please note that this function may be used with  ANY  register  as  the  base
  3016. register.  See "SPECIAL FUNCTIONS/Specify Base Register" immediately below.
  3017.  
  3018. If the label, "DT", is not defined by the user, ReSource will define  it  for
  3019. you.   It  will  be attached to the last DATA hunk in the file, or if no DATA
  3020. hunks exists, the last BSS hunk, or failing that, the last CODE hunk.
  3021.  
  3022. 2.12.7.1   SPECIAL FUNCTIONS/Convert xx(An) EA's/Disable:
  3023. This function allows one to turn off base register conversions.
  3024.  
  3025. 2.12.8     SPECIAL FUNCTIONS/Specify Base Register/:
  3026. This function permits you to select the register to be used for base register
  3027. conversions.  See also "STRINGS/Put/Base register".
  3028.  
  3029. 2.12.9     SPECIAL FUNCTIONS/Convert specific EA's/:
  3030. Please read  and  understand  the  "SPECIAL  FUNCTIONS/Convert  xx(An)  EA's"
  3031. functions  first!   Where  you  want  to  do  specific EA (Effective Address)
  3032. conversions, use "Set base #1" (or #2, or #3), when the cursor is the same as
  3033. where the base register can be assumed to be pointing.  Assuming that you set
  3034. base #1, and it is the A5 register that is being used as a base register, you
  3035. will then use the "Convert W/Base #1" function to convert lines like:
  3036.  
  3037.         MOVE.L  $0032(A5),A6 into:
  3038.  
  3039.         MOVE.L  lbL0014AC(A5),A6
  3040.  
  3041. Note here that there has not actually been an EA conversion, but a label  has
  3042. been created, the data type at label "lbL0014AC" has been determined and set,
  3043. and  a  symbol ("lbL0014AC") has been created for this line.  It is up to you
  3044. then to make the necessary changes to  the  resulting  source  code,  if  re-
  3045. assembling  is required.  Whereas the "Convert xx(An) EA's" function converts
  3046. immediately and automatically, you must use the "Convert W/Base #1"  function
  3047. on  each  line that you want converted.  If you wish to convert a destination
  3048. address, use the "SYMBOLS 1/Set Source/dest/Destination" function first.
  3049.  
  3050. 2.12.10    SPECIAL FUNCTIONS/Data type set/:
  3051. These functions affect how  the  "SPECIAL  FUNCTIONS/Convert  specific  EA's"
  3052. functions  work.  When the data type must be determined, it can be automatic,
  3053. or you can force it to be set to Bytes, Words, Longwords, ASCII, Code.
  3054.  
  3055. 2.12.11    SPECIAL FUNCTIONS/Convert to../:
  3056. The setting here will determine the type of symbol created when the  "SPECIAL
  3057. FUNCTIONS/Convert  specific  EA's"  functions are used, either an Absolute or
  3058. Offset value.
  3059.  
  3060. 2.12.12    SPECIAL FUNCTIONS/Reloc32/:
  3061. Use these functions to specifically delocate or relocate  the  current  file.
  3062. This  is only useful if the file was loaded from an executable, where reloc32
  3063. information is present.  Be aware that relocation  is  performed  immediately
  3064. after  the  "PROJECT/O'lay  binary  image"  function, when a file is actually
  3065. loaded.
  3066.  
  3067. 2.13       SAVE/:
  3068. It is possible to append to files when saving, rather than  simply  replacing
  3069. them.   To  do  this, the filename that you supply must start with "*>".  For
  3070. example, if you wish to append information  to  the  file  "ram:MySavedFile",
  3071. when asked for a filename, you would type "*>ram:MySavedFile".  This is valid
  3072. for *any* file save, including screen saves, binary image saves, etc.
  3073.  
  3074. 2.13.1     SAVE/O/P Directory:
  3075. You will be asked to supply the name of a directory.  Whenever you are  asked
  3076. to  supply the name of a file to save source code to, the name will have this
  3077. directory name prepended to it.  For example, if you supply the string "RAM:"
  3078. as the output directory name, and the current filename is "c:stack", when you
  3079. select "SAVE/Save .asm/ALL", the new name to save to will be "RAM:stack.asm".
  3080.  
  3081. 2.13.2.1   SAVE/Partial save/Reset start:
  3082. The start for partial saves defaults  to  the  start  of  the  current  file.
  3083. Selecting this will restore the default value.
  3084.  
  3085. 2.13.2.1   SAVE/Partial save/Set start:
  3086. For  any  partial  saves,  the current cursor position when this function was
  3087. executed will be where the save will start from.  Make your desired  starting
  3088. point  the  current line and select this function.  By default, this position
  3089. is equivalent to the start of the file.
  3090.  
  3091. 2.13.2.2   SAVE/Partial save/Set end:
  3092. For any partial saves, the current cursor position  when  this  function  was
  3093. executed will be where the save will end.  Make your desired ending point the
  3094. current  line  and select this function.  If this happens to be the last line
  3095. in the file, any partial save will include  the  last  line.   Normally,  the
  3096. partial save will NOT include the line where the partial save end is set.
  3097.  
  3098. 2.13.2.4   SAVE/Partial save/Reset end:
  3099. The end for partial saves defaults to the end of the current file.  Selecting
  3100. this will restore the default value.
  3101.  
  3102. 2.13.3     SAVE/Save binary image/:
  3103. Save the current buffer contents "as-is", to a file.  If the file was  loaded
  3104. with "PROJECT/Open load file", and was NOT loaded as a binary image file, the
  3105. resulting  saved file will NOT be the same as that originally loaded, because
  3106. the loader information, and relocation information, has  been  stripped.   If
  3107. you  wish to load a file, and then save it exactly as it was loaded, you must
  3108. use "PROJECT/Open binary file".  Even though you may have disassembled memory
  3109. directly, or read tracks from a floppy disk, it does NOT stop you from saving
  3110. the binary image.  Once something is loaded into ReSource, it can be saved as
  3111. source code, as a binary image file, directly to memory, or it can be written
  3112. directly to a floppy disk,  to  a  specific  sector  or  track.   This  gives
  3113. fantastic  flexibility  for general hacking, for as little as one byte of the
  3114. current buffer can be saved to memory, to a binary image file, or  as  source
  3115. code.   Track writes must be in multiples of 512 bytes.  However the clipping
  3116. is done for you.
  3117.  
  3118. Save "Partial" is similar to the above function, except only the data between
  3119. the partial save start and the partial save end is saved.
  3120.  
  3121. 2.13.4     SAVE/Save .asm/:
  3122. You will be asked to supply the name of a file to save source  code  to,  for
  3123. the  entire  current buffer contents.  The output will be very similar to how
  3124. you see it on the display.
  3125.  
  3126. Save "Partial" is similar to the above function, except  only  the  code/data
  3127. between the partial save start and the partial save end is saved.
  3128.  
  3129. It is possible to abort from a "Save .asm", by using  the  normal  abort  key
  3130. sequence  (rAmiga-A).   The  file  will still be created, but no further text
  3131. will be saved to it.
  3132.  
  3133. When using "SAVE/Save .asm/Partial"  or  "SAVE/Calc  .asm  size/Partial",  no
  3134. EQUate or Xref table will be created.
  3135.  
  3136. During the functions "SAVE/Calculate .asm size/" and "SAVE/Save  .asm/",  for
  3137. any  lines  which  create code or data which will not assemble correctly (odd
  3138. address, "START+" references, invalid code "????"), an address will be pushed
  3139. onto the cursor stack, pointing to the start of each of these  lines.   Thus,
  3140. after  using  one of these functions, use "CURSOR/Absolute/Previous location"
  3141. to go directly to each erroneous line.  This is an excellent way  to  quickly
  3142. ensure that the source code you create will assemble properly.
  3143.  
  3144. You may have noticed a funny looking squiggle ";_[]" near the  start  of  the
  3145. source  output,  this  is  a  hook  for a profiler to be released in the near
  3146. future.
  3147.  
  3148. 2.13.5.1   SAVE/Calculate .asm size/ALL:
  3149. Calculates the size of the source code file that would result if you had used
  3150. the "SAVE/Save .asm/ALL" function.
  3151.  
  3152. 2.13.5.2   SAVE/Calculate .asm size/Partial:
  3153. Calculates the size of the source code file that would result if you had used
  3154. the "SAVE/Save .asm/Partial" function.  If "Start" and "End"  have  not  been
  3155. set  previously,  they  will  default  to the start and end of the file as it
  3156. exists in ReSource.
  3157.  
  3158. 2.13.6     SAVE/Save to memory/:
  3159. You will be asked to supply a memory address to  save  the  contents  of  the
  3160. current  buffer.   The  buffer  will  be  saved  "as-is"; NOT as disassembled
  3161. source.  Care should be taken with this function,  as  a  system  crash  will
  3162. likely  result  if  you  supply  the wrong address.  By finding out where the
  3163. current buffer is in memory, (by using "DISPLAY/Cursor Address/Absolute")  it
  3164. is  possible  to  copy  one part of the current buffer to another part.  This
  3165. will require judicious use of "SAVE/Save to memory/Partial".
  3166.  
  3167. Save "Partial" is similar to the above function, except that  only  the  data
  3168. between the partial save start and the partial save end is saved.
  3169.  
  3170. 2.13.7     SAVE/Save tracks/:
  3171. You will be asked for a string representing where to  start  writing  tracks.
  3172. The  first  parameter  you  give  must  be  either "DF0:", "DF1:", "DF2:", or
  3173. "DF3:". The second parameter is the starting cylinder to save to.  The  third
  3174. parameter  is optional, and represents an offset, in sectors, where the track
  3175. write is to start.  For example, to save sector #3 on cylinder 5 on DF2:, the
  3176. parameters required would be "DF2: 5 3".  To save  to  the  first  sector  on
  3177. DF0:,  the  parameters  required would be "DF0: 0".  Whole sector writes ONLY
  3178. are done, clipping is performed automatically.
  3179.  
  3180. Save "Partial" is similar to the above function, except that  only  the  data
  3181. between  the  partial  save  start  and  the  partial  save  end  is   saved.
  3182. Furthermore, only even multiples of 512 bytes will be written.  For  example,
  3183. if the partial save size is 1027 bytes, only two sectors (1024 bytes) will be
  3184. written to the disk.
  3185.  
  3186. 2.13.8     SAVE/Save screen:
  3187. This function will prompt you for the name of a file.  If  the  file  can  be
  3188. opened,  it will save the currently displayed text to that file.  Use this to
  3189. send a screen dump to the printer, or any other file.  Note that this can  be
  3190. used at the completion of a "save .asm", to get a printout of the source code
  3191. profile.   Almost  any function will cause a display refresh, so this must be
  3192. the first function used.  If you have to re-activate  ReSource's  window  for
  3193. any  reason,  in  order  to  avoid  refreshing  the display (and erasing this
  3194. information in doing so), place the mouse pointer at the extreme left edge of
  3195. the screen, then press the LMB.
  3196.  
  3197. 2.13.9     SAVE/Tabs/:
  3198. Use to select between real tabs (ASCII value 9) and spaces being used in  the
  3199. output source code as separators.
  3200.  
  3201. 2.13.10    SAVE/Symbol table/:
  3202. When creating symbols, either automatically or manually, if  the  setting  of
  3203. this  function  is  to something other than "None", the value and name of the
  3204. symbol is stored, so that when the source code is saved, an equate table,  or
  3205. XREF  table  can be generated.  If this function is set to "EQUate", a symbol
  3206. table similar to the following will precede the source  code  in  the  output
  3207. file:
  3208.  
  3209.    AG_OpenLib      EQU     $00030000
  3210.    AO_DOSLib        EQU     $00008007
  3211.    AT_Recovery     EQU     $00000000
  3212.    _LVOAlert        EQU     $FFFFFF94
  3213.    _LVOClose        EQU     $FFFFFFDC
  3214.    _LVOCreateProc  EQU     $FFFFFF76
  3215.    _LVOCurrentDir  EQU     $FFFFFF82
  3216.  
  3217. If, instead, this function is set to "XREF", a symbol table  similar  to  the
  3218. following will preceed the source code in the output file:
  3219.  
  3220.             XREF    AG_OpenLib
  3221.             XREF    AO_DOSLib
  3222.             XREF    AT_Recovery
  3223.             XREF    _LVOAlert
  3224.             XREF    _LVOClose
  3225.             XREF    _LVOCreateProc
  3226.             XREF    _LVOCurrentDir
  3227.  
  3228. 2.14.1     OPTIONS 1/Show offsets/:
  3229. For lines displayed without labels, the current  offset  (relative  from  the
  3230. start  of  the  file) will be displayed where the label is usually displayed.
  3231. If "DISPLAY/Set counter" is used, offsets  will  be  relative  to  where  the
  3232. counter was set.  Do not save your source for reassembly with  this  function
  3233. enabled as it will cause your source to not assemble properly.
  3234.  
  3235. 2.14.2     OPTIONS 1/Display beep/:
  3236. Many functions demand attention from the user, and a  DisplayBeep()  is  used
  3237. for  this  purpose.   Normally, this will make the screen flash.  However, if
  3238. you have run the program "BeepIt", or a  similar  DisplayBeep()  replacement,
  3239. you  will  hear an audible "beep" instead.  If you don't appreciate the beep,
  3240. then switch it off.
  3241.  
  3242. 2.14.3     OPTIONS 1/User feedback/:
  3243. Many functions will give informative messages, to let the user know  what  is
  3244. happening  internally.   If you don't appreciate the feedback, then switch it
  3245. off.
  3246.  
  3247. 2.14.4     OPTIONS 1/Feedback Delays/:
  3248. If you have User feedback set to "OFF", then the setting of this function  is
  3249. irrelevant.   If  feedback  is  ON,  you  may occasionally find that feedback
  3250. messages are being displayed  too  fast  for  you  to  read  them.   This  is
  3251. especially  so  when opening a load file, since as many as thirty informative
  3252. messages can be displayed in between raster scans, which means that you don't
  3253. actually get to see any of the messages at all.   If  normal  text  rendering
  3254. were used, rather than using the special rendering routines in ReSource, this
  3255. would  probably  not be a problem, as the writing of the text itself would be
  3256. done much slower, and you would probably get time to read at  least  some  of
  3257. the messages.  If you set feedback delays to "ON", there will be a one second
  3258. delay after each message is displayed, which should be plenty of time to read
  3259. each  message.   While  you  hold the menu button down, feedback messages are
  3260. skipped altogether.
  3261.  
  3262. 2.14.5     OPTIONS 1/Labels/:
  3263. If this option is set to ON, labels will be displayed.  This is the default.
  3264.  
  3265. 2.14.6     OPTIONS 1/Hidden labels/:
  3266. If this option is set to ON, hidden labels (labels attached to a byte in  the
  3267. middle of a line of code/data) will be displayed.  This is the default.
  3268.  
  3269. 2.14.7     OPTIONS 1/Symbols/:
  3270. If this option is set to ON, symbols will be displayed.  This is the default.
  3271.  
  3272. 2.14.8     OPTIONS 1/End-of-line comments/:
  3273. If this option is set to ON, end-of-line comments will be displayed.  This is
  3274. the default.
  3275.  
  3276. 2.14.9     OPTIONS 1/Full-line comments/:
  3277. If this option is set to ON, full-line comments will be displayed.   This  is
  3278. the default.
  3279.  
  3280. 2.14.10    OPTIONS 1/Chip-load info/:
  3281. If this option is set to ON, where a section statement is displayed, and that
  3282. section either is forced to load into chip memory, or is forced to load  into
  3283. fast  memory, a ",CHIP" or ",FAST" will be appended to the section statement.
  3284. Not all assemblers support this parameter for the section statement,  so  you
  3285. may want to switch this option OFF if your assembler can't handle it.
  3286.  
  3287. 2.14.11    OPTIONS 1/Section statements/:
  3288. If this option is set to ON, section statements will be displayed.   This  is
  3289. the default.
  3290.  
  3291. 2.14.12    OPTIONS 1/End statement/:
  3292. If this option is set to ON, the "END" statement will  be  displayed  as  the
  3293. last line in the file.  This is the default.
  3294.  
  3295. 2.14.13    OPTIONS 1/DCB statements/:
  3296. If this option is set to  ON,  "dcb"  type  statements  will  be  used  where
  3297. appropriate.  This is NOT the default.  For example, the following data:
  3298.  
  3299.         dc.b    0
  3300.         dc.b    0
  3301.         dc.l    7
  3302.         dc.l    8
  3303.         dc.l    8
  3304.         dc.l    8
  3305.         dc.l    8
  3306.         dc.l    8
  3307.         dc.l    8
  3308.  
  3309. will be shown as:
  3310.  
  3311.         dcb.b    2,0
  3312.         dc.l    7
  3313.         dcb.l    6,8
  3314.  
  3315. This is useful for shrinking the required .asm file  size,  especially  where
  3316. there are large areas of zeroes.
  3317.  
  3318. 2.14.14    OPTIONS 1/Reference recognition/:
  3319. If this option is set to  ON,  references  to  memory  locations  within  the
  3320. current file are recognized.  For example, assuming that the absolute address
  3321. of  the start of the current file is at $200000, the following lines might be
  3322. displayed with Reference recognition ON:
  3323.  
  3324.         dc.l    $48638335
  3325.         dc.l    START+$1097
  3326.         dc.l    START+$3086
  3327.  
  3328. whereas if reference recognition was OFF, it would be displayed as:
  3329.  
  3330.         dc.l    $48638335
  3331.         dc.l    $201097
  3332.         dc.l    $203086
  3333.  
  3334. Reference recognition is ON by default.  If any pointer (32  bits)  is  in  a
  3335. reloc32  area,  the reference will be recognized regardless of the setting of
  3336. this option.
  3337.  
  3338. 2.15.1     OPTIONS 2/Short branches/:
  3339. If this option is set to ON, any short branches will be  displayed  as  such,
  3340. with  the  ".S" appended to the opcode.  This is the default.  Note that this
  3341. option will NOT show you all POSSIBLE short branches,  only  those  that  are
  3342. already present in the code that's being disassembled.
  3343.  
  3344. 2.15.2     OPTIONS 2/Separate labels/:
  3345. Under normal conditions, if a label is  longer  than  20  characters,  it  is
  3346. broken at that point, and the remainder is shown  on  the  next  line.   This
  3347. option  forces the entire label, regardless of its length, to be shown on one
  3348. line.
  3349.  
  3350. 2.15.3     OPTIONS 2/Label colons/:
  3351. This option will display colons ,":", after all labels.
  3352.  
  3353. 2.15.4     OPTIONS 2/Leading zeroes/:
  3354. Use these options to specify whether or not you wish the  leading  zeroes  on
  3355. hex values to be shown, e.g., "$0000003A" versus "$3A".
  3356.  
  3357. 2.15.5.1   OPTIONS 2/Assembler/Metacomco:
  3358. This function specifies output suitable for the  Metacomco  assembler.   This
  3359. works with CAPE(TM) as well, although smaller files will result with CAPE(TM)
  3360. output.
  3361.  
  3362. 2.15.5.2   OPTIONS 2/Assembler/CAPE:
  3363. This  function   specifies   output  suitable  for  the  CAPE(TM)  assembler.
  3364. Currently,  "dc.b" will be shown as "db", "dc.w" is shown as "dw", and "dc.l"
  3365. is shown as "dl".
  3366.  
  3367. When the selected assembler type  is  "Cape"  or  "CaPatch",  the  directives
  3368. "bnryonly", "exeobj" and "objfile" are used where appropriate.
  3369.  
  3370. 2.15.5.3   OPTIONS 2/Assembler/CaPatch:
  3371. Source code produced for this assembler uses the "DX" directive,  to  support
  3372. uninitialized data areas.  This is the extra space at the end of data or code
  3373. hunks,  that  appears to be BSS, but is actually attached to the data or code
  3374. hunk.  Other assemblers would use the "DS" directive instead, which makes the
  3375. resulting program much larger than the original.   This  was  not  previously
  3376. available to assembly language programmers.
  3377.  
  3378. 2.15.6     OPTIONS 2/Auto labels/:
  3379. This  function   determines   whether  the  "LABELS/Create  multiple/Reloc32"
  3380. function is called automatically after every "Open load file".
  3381.  
  3382. 2.15.7     OPTIONS 2/Verbose saves/:
  3383. The "SAVE/Save .asm" functions give you a profile of the source code as it is
  3384. saved.  This may be disabled by selecting the  new  "OPTIONS2/Verbose  saves/
  3385. OFF"  function.   Each  entry  in  the  displayed  table  is  counted as that
  3386. condition occurs during the save, and the totals are displayed  continuously.
  3387. It is possible to get a printout of this and any other  screen  in  ReSource,
  3388. using  the  new  "SAVE/Save  screen" function (see below).  Speed penalty for
  3389. enabling this function is approx. 20%.
  3390.  
  3391. 2.15.8     OPTIONS 2/Multiple constants/:
  3392. For byte, word, and longword lines, this option allows you to have many  data
  3393. constants  displayed on each line, rather than just one.  ReSource will limit
  3394. the number of constants to your display width.
  3395.  
  3396. 2.16        KEY BINDINGS/:
  3397. Every function in ReSource can be found in the menus.  You do not need to use
  3398. any keys at all, but you probably will want to.  You can bind any function to
  3399. any key, however there is just one function that makes no  sense  to  rebind,
  3400. and that is the "PROJECT/Abort" function.  Both Amiga-keys are supported, you
  3401. may use shift, alt, ctrl, lAmiga, rAmiga, shift-alt, shift-ctrl, alt-ctrl, or
  3402. shift-alt-ctrl, in  combination with any non-qualifier key, as a distinct key
  3403. to which to bind a function.  You may, of course, also use non-qualifier keys
  3404. by themselves.  Thus, you have complete control  over  which  keys  do  what.
  3405. After  re-binding some keys, you will probably want to save the keytable.  If
  3406. you save the keytable as "S:RS.keytable", it will be loaded  every  time  you
  3407. run  ReSource.   You may want to create several keytables, suitable for doing
  3408. differing program types (C, assembler, etc.). If a keytable file  is  loaded,
  3409. ALL  current  key bindings will be overwritten by the bindings present in the
  3410. keytable.  If you  don't  load  any  keytable,  and  ReSource  couldn't  find
  3411. "S:RS.Keytable" when you first ran it, some keys will still be bound:
  3412.  
  3413.     right-Amiga Q        PROJECT/Quit
  3414.     right-Amiga O        Open load file
  3415.     up arrow        CURSOR/Relative/Next line
  3416.     down arrow        CURSOR/Relative/Previous line
  3417.     right arrow        CURSOR/Absolute/Fwd reference
  3418.     left arrow        CURSOR/Absolute/Previous location
  3419.     shift-up arrow      CURSOR/Relative/Previous page
  3420.     shift-down arrow    CURSOR/Relative/Next page
  3421.  
  3422. To rebind a key, select "KEY BINDING/Rebind key", and follow the  prompts  in
  3423. the title bar.
  3424.  
  3425. 2.17        Credits
  3426. This  manual  was written by Glen McDiarmid, the author of ReSource, and Jeff
  3427. Lavin.
  3428.  
  3429. Layout  and   typesetting  done  by  Jeff  Lavin  on  an  Amiga  1000,  using
  3430. Professional Page, and an NEC SilentWriter LC 890.
  3431.  
  3432. Much thanks to Doug Sears  and  Grace  Lavin  for  ideas,  proofreading,  and
  3433. general support.
  3434.  
  3435. Printing done by Eugene Print of Eugene, Oregon.
  3436.  
  3437. Index
  3438.