home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_disks / 100-199 / ff192.lzh / ReSourceDemo / ReSource.doc < prev    next >
Text File  |  1989-03-14  |  45KB  |  968 lines

  1.       Documentation for ReSource (C) 1988 Glen McDiarmid
  2.       
  3.       TO GET STARTED QUICKLY:
  4.       ****************************************************************
  5.       Don't forget to put arp.library in your LIBS: directory!
  6.       ****************************************************************
  7.       Run ReSource from a CLI, and when you are presented with a file
  8.       requester, select an executable file to disassemble (anything
  9.       within your "C" directory will do nicely).  Alternatively, you
  10.       may disassemble Kickstart by supplying a filename of "*".  Once
  11.       loaded, you may scroll forwards/backwards through the file with
  12.       the down/up arrow keys.  Using the shift key with the up/down
  13.       arrow keys will move you faster through the file.  You may also
  14.       use mouse-scrolling, by holding the left mouse button down, then
  15.       SLOWLY moving the mouse forwards or backwards, depending on which
  16.       way you want to move through the file.  While moving forwards
  17.       with the mouse, holding the left Amiga key down will start the
  18.       label creation process, in a controlled manner.  When labels are
  19.       created, ReSource decides which type of data is being labelled,
  20.       and it is generally correct in its judgement.  Once you have made
  21.       some labels, select the 'Fill-in data types' menu item, under the
  22.       "DISPLAY" menu.  Once you have created labels from all areas of
  23.       code, select 'Fill-in data types' again, and you may then scroll
  24.       through the file, checking for yourself that all is in order
  25.       (there will occasionally be cases where ReSource made an
  26.       incorrect judgement, and code made be shown as ASCII, or vice-
  27.       versa).  Use one of the "Set data types" sub-menu selections, to
  28.       set the correct data type.  Remember to use the "Fill-in data
  29.       types" command again, so that code and data are shown correctly.
  30.       
  31.       If you are working on a large file, you may wish to save your
  32.       work, so that you can continue it at a later time.  To do this,
  33.       select "save all" under the "PROJECT" menu.  When you use the
  34.       "save all" option, you are creating a "ReSource file", as it is
  35.       only useable by ReSource.  By default, the filename will end in
  36.       ".RS".  You may change this if you like.
  37.       
  38.       ****************************************************************
  39.       ABOUT RESOURCE:
  40.       ReSource is an interactive disassembler.  To give you an idea of
  41.       which files can and cannot be disassembled, the following is a
  42.       list of files from a Workbench 1.2 disk, that ReSource can
  43.       disassemble:
  44.       C directory: all
  45.       L directory: all
  46.       LIBS directory: all
  47.       DEMOS directory: Boxes, Dots, Spots
  48.       SYSTEM directory: CLI, DiskCopy, Format, GraphicDump, IconEd,
  49.       Say, SetMap.
  50.       DEVS directory: all keymaps, all printer drivers, everything
  51.       ending in ".device".
  52.       FONTS directory: everything within sub-directories
  53.       (topaz/11,emerald/17, etc.)
  54.       UTILITIES directory: Calculator, Notepad
  55.       ROOT directory: Preferences, Clock
  56.       
  57.  
  58.  
  59.  
  60.  
  61.  
  62.              
  63.       
  64.       
  65.       
  66.       
  67.       I personally wanted a good disassembler to fix bugs in many of
  68.       the public domain programs that I use.  I was also interested in
  69.       getting to know how C programs worked, at the assembly language
  70.       level.  ReSource is the result of 3 and a half months full-time
  71.       effort; during this time I have been using each version
  72.       extensively.  I am very impatient when it comes to waiting for
  73.       programs to complete operations, this has resulted in a
  74.       disassembler that is extremely fast, at the cost of memory usage.
  75.       Even though ReSource was written purely in assembly language, it
  76.       uses lots of memory, especially when disassembling large
  77.       programs.  Generally, if you have 1.5 Megs of memory, you will be
  78.       able to disassemble most programs.  To disassemble Kickstart, you
  79.       will require at least 2 Megs if you have a hard drive, or 3.5
  80.       Megs if you do not have a hard drive.  As a further condition,
  81.       there must be at least 1.1 Megs of contiguous memory, for the
  82.       attributes table. 
  83.       ****************************************************************
  84.       GENERAL USAGE:
  85.       ****************************************************************
  86.       Don't forget to put arp.library in your LIBS: directory!
  87.       ****************************************************************
  88.       Disassembling a program consists of examining a load file
  89.       (sometimes called "executable" or "object" files), and from the
  90.       information contained therein, create a text file (assembler
  91.       source code) which, when assembled, can be used identically to
  92.       the original load file.  It takes many, often hundreds, of hours
  93.       of painstaking work to become proficient at disassembling even a
  94.       small program manually.  Even experts can spend many hours
  95.       disassembling very small programs, while large Amiga programs may
  96.       take weeks.  From now on, this will not be the case with Amiga
  97.       programs.  Large programs (100K or larger) can be disassembled in
  98.       an evening, while small programs (such as CD, PROMPT, AVAIL,
  99.       ECHO, FILENOTE, etc., take around 3-5 seconds to produce re-
  100.       assemblable source code.
  101.       
  102.       As an example, let's disassemble LoadWB, which you'll find in the
  103.       C directory of just about any booting disk, including a standard
  104.       Workbench disk (make sure that it comes from a V1.2 Workbench,
  105.       not 1.1 or 1.3!  At the CLI prompt, type:
  106.       
  107.       RUN RS C:LOADWB
  108.       
  109.       You don't really have to use the "run" command, but I find it
  110.       convenient, so maybe you will too.  When ReSource starts running,
  111.       it will load the file "loadwb" from the C directory, and
  112.       disassemble the first page for you.  We can now start the label-
  113.       creation process.  This involves getting ReSource to examine
  114.       lines of code, and on each line, if there is any reference to
  115.       another part of the program, ReSource will decide which type of
  116.       data is being referenced.  For example, the first line of code in
  117.       our program is:
  118.       
  119.               MOVE.L  SP,START+$01E0
  120.              
  121.       
  122.       
  123.       
  124.       
  125.       Okay, go to the menus, under "LABELS" menu, you'll find "Create
  126.       single".  A sub-menu box will pop out, and from this, select
  127.       "Address symbol dest".  Now, the first line of code in our
  128.       program should be:
  129.       
  130.               MOVE.L  SP,lbL0001E0
  131.       
  132.       Now, scroll forward through the program (using shift-down arrow),
  133.       until you find a line starting with "lbL0001E0":
  134.       
  135.       lbL0001E0       dc.l    0
  136.       
  137.       The label "lbL0001E0" is something that ReSource has just now
  138.       created.  In this case, ReSource decided that the data being
  139.       referenced was a Longword, hence the "L" in "lbL0001E0".  If it
  140.       was code that was being referenced, the label would have been
  141.       "lbC0001E0" instead.  There are five type of data recognized by
  142.       ReSource:
  143.       
  144.       ASCII - CODE - BYTES - WORDS - LONGWORDS
  145.       
  146.       The processes involved in deciding which type of data is being
  147.       referenced is quite complex, and such things as the surrounding
  148.       code/data, the relative position of reloc32 areas, hunk types,
  149.       relative position from the start of a hunk, the actual
  150.       information being referenced, whether the data is word/longword
  151.       aligned, the actual instruction from which the reference was
  152.       derived, the proximity of other labels, and what data types they
  153.       refer to, all take part in the decision-making process.  If the
  154.       first line of code in out program had been:
  155.       
  156.               MOVE.W  SP,START+$01E0
  157.       
  158.       , then the label created would have been "lbW0001E0" instead, and
  159.       the data type at this label would have been set to words.  If you
  160.       like, you can manually set the data type of any byte in the
  161.       program, by selecting a sub-menu item from the "Set data type"
  162.       menu item, under "DISPLAY" in the menus.  This will not create a
  163.       label, but it will re-define the current byte within the file (on
  164.       the top line of the display) as being ASCII, CODE, or whichever
  165.       data type you selected.  Generally, this is not required, except
  166.       sometimes in large programs, but after letting ReSource do its
  167.       thing first.  If you like doing things with the mouse, you can
  168.       even set the data type this way.  Once you have mastered mouse
  169.       scrolling, try holding down the left-shift key while still
  170.       holding down the left mouse button.  This will display everything
  171.       as if it were set to the data type BYTES.  Holding down the left
  172.       alt key will display everything as if it were set to ASCII. 
  173.       Similarly, the left shift and left alt keys held down together to
  174.       show everything in WORDs; hold down the ctl key and everything
  175.       will be displayed as CODE.  Hold down all three, and everything
  176.       will be shown as LONGWORDS.  If you decide make this data type
  177.       permanent, press the menu button, and the current position within
  178.       the program will be set to the data type currently being
  179.       displayed.  By holding down the right alt key, you can remove
  180.       labels while scrolling.
  181.              
  182.       
  183.       
  184.       
  185.       
  186.       Now scroll back to the start of the program (select "Start of
  187.       file" submenuitem, under the "Absolute" menuitem under the
  188.       "CURSOR" menu).  Alternatively, just use the up arrow key, to
  189.       scroll back slowly.  Look in the screen title bar to find out how
  190.       far you are from the start of the file.  This offset is being
  191.       shown in hexdecimal.  Now, use the down arrow key to scroll
  192.       forward to the second line of code in our program:
  193.       
  194.               MOVE.L  D0,START+$01E8
  195.       
  196.       Again, select the "Address symbol dest" submenuitem, to create
  197.       the label "lbL0001E8".  Do this to as many lines of code as you
  198.       like, so that you become familiar with the label creating
  199.       process.  What you have just done can be done far quicker, by
  200.       using the "Create multiple" label functions.  Firstly, select the
  201.       "Open" menuitem, under "PROJECT" in the menus.  Again, we will
  202.       use "LoadWB" from within your C directory.  Once it is loaded,
  203.       look in the menu under "LABELS", go to the menuitem "Create
  204.       multiple", and select "All" from the sub-menuitem box.  Around
  205.       three quarters of a second later, you should be at position
  206.       "0001C8" relative from the start of the file.  The top line of
  207.       the display should read:
  208.       
  209.       lbL0001C8       dc.l    0
  210.       
  211.       If this is correct, you should now find some more code to make
  212.       labels from.  To do this, you could use the down arrow key to
  213.       scroll forward, the shift-arrow key to page forward, or let
  214.       ReSource do the searching for you, by selecting "Next unparsed
  215.       code" from the "CURSOR" menu.  If there is no more code that has
  216.       not been parsed, you will be returned to the start of the file. 
  217.       However in this case, there is more code to parse, so go to it! 
  218.       When eventually "Next unparsed code" returns you to the start of
  219.       the file, slowly scroll through the file, and examine as you go. 
  220.       You should find some ASCII, but it isn't being shown like it
  221.       really should.  This is the time to select "Fill-in data types"
  222.       from the "DISPLAY" menu.
  223.       
  224.       Okay, now the program is completely disassembled right?  Well,
  225.       nearly.  If you followed the above instructions to the letter,
  226.       there will be once more section of code that labels have NOT been
  227.       created from.  This will be at offset "000584".  This is because
  228.       this area of the program was only recognized as code, after it
  229.       had been skipped over.  In fact, the only reference to this part
  230.       of the program is made at offset "0005E6", and the code is:
  231.       
  232.               JSR     lbC000584
  233.       
  234.       Again, create multiple labels within this area, and search for
  235.       the next unparsed code.  If you select "Next unparsed code" while
  236.       at the start of the file, and ReSource cannot find any, then
  237.       again select "Fill-in data types", and this should complete the
  238.       disassembly of LoadWB.
  239.       
  240.              
  241.       
  242.       
  243.       
  244.       Actually, at this point, I generally will change some of the
  245.       labels, so that they are meaningful.  For instance, the first
  246.       line of code places the contents of the SP register at
  247.       "lbL0001E0", right?  Scroll forward to the line starting with
  248.       this label, and select "Address symbol" submenuitem, from the
  249.       "Create single" menuitem, under "LABELS" menu.  You will be
  250.       requested to input a new label name.  I would call this label
  251.       "SaveSP"; you call it anything you like.  Now, scroll backwards
  252.       to the offset "0000D2":
  253.       
  254.               MOVE.L  SaveSP,SP
  255.       
  256.       We didn't change this line, so what is going on?  You have just
  257.       witnessed one of the major benefits of an interactive
  258.       disassembler; any label changes you make are reflected throughout
  259.       the entire program, instantly.  Anywhere else in the program that
  260.       you can place a meaningful label, will help greatly in
  261.       recognizing how a program executes, without actually executing
  262.       it.  Also, if you wish to make changes to the source, meaningful
  263.       labels help greatly.  While still within ReSource, you may add
  264.       comments, both full-line, and end-of-line, to aid in the
  265.       understanding of the program. 
  266.       ****************************************************************
  267.       EXPLANATION OF FUNCTIONS:
  268.       The following section gives details of the uses of each function,
  269.       as they are shown in the menus.  Not all functions are enabled in
  270.       all versions, this is especially so in V0.x (demo version).
  271.       
  272.       PROJECT/Abort:
  273.               Use this to abort out of most functions.
  274.       
  275.       PROJECT/Open:
  276.               Requests you to select a file to open.  Use this function
  277.       to load executable files, as well as ReSource files.
  278.       
  279.       PROJECT/Restore:
  280.               Same as PROJECT/Open, but assumes that you wish to open
  281.       the same file as you last opened.
  282.       
  283.       PROJECT/Save .RS:
  284.               Saves the file that you are currently working on, in a
  285.       form useable only by ReSource.  Also saves the current location
  286.       with the file.  To continue work on the file later, use the
  287.       PROJECT/Open function.
  288.       
  289.       PROJECT/About:
  290.               Gives you some specific details about the version of
  291.       ReSource that you are currently using.
  292.       
  293.       PROJECT/Quit:
  294.               Asks you for confirmation, then quits without saving.
  295.       
  296.       OUTPUT/Save .asm:
  297.               Saves current file in assembler source code format.
  298.       
  299.              
  300.       
  301.       
  302.       
  303.       OUTPUT/O/P directory:
  304.               Requests you to supply the name of a directory that .asm
  305.       files will be sent to (you can still change this when you supply
  306.       the name of the output file, it just makes it easier if you are
  307.       disassembling many files).
  308.       
  309.       OUTPUT/Tabs:
  310.               Use to select between real tabs (ASCII value 9) and
  311.       spaces being used in the output source code.
  312.       
  313.       DISPLAY/Hiliting:
  314.               Selective use of inverse video can be useful to give
  315.       extra information about parts of a file.  For instance, you may
  316.       want to get a quick idea of which parts of a file came from a BSS
  317.       hunk, rather than CODE or DATA hunks.  To do this, select
  318.       DISPLAY/Hiliting/BSS hunks.
  319.       
  320.       DISPLAY/Hiliting/Reloc32:
  321.               I find it particularly useful to hilite the Reloc32
  322.       areas, especially when determining data types (reloc32 is
  323.       documented in the Amiga technical reference manual.  It
  324.       ultimately means that a number of longwords in the file point to
  325.       somewhere in memory, relative to the start of one of the hunks of
  326.       the file.  This almost always end up being somewhere within the
  327.       file.  This information helps ReSource greatly when defining data
  328.       types).
  329.       
  330.       DISPLAY/Hiliting/Chip load hunks:
  331.               Certain hunks of a load file may only be loaded into chip
  332.       memory.  Usually, graphics, especially sprites, will be included
  333.       in one of these special hunks, and this information is sometimes
  334.       useful, especially when you intend to re-assemble the file. 
  335.       "Chip load hunks" will hilite these hunks for you, also fast load
  336.       hunks may be hilited.
  337.       
  338.       DISPLAY/Hiliting/Symbol scan:
  339.               For all lines that you have created labels from, these
  340.       lines will be hilited.
  341.       
  342.       DISPLAY/Hiliting/Data type uncertain:
  343.               For most labels that ReSource creates automatically, it
  344.       is certain of the data type that it assigns.  Sometimes though,
  345.       it cannot be 100% sure, and this function will hilite all lines
  346.       that fall into this category.
  347.       
  348.       DISPLAY/Hiliting/Data type known:
  349.               Similar to above function, only the lines where the
  350.       ReSource was certain of the data type, will be hilited.
  351.       
  352.       DISPLAY/Hiliting/Internally produced refs:
  353.               All lines which have a label that was created by
  354.       ReSource, will be hilited.
  355.       
  356.       DISPLAY/Set data type:
  357.               When you are certain of which type of data that you are
  358.       looking at, select from one of the submenu items:
  359.       Code - Ascii - Bytes - Words - Longwords
  360.       
  361.              
  362.       
  363.       
  364.       
  365.       DISPLAY/Set numeric base:
  366.               By default, all numbers are shown in hexdecimal (base
  367.       16).  You can change this to ASCII, DECIMAL or BINARY on any line
  368.       by selecting from the appropriate sub-menu item.  To change back
  369.       to HEXDECIMAL, simply select the same function again.  It is
  370.       possible to change the default to decimal for numbers less than
  371.       16, or less than 10, using the decimal conversion function (see
  372.       below).
  373.       
  374.       DISPLAY/Decimal conversion:
  375.               By default, all numbers are show in hexdecimal.  You can
  376.       have numbers less than 16, or numbers less than 10, shown in
  377.       decimal throughout the file, by selecting one of the appropriate
  378.       sub-menu items.
  379.       
  380.       DISPLAY/Block-fill:
  381.               This function will probably not get much use.  It can be
  382.       used to set the data type of blocks of data.  For example, in a
  383.       particular file, there may a large section of code, maybe 100K or
  384.       so, and rather than rely on ReSource to make the correct
  385.       judgement of data type every time, you can set the data type of
  386.       every byte in the file to code, by doing the following:  Scroll
  387.       to the start of the block.  Set the data type here to CODE. 
  388.       Select the "CURSOR/Remember" function.  Now, scroll to the end of
  389.       the block (don't use any function that stacks the cursor
  390.       position, such as "CURSOR/Absolute/End of file", as this will
  391.       change the remembered offset.  When you get to the end of the
  392.       block, select the "DISPLAY/Block-fill" function.  The type of
  393.       data at the start of the block will be echoed throughout the
  394.       entire block.
  395.       
  396.       DISPLAY/Fill-in data types:
  397.               This function has several uses, and will be one of the
  398.       most-used functions.  To understand what this function does, you
  399.       will need to know how ReSource keeps track of data types (see
  400.       section "Inside ReSource").  Suffice it to say, when you set the
  401.       data type anywhere within a file, that data type is immediately
  402.       echoed forward, to a maximum of several hundred bytes, but will
  403.       not change any other places where the data type has already been
  404.       set, or where there is an address symbol (label) on a line. 
  405.       Where there is large areas of a file where the data type has not
  406.       been set, this function attempts to set the data type where
  407.       appropriate.  All of the above is done in the first pass.  On the
  408.       second pass, the length of each line is set, this is particularly
  409.       useful where there is large areas of ASCII.  This function should
  410.       always be used just before saving a file as source code (OUTPUT/
  411.       Save .asm).
  412.       
  413.       DISPLAY/Set counter:
  414.               The current offset in a file is always shown in the title
  415.       bar, in hexdecimal.  This is normal zero at the start of the
  416.       file.  You can change this, so that it is zero at somewhere other
  417.       than the start of the file, by using this function.  You may use
  418.       this function to measure the size of a hunk, for example.  To
  419.       "reset" the counter, use the function "DISPLAY/Reset counter".
  420.       
  421.       DISPLAY/Reset counter:
  422.               Resets the offset counter, in the title bar, so that it
  423.       is zero at the start of the file.  See "DISPLAY/Set counter".
  424.       
  425.              
  426.       
  427.       
  428.       
  429.       SYMBOLS:
  430.               When you create an assembly-language program, if you wish
  431.       to allocate some memory, you will probably have somewhere in you
  432.       file:
  433.       
  434.               JSR     _LVOAllocMem(A6)
  435.       
  436.       If you were to disassemble this program, this line of code would
  437.       be show as:
  438.       
  439.               JSR     -$0228(A6)
  440.       
  441.       , which is not particularly meaningful.  When disassembling a
  442.       program, if you can figure out which library base the A6 register
  443.       is pointing to (in this case, it would be the EXEC library), you
  444.       can get ReSource to make the appropriate substitution.  In this
  445.       example, you would select "SYMBOLS/E-G/Exec library".  Following
  446.       is another example:
  447.       
  448.               MOVE.L  #$00038007,D7
  449.               MOVE.L  4,A6
  450.               JSR     -$006C(A6)
  451.       
  452.       The second line loads Execbase into the A6 register, so you
  453.       should move the third line to the top of the display, and select
  454.       "SYMBOLS/E-G/Exec library".  Scroll back a couple of lines, and
  455.       you would see:
  456.       
  457.               MOVE.L  #$00038007,D7
  458.               MOVE.L  4,A6
  459.               JSR     _LVOAlert(A6)
  460.       
  461.       If you looked at the documentation for the Exec "Alert" call, you
  462.       would find that one of the input parameters is required to be in
  463.       the D7 register.  If you then looked in the include file "exec/
  464.       alerts.i", you would find that the number "$00038007" consists of
  465.       three values, OR'd together:
  466.       
  467.       AT_Recovery  -  AG_OpenLib  -  AO_DOSLib
  468.       
  469.       There is no need to go to all this trouble, simple line up the
  470.       first line with the top of the display, and select "SYMBOLS/A-B/
  471.       Alert codes", and ReSource will make the appropriate
  472.       substituition for you:
  473.       
  474.               MOVE.L  #AT_Recovery!AG_OpenLib!AO_DOSLib,D7
  475.               MOVE.L  4,A6
  476.               JSR     _LVOAlert(A6)
  477.       
  478.       Now isn't that much better than the original?  There are over 200
  479.       different classes of symbols that ReSource can substitute (only
  480.       two are enabled in the demo version).
  481.       
  482.               Consider the following lines of code:
  483.       
  484.               MOVE.L  4,A4
  485.               MOVE.L  #$100000,$003A(A4)
  486.       
  487.              
  488.       
  489.       
  490.       
  491.       Let's assume that you wish to substitute a symbol for the "$003A"
  492.       in the second line of code.  By default, ReSource will attempt to
  493.       substitute a symbol for the first number that it finds in a line
  494.       of code.  To change this, select "SYMBOLS/Set source/dest/
  495.       Destination", and then the appropriate symbol base (Exec library,
  496.       in this example).
  497.       
  498.       CURSOR/Remember:
  499.               Where it is possible to lose your place within a file by
  500.       using certain functions (such as "CURSOR/Absolute/Start of
  501.       file"), ReSource will store the current cursor location, just
  502.       prior to the function being executed.  To return to the previous
  503.       cursor location, select "CURSOR/Absolute/Previous location". 
  504.       When you plan to return to a specific place within the file,
  505.       using this function will make it easier to do so.  It simply
  506.       stores the cursor location on a stack, for later access.
  507.       
  508.       CURSOR/Clear Loc stack:
  509.               The cursor location stack can contain up to 256
  510.       locations.  If more locations are "pushed" onto this stack, the
  511.       location at the bottom (the oldest) are forgotten.  This function
  512.       will empty the cursor location stack.
  513.       
  514.       CURSOR/Relative/Next byte:
  515.               The cursor position is incremented.
  516.       
  517.       CURSOR/Relative/Previous byte:
  518.               The cursor position is decremented.
  519.       
  520.       CURSOR/Relative/Next line:
  521.               Scroll forward by one line.
  522.       
  523.       CURSOR/Relative/Previous line:
  524.               Scroll backwards by one line.  The length of a line will
  525.       depend on what the data type is.  Until you first use "DISPLAY/
  526.       Fill-in data types", backwards scrolling may not be quite what
  527.       you expect.
  528.       
  529.       CURSOR/Relative/Next page:
  530.               Scroll forward by one page.  This will be approximately
  531.           20 lines.
  532.       
  533.       CURSOR/Relative/Previous page:
  534.               Scroll backwards by one page.  This will be approximately
  535.           20 lines.
  536.       
  537.       CURSOR/Relative/Skip forward:
  538.               Scroll forward by approx 4096 bytes ($1000).
  539.       
  540.       CURSOR/Relative/Skip Backward:
  541.               Scroll backward by approx 4096 bytes ($1000).
  542.       
  543.       CURSOR/Relative/Next unparsed code:
  544.               Scroll forward to the next line of code, that has been
  545.       labelled, and that has not been parsed for labels yet.
  546.       
  547.              
  548.       
  549.       
  550.       
  551.       CURSOR/Relative/Next data type change:
  552.               Scroll forward to the next byte whose data type is
  553.       different to the data type of the current byte.
  554.       
  555.       CURSOR/Relative/Previous data type change:
  556.               Scroll backward to the first byte found whose data type
  557.       is different to the data type of the current byte.
  558.       
  559.       CURSOR/Relative/Next uncertain data type:
  560.               Scroll forward to the next position within the file that
  561.       ReSource has labelled, but at the time was not quite sure of
  562.       which data type to set.
  563.       
  564.       CURSOR/Relative/Next backward reference:
  565.               Using the "CURSOR/Absolute/Backward reference" function,
  566.       it is possible to find the first reference to the current
  567.       position within the file.  Use this function to find further
  568.       references to the same position.  The search function could be
  569.       used instead, but may also find references within comments,
  570.       mnemonics, or even within other labels.
  571.       
  572.       CURSOR/Absolute/End of file:
  573.               Move cursor to the last line of the file.
  574.       
  575.       CURSOR/Absolute/Start of file:
  576.               Move cursor to the first line of the file.
  577.       
  578.       CURSOR/Absolute/Forward reference:
  579.               I'll use an example to explain this one:
  580.       
  581.                           JSR    lbC0132DE
  582.       
  583.               If you wanted to "check out" the subroutine at label
  584.       "lbC0132DE", but later return to the current cursor position,
  585.       simply scroll until this line is on the top line of the display,
  586.       and select "CURSOR/Absolute/Forward reference".  The current
  587.       cursor location is stored (on a stack), so that you can return to
  588.       this cursor position, using the "CURSOR/Absolute/Previous
  589.       location" function.
  590.       
  591.       CURSOR/Absolute/Forward reference:
  592.               This is similar to the "CURSOR/Absolute/Forward
  593.       reference" function, except that on a line such as:
  594.       
  595.                           MOVE.L  lbL00DEAF,lbL00BEEF
  596.       
  597.               the second label is used (lbL00BEEF), rather than the first
  598.       (lbL00DEAF).
  599.       
  600.       CURSOR/Absolute/Backward reference:
  601.               Use to find the first reference made to the current
  602.       cursor position.  See "CURSOR/Absolute/Next backward reference".
  603.       
  604.       CURSOR/Absolute/Previous location:
  605.               With many functions that change the cursor location
  606.       substantially, the current cursor position is stored on a stack. 
  607.       To "pop" the last saved location, use this function.
  608.       
  609.              
  610.       
  611.       
  612.       
  613.       CURSOR/Scrolling speed:
  614.               You can select from five scrolling speeds.  This relates
  615.       to the speed/smoothness of scrolling when using the "CURSOR/
  616.       Relative/Next line" and "CURSOR/Relative/Previous line" functions.
  617.       
  618.       CURSOR/Search/Set search pattern:
  619.               You will be requested to input a string.  Unless you
  620.       select "CANCEL", the string you input will be searched for
  621.       immediately, starting at the current cursor position.  Normal ARP
  622.       wildcards are accepted:
  623.       
  624.                   (a|b|c)   Will match one of a, b or c.
  625.                             These can be patterns.
  626.       
  627.                   ? Matches any single character
  628.                   #<pat>   Pattern repeated 0 or more times,
  629.                            in particular, #? matches anything.
  630.       
  631.                   [char]   A set of characters, for example,
  632.                            [abc] or [a..c] specify the same set.
  633.       
  634.                   [^char]   Match everything but this set of characters.
  635.       
  636.                   *         0 or more occurances of any character.
  637.       
  638.       CURSOR/Search/Find next occurence:
  639.               Using the current search string, search forward from the
  640.       current cursor position.  See "CURSOR/Search/Set search pattern".
  641.       
  642.       LABELS/Create single/End-of-line comment:
  643.               You will requested for a string, which will be shown at
  644.       the end of the current line, starting with " ; ".
  645.       
  646.       LABELS/Create single/Full-line comment:
  647.               You will requested for a string, which will be shown on a
  648.       seperate line, previous to the current line, starting with "; ". 
  649.       Generally, this will be used to add a comment too long to put at
  650.       the end of the current line.
  651.       
  652.       LABELS/Create single/Address symbol:
  653.               You will be requested for a string, which will become the
  654.       label for the current line.  Any references to the current line
  655.       will use the new label name, throughout the entire file,
  656.       immediately.
  657.       
  658.       LABELS/Create single/Address symbol dest:
  659.               The current line of code will be searched for references
  660.       to positions within the current file.  If any are found, ReSource
  661.       will make a decision on which type of data is at the position
  662.       referenced, it will then set the data type, and create a label at
  663.       that offset.  This new label will be immediately used for all
  664.       references to that location, which of course includes the
  665.       reference within the current line.  If the current line is not
  666.       being shown as code, or if there is no references, or there is a
  667.              
  668.       
  669.       
  670.       
  671.       reference, but it is outside of the range of the current file,
  672.       then this function will do nothing.  Normally, this function will
  673.       only be used within macros, as it is easier and quicker to hold
  674.       down the left Amiga key, while holding down the left mouse
  675.       button, possibly while scrolling also.
  676.       
  677.       LABELS/Create single/Value symbol:
  678.               Following is several examples of address symbols
  679.       (labels), and value symbols.
  680.       
  681.       lbC000124        MOVE.B   bm_Depth(A0),D0
  682.       
  683.       In the above line, "lbC000124" is an address symbol, and
  684.       "bm_Depth" is a value symbol.
  685.       
  686.                        MOVE.B   bm_Depth(A0),DepthByte
  687.       
  688.       In this line, "DepthByte" is and a reference to an address symbol
  689.       (label), NOT a value symbol.
  690.       
  691.                        MOVE.L   #MEMF_CLEAR,D1
  692.       
  693.       In this line, "MEMF_CLEAR" is a value symbol.  If a value symbol
  694.       had not been created for this line, the line would be:
  695.       
  696.                        MOVE.L   #$10000,D1
  697.       
  698.       Address symbols (labels) always equate to a position within the
  699.       file, while value symbols may equate to any value at all. 
  700.       Unfortunately, there is several cases where a value symbol may
  701.       equate to a position within the file:
  702.       
  703.                        MOVEA.L   #lbC000134,A0
  704.                        JSR       (A0)
  705.       
  706.       In this case, you may assign a value symbol, in which case the
  707.       value symbol will be shown, not the label name of the position
  708.       within the file that the instruction refers to.  If however, you
  709.       later remove the value symbol, the then label name of the line
  710.       being referenced (at present, this is "lbC000134"), will be
  711.       shown.  When you create an address symbol or value symbol, the
  712.       name is NOT checked for validity, it is up to you to decide
  713.       whether or not the assembler that you will be using will accept
  714.       the resulting code.  For example:
  715.       
  716.                        MOVE.L    #FFFFFFFA,D0
  717.       
  718.       may be changed to:
  719.       
  720.                        MOVE.L    #-6,D0
  721.       
  722.       by creating a value symbol "-6".  Virtually any value can be
  723.       given a value symbol, including bit numbers:
  724.        
  725.                        BTST      #AFB_68020,$0124(A6)
  726.       
  727.              
  728.       
  729.       
  730.       
  731.       LABELS/Create single/Value symbol - dest:
  732.               Similar to "LABELS/Create single/Value symbol" function,
  733.       except that the second reference within the current line will
  734.       used, rather than the first:
  735.       
  736.                        BTST      #4,SysFlags(A6)
  737.       
  738.       LABELS/Edit single:
  739.               All of these functions are identical to their
  740.       counterparts in "LABELS/Create single", except that if their is
  741.       an existing label/symbol/comment, you will be requested to edit
  742.       it, rather than create a new one.  Given the editing capabilities
  743.       of a string gadget, the create functions are a luxury really,
  744.       although I find that when I change a label/symbol/comment, I
  745.       generally make it nothing like the original, hence I nearly
  746.       always use the create functions, to save me the trouble of
  747.       pressing "rAmiga-X".
  748.       
  749.       LABELS/Remove single/Address symbol:
  750.               Remove any address symbol (label) for the current line.
  751.       
  752.       LABELS/Remove single/Value symbol:
  753.               Remove ALL value symbols in the current line.
  754.       
  755.       LABELS/Remove single/End-of-line comment:
  756.               Remove any end-of-line comment for the current line.
  757.       
  758.       LABELS/Remove single/All:
  759.               Remove all symbols and comments for the current line.
  760.       
  761.       LABELS/Create multiple/Reloc32 all:
  762.               For each reloc32 pointer within the current file,
  763.       determine the data type being referenced, set the data type, and
  764.       create a label at that address.  This function should be used
  765.       with caution, as when it makes a decision on the data type, it
  766.       does not have the same information available as when creating
  767.       labels normally.  This function should be most useful after
  768.       creating labels from all code in a program, where there is one or
  769.       more large tables of pointers.
  770.       
  771.       LABELS/Create multiple/All:
  772.               Starting at the current address, the "LABELS/Create
  773.       single/Address symbol dest" function is executed, and if ReSource
  774.       thinks that there was valid code in the current line, the
  775.       "CURSOR/Relative/Next line" function is executed, and the entire
  776.       function loops, otherwise the "PROJECT/-=Abort=-" function is
  777.       executed.  This function can make the disassembly process very
  778.       fast, the disadvantage being that there is a very slight chance
  779.       that what ReSource thinks is valid code, is really ascii, and
  780.       invalid labels will be created.
  781.       
  782.       SPECIAL FUNCTIONS/Repeat last command:
  783.               Execute the last function that was executed.  This does
  784.       not include most cursor movements.  By rebinding this function to
  785.       an easily-accessed key, such as the space bar, (and saving the
  786.       keytable) there should be much less need to rebind keys often.
  787.       
  788.              
  789.       
  790.       
  791.       
  792.       SPECIAL FUNCTIONS/Convert xx(A4) EA's
  793.               These functions were specifically designed to be used
  794.       when disassembling 'C' programs, in which the A4 register is used
  795.       as a base register for accessing data, throughout all or most of
  796.       the program.  Let's use an example program here:
  797.       
  798.                           SECTION  test000000,CODE
  799.                           LEA      START+$11E,A4
  800.                           LEA      0(A4),A1
  801.                           MOVE.L   $000C(A4),D0
  802.       .... rest of code
  803.                           SECTION  test00011E,DATA
  804.                           dc.b     'dos.library',0
  805.                           dc.l     $00010001
  806.                           END
  807.       
  808.       In the above program, the A4 register will point to the start of
  809.       the data segment.  There are three ways to tell ReSource where
  810.       the A4 register will point to; in the above example, the "This
  811.       operand" function could be used with the cursor at start of file,
  812.       or the "This address" function could be used with the cursor at
  813.       offset $00011E, or the "Specify" function could be used, suppying
  814.       a parameter of "11E".  Basically, with this function, you are
  815.       telling ReSource where, relative to the start of the program, the
  816.       A4 register can be assumed to be pointing.  After you do this,
  817.       any effective address that involves a word offset to the A4
  818.       register, will be shown as an absolute address.  Thus, the
  819.       example program above will appear as:
  820.       
  821.                           SECTION  test000000,CODE
  822.                           LEA      START+$011E,A4
  823.                           LEA      START+$011E,A1
  824.                           MOVE.L   START+$012A,D0
  825.       .... rest of code
  826.                           SECTION  test00011E,DATA
  827.                           dc.b     'dos.library',0
  828.                           dc.l     $00010001
  829.                           END
  830.       
  831.       The advantage here is that labels can automatically be created
  832.       where they could not before.  If this conversion process is not
  833.       used, it is likely that the program will not successfully re-
  834.       assemble, as different assemblers assemble the same source code
  835.       into different opcodes.  For example, the assembler that I
  836.       normally use does virtually no optimizing, and so the resulting
  837.       program is often larger than the original, even if I did not
  838.       modify the source code.  For example:
  839.       
  840.                           MOVE.L   4,A6
  841.       
  842.       If absolute long addressing is used, the instruction above will
  843.       be 6 bytes long, whereas if absolute short addressing is used, it
  844.       will be only 4 bytes long.  Where you wish to do EA conversions
  845.       in only a portion of a program, you can set the lower and upper
  846.       limits.
  847.       
  848.              
  849.       
  850.       
  851.       
  852.       Changing to absolute EA's will increase the size of the resulting
  853.       program, unless you convert back to relative addressing, within
  854.       the source code.  I believe that one of the features of BLINK
  855.       (from the Software Distillery) can help to make this conversion.
  856.       
  857.       SPECIAL FUNCTIONS/Convert specific EA's:
  858.               Please read and understand the "SPECIAL FUNCTIONS/Convert
  859.       xx(A4) EA's" functions first!  Where you want to do specific EA
  860.       conversions, use "Set base #1" (or #2, or #3), when the cursor is
  861.       the same as where the base register (whatever that is, it does
  862.       not have to be A4 this time) can be assumed to point to. 
  863.       Assuming that you set base #1, and it is the A5 register that is
  864.       being used as a base register, you will then use the "Convert W/
  865.       Base #1" function to convert lines like:
  866.       
  867.                           MOVE.L   $0032(A5),A6
  868.       
  869.       .. into:
  870.       
  871.                           MOVE.L   lbL0014AC(A5),A6
  872.       
  873.       Note here that there has not actually been an EA conversion, but
  874.       a label has been created, the data type at label "lbL0014AC" has
  875.       been determined and set, and a value symbol ("lbL0014AC") has
  876.       been created for this line.  It is up to you then to make the
  877.       necessary changes to the resulting source code, if re-assembling
  878.       is required.  Whereas the "Convert xx(A4) EA's" function converts
  879.       immediately and automatically, you must use the "Convert W/Base
  880.       #1" function on each line that you want converted.  If you wish
  881.       to convert a destination address, first use the "SYMBOLS/Set
  882.       source/dest/Destination" function first.
  883.       
  884.       MACROS:
  885.               There are currently twelve user-definable macros
  886.       available in ReSource.  To start macro #1, select "MACROS/Start/
  887.       #1", select the functions to be included in the macro (you can
  888.       use the menus, or press keys, it's all the same thing to the
  889.       macro).  When you are done, select "MACROS/Start/#1" again, to
  890.       end the macro.  To run the macro, select "MACROS/Execute/#1". 
  891.       The display is always refreshed during the defining of a macro,
  892.       however it is not during the execution.  At the end of a macro,
  893.       the display is always refreshed.  You may nest macros, but you
  894.       should not use recursion.  If ReSource finds that the nesting
  895.       level has exceeded 40, the macro will be abandoned.
  896.       
  897.               Macro files can be saved and re-loaded.  When ReSource
  898.       first starts up, it looks for "S:RS.macros".  If it finds it, it
  899.       will load it, and execute macro #12 immediately (that is why
  900.       macro #12 is hilited in the menus).  This is used to configure
  901.       ReSource.  Just start macro #12, set what option you want, end
  902.       macro #12, save the macro file as "S:RS.macros", and ReSource
  903.       will be configured every time that you run it.
  904.       
  905.              
  906.       
  907.       
  908.       
  909.       KEY BINDINGS:
  910.               Every function in ReSource can be found in the menus. 
  911.       You do not need to use any keys at all, but you probably will
  912.       want to.  You can bind any function to any key.  All Amiga keys
  913.       are supported, you may use shift, alt, ctl, lAmiga, rAmiga,
  914.       shift-alt, shift-ctl, alt-ctl, or shift-alt-ctl in combination
  915.       with any key, as a distinct key to bind a function to.  Thus, you
  916.       have complete control over which keys do what.  After re-binding
  917.       some keys, you will probably want to save the keytable.  If you
  918.       save the keytable as "S:RS.keytable", it will be loaded every
  919.       time you run ReSource.  You may want to create several keytables,
  920.       suitable for doing differing program types (C, assembler, etc.).
  921.       
  922.       OPTIONS/Show offsets:
  923.               If this option is set to ON, all lines will start with
  924.       either a label, or the offset from the start of the file.
  925.       
  926.       OPTIONS/Display Beep:
  927.               If this option is set to ON, the "BeepDisplay" function
  928.       is used to give feedback to the user, that either a function has
  929.       failed, or that a lengthy function has completed, and that the
  930.       user should now wake up.
  931.       
  932.       OPTIONS/User Feedback:
  933.               If this option is set to ON, messages will appear in the
  934.       title bar, to let the user know what ReSource is doing,
  935.       especially while doing functions that take a lot of time,
  936.       extraordinary functions that only ReSource has direct control
  937.       over (such as dynamically allocating more memory for strings,
  938.       etc.), and also information about what hunks, etc., that it finds
  939.       in a load file.
  940.       
  941.       OPTIONS/Feedback Delays:
  942.               If this option is set to ON, whenever a feedback message
  943.       is displayed, ReSource will wait for you to read the message,
  944.       before continuing.  You will probably not want to keep this on
  945.       all the time, as it can slow down the disassembly process
  946.       somewhat, but while you are learning to use ReSource, it will
  947.       probably be very useful.
  948.       
  949.       OPTIONS/Labels:
  950.               If this option is set to ON, labels will be displayed.  This is
  951.       the default.
  952.       
  953.       
  954.       OPTIONS/Value symbols:
  955.              If this option is set to ON, value symbols will be displayed. 
  956.       This is the default.
  957.       
  958.       OPTIONS/End-of-line comments:
  959.              If this option is set to ON, end-of-line comments will be
  960.       displayed.  This is the default.
  961.       
  962.       OPTIONS/Full-line comments:
  963.              If this option is set to ON, full-line comments will be
  964.       displayed.  This is the default.
  965.       ****************************************************************
  966.       Don't forget to put arp.library in your LIBS: directory!
  967.       ****************************************************************
  968.