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