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 >
Wrap
Text File
|
1990-02-19
|
12KB
|
274 lines
GENERAL OPERATING PROCEDURES
Steps to complete:
* Specify the files on the main screen.
* Build the map using F5.
* Edit the map using F6.
* Save the map using F8.
* Run the listing using F9.
Normal procedure would begin with key F5, building the map.
This uses the built in algorithms to determine what is data and
what is instructions, where labels should go and where segment
registers are modified.
This function is not perfect, so you will want to use F6 to
verify/edit the map.
When you are satisfied with the map, you then proceed to run the
output, key F9.
You may wish to just view it on the screen, or print it, first.
THE MAIN SCREEN: Specifying The Files Names.
Once initiated, The Bubble Chamber proceeds to the main screen.
Here you are allowed to specify the files it will work with.
These are:
The Input File is the program (.COM or .EXE) that you
wish to disassemble.
The Output File will hold the assembly language source
code created by the Bubble Chamber.
The Map File is a scratch file to hold the 'map' of
instructions vs. data areas in the input file.
If you did not enter the file names on the command line, you must
do so here. You may enter a fully qualified (including drive and
path) file name. If you enter only the file name, the Bubble
Chamber will use the default directory - IT WILL NOT SEARCH THE
PATH.
You should also note that pressing return with the cursor on the
input file line, causes the program to create the default file
names (file.ASM and file.MAP - .COM is added to the input file if
no extension is supplied).
The insert key toggles between replace and insert functions,
otherwise, the cursor movements should be as expected.
The output specifier can be a DOS device (LPT1:, SCRN:), instead
of a file name. Since the output can be quite large, you may
wish to use these options, rather than take up disk space with a
program you are not going to modify.
With the files properly identified, you are free to select the
appropriate function using one of the Fn keys ...
THE FUNCTION KEYS
F1: Help lists a brief description of available
functions.
F2: Directory. Provides the opportunity to change the
directory (or press return to ignore), and then prints
the current list of files.
F3: Set Range allows you to set the beginning, ending,
program entry, and offset values. The first two define
the start and end of your area of interest - the part
of the file you wish disassembled. The program entry
address marks the start of the executable code, and the
offset is essentially the value of the instruction
pointer at the start of execution. Please see the
following section for more information.
F5: Build Map directs the computer to build a map which
defines data vs. instruction areas. This is necessary
before the file can be properly disassembled. Any
existing map is cleared between the start and end range
specified with F3. The Bubble Chamber then attempts to
follow the program beginning at the program entry point,
or the start, which ever is greater.
F6: Edit Map. This key brings up an interactive editor
for the map. The editor is described in detail later.
F7: Save Map. Saves and then loads the map (This
cleans up the map as well).
F8: Load Map loads a previously saved map.
F9: Run. Produces the assembly source code.
F10: Auto Run. This key produces the same effect as
pressing F5, F7 and F9 (Build Map, Save Map, and Run).
F3: Setting The Address Range
The program provides for four address specifications to be used
in the disassembly process. The are all in hex notation, and
are as follows:
The Starting Address. This specifies the beginning byte of the
input file where disassembly will begin. The first byte in the
file is 00000h.
The Ending Address. This is address of the last byte to be
included in the disassembly.
Note that if you run out of memory processing a large file, you
can use the start and end addresses to limit the size of the map,
and thus process the file in smaller pieces. It is the size of
the map, not the file that causes memory error. Of course, the
larger the file, the larger the map.
The Code Image Start. In EXE files, execution begins at a point
past the first byte in the file. This address points to that
byte in the file.
The Image Offset. This is essentially the value for the
instruction pointer (IP) as program execution is begun.
The addresses are all set by the program to the most appropriate
values for the file being disassembled. However, it may be
necessary to alter these values in order to process the file. In
making a decision in this regard, it is helpful to have an
understanding of the differences between .COM and .EXE files.
The following is a brief summary of those differences.
A COM file is a direct image of the program to be executed. It
is loaded into memory and executed exactly as it is stored on
disk, byte for byte. As DOS loads the file, it creates a program
segment prefix (PSP) in memory just ahead of the program (the PSP
contains information about the command line, etc.). The segment
registers (CS, DS, ES,& SS) are all set to the memory location of
the first byte of the PSP. Since program execution begins where
the first byte of the file was loaded, the instruction pointer
(IP), must be set to the memory location immediately following
the PSP. The PSP is 256 bytes long (0 to 255 bytes), so the
starting location for the program is 256(100h) relative to the CS
register. This is the reason the default offset for a COM file
is 256(100h).
An EXE file is more than just a memory image of a program. The
file has a header which contains information on how the registers
are to be set, which part of the file is to be loaded, etc.. In
this case, the start, end, code and offset address are all set
according to the information in the file header.
The image that is to be loaded into memory follows the header.
The start address defaults to the first byte of the load image.
The code address points to the byte where execution begins. This
may or may not be the same as the start address. The offset is
typically set to zero.
In most cases, the default settings will be correct - so you
should not need to change them. They are made available so you
can work with smaller portions of the file, or look at the file
header. Any other use is up to you.
F6: The Editor
In order to achieve a good disassembly, some human intervention
is likely to be necessary. The map must contain the proper
transition boundaries - from data to instruction and instruction
to data - or the disassembly may be worthless. The editor has
been designed to make this process as easy as possible.
When you first bring up the editor, what you will see is a
listing of the program! To the left of the listing, the editor
also presents address information to help you maintain a sense of
where you are. A complete line might appear as follows:
0229F CS:110F I J0229F: MOV AX, D00680
which represents:
0229F - The position (relative to 00000) in the file of this
line.
CS:110F - The address of the program line. The CS
indicates that the line is in a code segment
(expected for an instruction), and it is at offset
100Fh in the segment.
I - Indicates the map is set for Instructions.
J0229F: - The line label, indicates that this line is the
destination of a jump instruction.
MOV - The command mnemonic for the move instruction,
taken from the data file.
AX - The destination of the move, the AX register.
D00680 - The source, in this case a pointer to file position
00680h.
At the bottom of the screen is a window, with several one-key
functions (pressing the key activates the function) listed.
These are:
A - Mark a transition to ASCII data at the cursor.
H - Mark a transition to Hex data at the cursor.
W - Mark a transition to Word data (vectors or addresses, etc.).
I - Mark a transition to Instructions.
S - Allows you to create, or update a segment register change.
You can specify a point in the file where segment registers
are changed, and what they are changed to. The value in the
registers is crucial to determining labels and where they are
to be placed. The build map function attempts to find these
changes, but may not be perfect. Using this function, you
can assure that all changes are correct.
D - Deletes a segment register change.
G - Goto. You can specify the address in five digit hex code.
Note that you can use the Goto command to achieve a specific byte
alignment of a transition. By going to that byte, you override
the alignment preceding it. You may then specify the transition
you desire.
The default address will be the destination of a jump, a data
address, or the last address jumped from (as appropriate).
Pressing escape cancels the command.
The following cursor keys are also active:
Home - move the cursor to the starting address.
PgUp - moves the cursor up to the fist label/transition found.
Note that this is not a normal page up, and is done in this
manner to avoid distorting the instruction alignment.
End - jumps to the last line of the file.
PgDn - moves down one screen minus one line.
Cursor Control: the up and left arrows move the cursor up one
line. Note that at the top of the screen, this process may be
very slow. This is due to the time required to backtrack and
verify the alignment. PgUp or Goto will move you faster.