home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / CPROG / BCIV.ZIP / BUBBLE.HLP < prev    next >
Text File  |  1990-02-19  |  12KB  |  274 lines

  1.  
  2.                             GENERAL OPERATING PROCEDURES
  3.  
  4.  
  5.           Steps to complete:
  6.  
  7.                     * Specify the files on the main screen.
  8.  
  9.                     * Build the map using F5.
  10.  
  11.                     * Edit the map using F6.
  12.  
  13.                     * Save the map using F8.
  14.  
  15.                     * Run the listing using F9.
  16.  
  17.  
  18.  
  19.           Normal procedure would begin with key F5, building the map.
  20.           This uses the built in algorithms to determine what is data and
  21.           what is instructions, where labels should go and where segment
  22.           registers are modified.
  23.  
  24.           This function is not perfect, so you will want to use F6 to
  25.           verify/edit the map.
  26.  
  27.           When you are satisfied with the map, you then proceed to run the
  28.           output, key F9.
  29.  
  30.           You may wish to just view it on the screen, or print it, first.
  31.  
  32.  
  33.  
  34.                     THE MAIN SCREEN: Specifying The Files Names.
  35.  
  36.  
  37.           Once initiated, The Bubble Chamber proceeds to the main screen.
  38.           Here you are allowed to specify the files it will work with.
  39.           These are:
  40.  
  41.           The Input File is the program (.COM or .EXE) that you
  42.                wish to disassemble.
  43.  
  44.           The Output File will hold the assembly language source
  45.                code created by the Bubble Chamber.
  46.  
  47.           The Map File is a scratch file to hold the 'map' of
  48.                instructions vs. data areas in the input file.
  49.  
  50.           If you did not enter the file names on the command line, you must
  51.           do so here.  You may enter a fully qualified (including drive and
  52.           path) file name.  If you enter only the file name, the Bubble
  53.           Chamber will use the default directory - IT WILL NOT SEARCH THE
  54.           PATH.
  55.  
  56.           You should also note that pressing return with the cursor on the
  57.           input file line, causes the program to create the default file
  58.           names (file.ASM and file.MAP - .COM is added to the input file if
  59.           no extension is supplied).
  60.  
  61.           The insert key toggles between replace and insert functions,
  62.           otherwise, the cursor movements should be as expected.
  63.  
  64.           The output specifier can be a DOS device (LPT1:, SCRN:), instead
  65.           of a file name.  Since the output can be quite large, you may
  66.           wish to use these options, rather than take up disk space with a
  67.           program you are not going to modify.
  68.  
  69.           With the files properly identified, you are free to select the
  70.           appropriate function using one of the Fn keys ...
  71.  
  72.                                   THE FUNCTION KEYS
  73.  
  74.  
  75.            F1: Help lists a brief description of available
  76.                functions.
  77.  
  78.            F2: Directory.  Provides the opportunity to change the
  79.                directory (or press return to ignore), and then prints
  80.                the current list of files.
  81.  
  82.            F3: Set Range allows you to set the beginning, ending,
  83.                program entry, and offset values.  The first two define
  84.                the start and end of your area of interest - the part
  85.                of the file you wish disassembled.  The program entry
  86.                address marks the start of the executable code, and the
  87.                offset is essentially the value of the instruction
  88.                pointer at the start of execution.  Please see the
  89.                following section for more information.
  90.  
  91.            F5: Build Map directs the computer to build a map which
  92.                defines data vs. instruction areas.  This is necessary
  93.                before the file can be properly disassembled.  Any
  94.                existing map is cleared between the start and end range
  95.                specified with F3.  The Bubble Chamber then attempts to
  96.                follow the program beginning at the program entry point,
  97.                or the start, which ever is greater.
  98.  
  99.            F6: Edit Map.  This key brings up an interactive editor
  100.                for the map.  The editor is described in detail later.
  101.  
  102.            F7: Save Map.  Saves and then loads the map (This
  103.                cleans up the map as well).
  104.  
  105.            F8: Load Map loads a previously saved map.
  106.  
  107.            F9: Run.  Produces the assembly source code.
  108.  
  109.            F10: Auto Run.  This key produces the same effect as
  110.                pressing F5, F7 and F9 (Build Map, Save Map, and Run).
  111.  
  112.  
  113.  
  114.  
  115.  
  116.  
  117.                             F3: Setting The Address Range
  118.  
  119.  
  120.           The program provides for four address specifications to be used
  121.           in the disassembly process.   The are all in hex notation, and
  122.           are as follows:
  123.  
  124.           The Starting Address.  This specifies the beginning byte of the
  125.           input file where disassembly will begin.  The first byte in the
  126.           file is 00000h.
  127.  
  128.           The Ending Address.  This is address of the last byte to be
  129.           included in the disassembly.
  130.  
  131.           Note that if you run out of memory processing a large file, you
  132.           can use the start and end addresses to limit the size of the map,
  133.           and thus process the file in smaller pieces.  It is the size of
  134.           the map, not the file that causes memory error.  Of course, the
  135.           larger the file, the larger the map.
  136.  
  137.           The Code Image Start.  In EXE files, execution begins at a point
  138.           past the first byte in the file.  This address points to that
  139.           byte in the file.
  140.  
  141.           The Image Offset.  This is essentially the value for the
  142.           instruction pointer (IP) as program execution is begun.
  143.  
  144.  
  145.  
  146.           The addresses are all set by the program to the most appropriate
  147.           values for the file being disassembled.  However, it may be
  148.           necessary to alter these values in order to process the file.  In
  149.           making a decision in this regard, it is helpful to have an
  150.           understanding of the differences between .COM and .EXE files.
  151.           The following is a brief summary of those differences.
  152.  
  153.           A COM file is a direct image of the program to be executed.  It
  154.           is loaded into memory and executed exactly as it is stored on
  155.           disk, byte for byte.  As DOS loads the file, it creates a program
  156.           segment prefix (PSP) in memory just ahead of the program (the PSP
  157.           contains information about the command line, etc.).  The segment
  158.           registers (CS, DS, ES,& SS) are all set to the memory location of
  159.           the first byte of the PSP.  Since program execution begins where
  160.           the first byte of the file was loaded, the instruction pointer
  161.           (IP), must be set to the memory location immediately following
  162.           the PSP.  The PSP is 256 bytes long (0 to 255 bytes), so the
  163.           starting location for the program is 256(100h) relative to the CS
  164.           register.  This is the reason the default offset for a COM file
  165.           is 256(100h).
  166.  
  167.  
  168.           An EXE file is more than just a memory image of a program.  The
  169.           file has a header which contains information on how the registers
  170.           are to be set, which part of the file is to be loaded, etc..  In
  171.           this case, the start, end, code and offset address are all set
  172.           according to the information in the file header.
  173.  
  174.           The image that is to be loaded into memory follows the header.
  175.           The start address defaults to the first byte of the load image.
  176.           The code address points to the byte where execution begins.  This
  177.           may or may not be the same as the start address.  The offset is
  178.           typically set to zero.
  179.  
  180.           In most cases, the default settings will be correct - so you
  181.           should not need to change them.  They are made available so you
  182.           can work with smaller portions of the file, or look at the file
  183.           header.  Any other use is up to you.
  184.  
  185.  
  186.                                    F6: The Editor
  187.  
  188.           In order to achieve a good disassembly, some human intervention
  189.           is likely to be necessary.  The map must contain the proper
  190.           transition boundaries - from data to instruction and instruction
  191.           to data - or the disassembly may be worthless.  The editor has
  192.           been designed to make this process as easy as possible.
  193.  
  194.           When you first bring up the editor, what you will see is a
  195.           listing of the program!  To the left of the listing, the editor
  196.           also presents address information to help you maintain a sense of
  197.           where you are.  A complete line might appear as follows:
  198.  
  199.                        0229F CS:110F I J0229F: MOV AX, D00680
  200.  
  201.           which represents:
  202.  
  203.           0229F     - The position (relative to 00000) in the file of this
  204.                       line.
  205.  
  206.           CS:110F   - The address of the program line.  The CS
  207.                       indicates that the line is in a code segment
  208.                       (expected for an instruction), and it is at offset
  209.                       100Fh in the segment.
  210.  
  211.           I         - Indicates the map is set for Instructions.
  212.  
  213.           J0229F:   - The line label, indicates that this line is the
  214.                       destination of a jump instruction.
  215.  
  216.           MOV       - The command mnemonic for the move instruction,
  217.                       taken from the data file.
  218.  
  219.           AX        - The destination of the move, the AX register.
  220.  
  221.           D00680    - The source, in this case a pointer to file position
  222.                       00680h.
  223.  
  224.           At the bottom of the screen is a window, with several one-key
  225.           functions (pressing the key activates the function) listed.
  226.           These are:
  227.  
  228.           A - Mark a transition to ASCII data at the cursor.
  229.  
  230.           H - Mark a transition to Hex data at the cursor.
  231.  
  232.           W - Mark a transition to Word data (vectors or addresses, etc.).
  233.  
  234.           I - Mark a transition to Instructions.
  235.  
  236.           S - Allows you to create, or update a segment register change.
  237.               You can specify a point in the file where segment registers
  238.               are changed, and what they are changed to.  The value in the
  239.               registers is crucial to determining labels and where they are
  240.               to be placed.  The build map function attempts to find these
  241.               changes, but may not be perfect.  Using this function, you
  242.               can assure that all changes are correct.
  243.  
  244.           D - Deletes a segment register change.
  245.  
  246.           G - Goto.  You can specify the address in five digit hex code.
  247.  
  248.           Note that you can use the Goto command to achieve a specific byte
  249.           alignment of a transition.  By going to that byte, you override
  250.           the alignment preceding it.  You may then specify the transition
  251.           you desire.
  252.  
  253.           The default address will be the destination of a jump, a data
  254.           address, or the last address jumped from (as appropriate).
  255.           Pressing escape cancels the command.
  256.  
  257.           The following cursor keys are also active:
  258.  
  259.           Home - move the cursor to the starting address.
  260.  
  261.           PgUp - moves the cursor up to the fist label/transition found.
  262.           Note that this is not a normal page up, and is done in this
  263.           manner to avoid distorting the instruction alignment.
  264.  
  265.           End - jumps to the last line of the file.
  266.  
  267.           PgDn - moves down one screen minus one line.
  268.  
  269.           Cursor Control: the up and left arrows move the cursor up one
  270.           line.  Note that at the top of the screen, this process may be
  271.           very slow.  This is due to the time required to backtrack and
  272.           verify the alignment.  PgUp or Goto will move you faster.
  273.  
  274.