home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
cpm
/
disasm
/
dcom8048.lbr
/
DCOM48.TQT
/
DCOM48.TXT
Wrap
Text File
|
1986-05-08
|
15KB
|
401 lines
DCOM8048
áááááDCOM8048á isá a disassembler for 8048, 8049, and 8041 object
code. It allowsá theá userá toá insertá labelsá asá wellá asá DB
statements.á This disassembler runs in two passes, the first one
generating a symbol table, and the second oneá doingá theá actual
disassembly. It is coded to run on any CP/M system.
áááááWhená DCOM8048á signsá on,á it displays a menu of all of the
commands in it's vocabulary. This is a interactive disassembler,
that is it it behaves like a monitor, as well as aá disassembler.
Allá codeá isá treated in DCOM8048 as though it is located at 00H
in your machines memory, although it is located elsewhere.á This
allowsá the user to move code and look at it the same as it would
be in a assembly listing.
áááááWe will nowá goá throughá eachá commandá andá giveá aá brief
explanationá ofá it as well as a example on how to use it. Note,
DCOM8048 doesn't overwriteá theá dataá buffer,á soá itá isá still
intactá ifá itá isá exited,á thená reentered.á Listed below is a
listing of the commands DCOM8048 has:
ááááááááááááááá[1] Initialized data buffer
ááááááááááááááá[2] Read the Program
ááááááááááááááá[3] Move memory image to data buffer
ááááááááááááááá[4] Adjust buffer end
ááááááááááááááá[5] Set starting and Ending addresses
ááááááááááááááá[6] Display data buffer
ááááááááááááááá[7] Move data in buffer
ááááááááááááááá[8] Change data in buffer
ááááááááááááááá[9] Clear symbol table
ááááááááááááááá[10] Read symbol file (.LBL)
ááááááááááááááá[11] Display symbol table
ááááááááááááááá[12] Clear DB table
ááááááááááááááá[13] Read DB table
ááááááááááááááá[14] Write buffer to file
ááááááááááááááá[15] Disassemble Program in buffer
ááááááááááááááá[16] Set output options
ááááááááááááááá[17] Hex Math
ááááááááááááááá[18] Exit, go back to CP/M
4-26-86 Page -1- By Gil Shultz
DCOM8048
[1] Initialized data buffer
áááááThis command allows you to initialize the data buffer to any
predetermined HEX value. You caná useá toá initializeá theá data
bufferá atá theá start of the disassembly to A known value before
loading the data.
[2] Read the Program
áááááUse this command to loadá yourá programá intoá theá internal
buffer. You will be prompted first for the filename, you need to
enterá theá filename.ext,á no ambiguous characters are allowed in
the filename. The file can be a binary image file, Hexá fileá in
either ascii or binary format. After the filename is entered you
willá beá askedá forá theá type of file you are loading, then you
will be prompted as to the offset bias, most of the time itá will
beá "0".á Theá fileá willá thená beá readá into the buffer, with
appropriate error messages, if something goes wrong. If all went
OK, the entry point as well as the end of theá dataá loadedá will
beá displayedá to the user. The buffer pointers will be adjusted
according to the length of the file, this is automatic andá needs
no intervention by the user.
[3] Move memory image to data buffer
áááááThisá commandá is used to move a memory image from somewhere
in your machine to the data buffer. The reason for this isá that
theá promá programerá mayá haveá read it into a address that DCOM
doesn't know about. Currently all memory from 0 to 385BH is used
by DCOM, with the buffer starting at 385BH. If the data is below
this point, it will be overwritten when DCOM is startedá up.á If
it is above this point, it will be OK.
áááááWhená the command is entered, the absolute starting point of
the buffer is displayed (actual address in your machine), withá a
promptá forá theá starting address (actual memory address in your
machine) where the code is located. The last prompt will beá for
theá absoluteá ending address of the code in your machine. Note,
the ending address must be greaterá thená theá startingá address,
andá youá areá notá allowedá toá moveá dataá fromá theá buffer to
elsewhere in your machine. If you need to do this, exit DCOM and
you will find the data at the buffer starting address.
[4] Adjust buffer end
áááááUse this command to move the buffer ending addressá iná your
machine.á Normally you will not have to use this command, but it
is included as a convenience.
áááááWhen this command is invoked, you will be givená theá buffer
startingá and ending addresses, as well as the maximum address it
can be set to. Please note, this is actual memoryá addressesá in
yourá machine, not addresses referenced by the code that is to be
disassembled.
4-26-86 Page -2- By Gil Shultz
DCOM8048
[5] Set starting and Ending addresses
áááááThis allows you to set the starting andá endingá addressá of
theá buffer.á Theseá addressesá areá relative to the code in the
buffer, NOT machine addresses.á Normallyá theá startingá address
willá beá 00Há and the ending address will be the end of the code
loaded. If no code was loaded, the default is 100H
[6] Display data buffer
áááááUsing this command allowsá youá toá viewá theá dataá iná the
bufferá iná bothá HEXá andá ASCII formats. This is useful to see
ascii data as well as to examine the data iná theá buffer.á This
commandá dumpsá theá wholeá buffer,á withá Sá andá Q stopping and
starting the display.
[7] Move data in buffer
áááááIf for any reason you need or want to moveá dataá aroundá in
theá buffer,á thisá isá theá commandá toá use.á It automatically
determines which way to move the data, so itá doesn'tá trashá the
dataá iná theá buffer.á Ifá you ask it to move the data form the
wrong place, to the wrong place, or incorrect amount, it willá do
it, as it does what you said, not what you meant.
áááááYouá will be prompted for the starting and ending address of
the data you want to move, thená theá destinationá addressá where
theá dataá is to be moved to. This command will not let you move
data out of the buffer, or move more data then is in theá buffer.
[8] Change data in buffer
áááááIná orderá toá patch the data in the buffer, you need to use
this command. You will be promptedá forá theá startingá address,
whichá is the address of the data you want to alter. The address
will be shown along with the data followedá withá aá dash,á enter
the new data, then a space to advance to the next location. If a
spaceá is entered after the dash, with no data being entered, the
data in the buffer will remain unchanged. When you areá finished
changingá theá data,á enterá aá carriageá return to terminate the
command. If you make a mistake in entering the data, reenter the
data, as only the last 8 bits are used, the rest being discarded.
This command will not allow you toá alterá dataá outsideá ofá the
buffer.
[9] Clear symbol table
áááááThisá commandá isá usedá to clear the internal symbol table,
that is generated with theá disassemblerá orá readá iná fromá the
(.LBL) file.
4-26-86 Page -3- By Gil Shultz
DCOM8048
[10] Read symbol file (.LBL)
áááááAsá youá progressá withá yourá disassembly, or have a source
listing, you can enter the labels into a fileá withá yourá editor
iná theá formatá "Label=XXXX"á where label is the label name, and
XXXX is the hex value of the address or data value. Pleaseá note
theá disassemblerá willá use the first label it encounters in the
table. Several labels can be entered on each line of text.á The
labelsá theá disassembler generates will be in the form of ABXXXX
where A will be a "C" for a call reference and a "J" will beá for
a jmp reference to that label. The first letter will always be a
"C"á orá "J",á butá theá secondá will be a "X" unless there was a
second reference to that labelá thatá isá notá theá sameá asá the
first.á What this means it the label will start with "CX", "JX",
"CJ", or "JC". The XXXX will be the address thatá theá labelá is
located at.
áááááExperiment with your editor and generate several label files
to get comfortable with this feature. This file is loaded at the
time the command is given.
[11] Display symbol table
áááááUseá thisá command to display all the symbols in the buffer.
[12] Clear DB table
áááááUsing your editor set up a file that tells theá disassembler
to use DB statements in disassembling the file. Please note that
theá DBá addressá have to be in ascending order. This file isn't
read until the disassembly takes place. The format for theá file
isá "XXX-YYY" where XXX is the address that the DB statements are
to start, and YYY is the ending addressá ofá theá DBá statements.
You can use as many statements in your file as you like, but keep
them in ascending order. You can place each statement on a line,
or you can place multiple statements on each line.
[13] Read DB table
áááááThisá commandá allows you to specify the filename.ext of the
DB table information. All this does is set up theá fileá control
block, it doesn't do any checking to see if there is a valid file
oná the disk. If you enter a invalid file specification, a error
will be displayed at disassembly time.
[14] Write buffer to file
áááááWhen you finish patching your code, or want toá saveá itá on
disk,á use this command. When this command is given, you will be
prompted for the name of the file you want data to beá savedá in.
Note:á noá ambiguousá charactersá areá allowed in the filename or
extension. After the file is specified, youá willá beá askedá if
thisá isá aá binaryá image file, if so, the data will be saved in
binary format. If it isn't a binary file, you will beá askedá if
itá isá toá beá writtená in ascii, if the answer is yes, the data
will
4-26-86 Page -4- By Gil Shultz
DCOM8048
Γe saved in ascii intel hex format, if the answerá isá no,á the
dataá willá beá savedá iná a binary hex format (not ascii). DCOM
will ask you if a filename exists withá theá sameá name,á doá you
wantá to erase it? The choice is yours, but note no backup files
areá generated.á Whená theá fileá isá writtená toáá andáá closed
successfully or if there is a error, you will be notified.
[15] Disassemble Program in buffer
áááááThisá commandá is the core of the program, and automatically
disassembles all of the data in the buffer. Itá isá aá twoá pass
disassembler,á usingá theá symbol and db files you told it to do.
Ifá youá didn'tá specifyá aá symbolá thatá itá needs,áá itáá will
automaticallyá generateá one for you, and show it on the listing.
áááááThis command generatesá 3á differentá outputs,á oneá toá the
console, one to the printer, and one to the disk. Each output if
formattedá forá itsá destination,á withá theá console showing the
information in a general format, the printer will looká likeá the
outputá ofá aá assembler,á andá the disk file will be ready for a
assembler.
[16] Set output options
áááááThis command directs the output toá theá devicesá youá want.
Youá willá beá askedá if it is to go to the list device, and to a
disk file. If a disk file is specified, you willá beá askedá for
theá nameá ofá theá file, no ambiguous characters please. If the
file is already open, you will be asked to close it or flushá it,
the choice is yours.
[17] Hex Math
áááááThisá commandá is useful for calculating address offsets and
jump values. You will be asked for "value one" and "valueá two",
DCOMá willá thená display the sum and difference of value one and
two. After the calculation, you will be asked if you want toá do
another calculation, the choice is yours.
[18] Exit, go back to CP/M
áááááThisá is the proper way to exit DCOM and go back to the CP/M
operating system.
Enjoy
Gil Shultz
P.S.
áááááIf any problems occur, you can leaveá meá aá messageá oná my
BBS. In order to do this, enter "CHAT D", and this will take you
to the message handler. If some enhancements are wanted, you can
alsoá leaveá aá message.á I wrote this program in 1982, and have
decided to put it in the public domain, butá itá cannotá beá used
for
4-26-86 Page -5- By Gil Shultz
DCOM8048
ßnyá commercialá reason,á norá caná it be sold or used as a sales
tool. (C) 4/29/86 By Gil Shultz
The Realm
(313) 349-3408
Novi, Michigan
4-26-86 Page -6- By Gil Shultz
DCOM8048