home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / DISASM / DCOM8048.LBR / DCOM48.TQT / DCOM48.TXT
Text File  |  2000-06-30  |  15KB  |  401 lines

  1.                             DCOM8048
  2.        
  3.  
  4.  
  5.        áááááDCOM8048á isá a disassembler for 8048, 8049, and 8041 object
  6.        code.  It allowsá theá userá toá insertá labelsá asá wellá asá DB
  7.        statements.á  This disassembler runs in two passes, the first one
  8.        generating a symbol table, and the second oneá doingá theá actual
  9.        disassembly.  It is coded to run on any CP/M system.
  10.  
  11.        áááááWhená DCOM8048á signsá on,á it displays a menu of all of the
  12.        commands in it's vocabulary.  This is a interactive disassembler,
  13.        that is it it behaves like a monitor, as well as aá disassembler.
  14.        Allá codeá isá treated in DCOM8048 as though it is located at 00H
  15.        in your machines memory, although it is located elsewhere.á  This
  16.        allowsá the user to move code and look at it the same as it would
  17.        be in a assembly listing.
  18.  
  19.        áááááWe will nowá goá throughá eachá commandá andá giveá aá brief
  20.        explanationá ofá it as well as a example on how to use it.  Note,
  21.        DCOM8048 doesn't overwriteá theá dataá buffer,á soá itá isá still
  22.        intactá ifá itá isá exited,á thená reentered.á  Listed below is a
  23.        listing of the commands DCOM8048 has:
  24.  
  25.        ááááááááááááááá[1]  Initialized data buffer 
  26.        ááááááááááááááá[2]  Read the Program 
  27.        ááááááááááááááá[3]  Move memory image to data buffer 
  28.        ááááááááááááááá[4]  Adjust buffer end 
  29.        ááááááááááááááá[5]  Set starting and Ending addresses 
  30.        ááááááááááááááá[6]  Display data buffer 
  31.        ááááááááááááááá[7]  Move data in buffer 
  32.        ááááááááááááááá[8]  Change data in buffer 
  33.        ááááááááááááááá[9]  Clear symbol table 
  34.        ááááááááááááááá[10] Read symbol file (.LBL) 
  35.        ááááááááááááááá[11] Display symbol table 
  36.        ááááááááááááááá[12] Clear DB table 
  37.        ááááááááááááááá[13] Read DB table 
  38.        ááááááááááááááá[14] Write buffer to file 
  39.        ááááááááááááááá[15] Disassemble Program in buffer 
  40.        ááááááááááááááá[16] Set output options 
  41.        ááááááááááááááá[17] Hex Math 
  42.        ááááááááááááááá[18] Exit, go back to CP/M 
  43.         
  44.        
  45.  
  46.  
  47.  
  48.  
  49.  
  50.  
  51.  
  52.  
  53.  
  54.  
  55.  
  56.  
  57.  
  58.  
  59.  
  60.        
  61.  
  62.  
  63.  
  64.        4-26-86                     Page -1-                By Gil Shultz
  65.        
  66.  
  67.                                    DCOM8048
  68.        
  69.  
  70.  
  71.                           [1]  Initialized data buffer 
  72.        
  73.        áááááThis command allows you to initialize the data buffer to any
  74.        predetermined HEX value.  You caná useá toá initializeá theá data
  75.        bufferá atá theá start of the disassembly to A known value before
  76.        loading the data.
  77.  
  78.                              [2]  Read the Program 
  79.        
  80.        áááááUse this command to loadá yourá programá intoá theá internal
  81.        buffer.  You will be prompted first for the filename, you need to
  82.        enterá theá filename.ext,á no ambiguous characters are allowed in
  83.        the filename.  The file can be a binary image file, Hexá fileá in
  84.        either ascii or binary format.  After the filename is entered you
  85.        willá beá askedá forá theá type of file you are loading, then you
  86.        will be prompted as to the offset bias, most of the time itá will
  87.        beá "0".á  Theá fileá willá thená beá readá into the buffer, with
  88.        appropriate error messages, if something goes wrong.  If all went
  89.        OK, the entry point as well as the end of theá dataá loadedá will
  90.        beá displayedá to the user.  The buffer pointers will be adjusted
  91.        according to the length of the file, this is automatic andá needs
  92.        no intervention by the user.
  93.  
  94.                      [3]  Move memory image to data buffer 
  95.        
  96.        áááááThisá commandá is used to move a memory image from somewhere
  97.        in your machine to the data buffer.  The reason for this isá that
  98.        theá promá programerá mayá haveá read it into a address that DCOM
  99.        doesn't know about.  Currently all memory from 0 to 385BH is used
  100.        by DCOM, with the buffer starting at 385BH.  If the data is below
  101.        this point, it will be overwritten when DCOM is startedá up.á  If
  102.        it is above this point, it will be OK.
  103.  
  104.        áááááWhená the command is entered, the absolute starting point of
  105.        the buffer is displayed (actual address in your machine), withá a
  106.        promptá forá theá starting address (actual memory address in your
  107.        machine) where the code is located.  The last prompt will beá for
  108.        theá absoluteá ending address of the code in your machine.  Note,
  109.        the ending address must be greaterá thená theá startingá address,
  110.        andá youá areá notá allowedá toá moveá dataá fromá theá buffer to
  111.        elsewhere in your machine.  If you need to do this, exit DCOM and
  112.        you will find the data at the buffer starting address.
  113.  
  114.                              [4]  Adjust buffer end 
  115.        
  116.        áááááUse this command to move the buffer ending addressá iná your
  117.        machine.á  Normally you will not have to use this command, but it
  118.        is included as a convenience.
  119.  
  120.        áááááWhen this command is invoked, you will be givená theá buffer
  121.        startingá and ending addresses, as well as the maximum address it
  122.        can be set to.  Please note, this is actual memoryá addressesá in
  123.        yourá machine, not addresses referenced by the code that is to be
  124.        disassembled.
  125.  
  126.        
  127.  
  128.  
  129.  
  130.        4-26-86                     Page -2-                By Gil Shultz
  131.        
  132.  
  133.                                    DCOM8048
  134.        
  135.  
  136.  
  137.                      [5]  Set starting and Ending addresses 
  138.        
  139.        áááááThis allows you to set the starting andá endingá addressá of
  140.        theá buffer.á  Theseá addressesá areá relative to the code in the
  141.        buffer, NOT machine addresses.á  Normallyá theá startingá address
  142.        willá beá 00Há and the ending address will be the end of the code
  143.        loaded.  If no code was loaded, the default is 100H
  144.  
  145.                             [6]  Display data buffer 
  146.        
  147.        áááááUsing this command allowsá youá toá viewá theá dataá iná the
  148.        bufferá iná bothá HEXá andá ASCII formats.  This is useful to see
  149.        ascii data as well as to examine the data iná theá buffer.á  This
  150.        commandá dumpsá theá wholeá buffer,á withá Sá andá Q stopping and
  151.        starting the display.
  152.  
  153.                             [7]  Move data in buffer 
  154.        
  155.        áááááIf for any reason you need or want to moveá dataá aroundá in
  156.        theá buffer,á thisá isá theá commandá toá use.á  It automatically
  157.        determines which way to move the data, so itá doesn'tá trashá the
  158.        dataá iná theá buffer.á  Ifá you ask it to move the data form the
  159.        wrong place, to the wrong place, or incorrect amount, it willá do
  160.        it, as it does what you said, not what you meant.
  161.  
  162.        áááááYouá will be prompted for the starting and ending address of
  163.        the data you want to move, thená theá destinationá addressá where
  164.        theá dataá is to be moved to.  This command will not let you move
  165.        data out of the buffer, or move more data then is in theá buffer.
  166.        
  167.                            [8]  Change data in buffer 
  168.        
  169.        áááááIná orderá toá patch the data in the buffer, you need to use
  170.        this command.  You will be promptedá forá theá startingá address,
  171.        whichá is the address of the data you want to alter.  The address
  172.        will be shown along with the data followedá withá aá dash,á enter
  173.        the new data, then a space to advance to the next location.  If a
  174.        spaceá is entered after the dash, with no data being entered, the
  175.        data in the buffer will remain unchanged.  When you areá finished
  176.        changingá theá data,á enterá aá carriageá return to terminate the
  177.        command.  If you make a mistake in entering the data, reenter the
  178.        data, as only the last 8 bits are used, the rest being discarded.
  179.        This command will not allow you toá alterá dataá outsideá ofá the
  180.        buffer.
  181.  
  182.        
  183.                             [9]  Clear symbol table 
  184.        
  185.        áááááThisá commandá isá usedá to clear the internal symbol table,
  186.        that is generated with theá disassemblerá orá readá iná fromá the
  187.        (.LBL) file.
  188.  
  189.        
  190.  
  191.  
  192.        
  193.  
  194.  
  195.  
  196.        4-26-86                     Page -3-                By Gil Shultz
  197.        
  198.  
  199.                                    DCOM8048
  200.        
  201.  
  202.  
  203.                           [10] Read symbol file (.LBL) 
  204.        
  205.        áááááAsá youá progressá withá yourá disassembly, or have a source
  206.        listing, you can enter the labels into a fileá withá yourá editor
  207.        iná theá formatá "Label=XXXX"á where label is the label name, and
  208.        XXXX is the hex value of the address or data value.  Pleaseá note
  209.        theá disassemblerá willá use the first label it encounters in the
  210.        table.  Several labels can be entered on each line of text.á  The
  211.        labelsá theá disassembler generates will be in the form of ABXXXX
  212.        where A will be a "C" for a call reference and a "J" will beá for
  213.        a jmp reference to that label.  The first letter will always be a
  214.        "C"á orá "J",á butá theá secondá will be a "X" unless there was a
  215.        second reference to that labelá thatá isá notá theá sameá asá the
  216.        first.á  What this means it the label will start with "CX", "JX",
  217.        "CJ", or "JC".  The XXXX will be the address thatá theá labelá is
  218.        located at.
  219.  
  220.        áááááExperiment with your editor and generate several label files
  221.        to get comfortable with this feature.  This file is loaded at the
  222.        time the command is given.
  223.  
  224.                            [11] Display symbol table 
  225.        
  226.        áááááUseá thisá command to display all the symbols in the buffer.
  227.        
  228.                               [12] Clear DB table 
  229.        
  230.        áááááUsing your editor set up a file that tells theá disassembler
  231.        to use DB statements in disassembling the file.  Please note that
  232.        theá DBá addressá have to be in ascending order.  This file isn't
  233.        read until the disassembly takes place.  The format for theá file
  234.        isá "XXX-YYY" where XXX is the address that the DB statements are
  235.        to start, and YYY is the ending addressá ofá theá DBá statements.
  236.        You can use as many statements in your file as you like, but keep
  237.        them in ascending order.  You can place each statement on a line,
  238.        or you can place multiple statements on each line.
  239.  
  240.                                [13] Read DB table 
  241.        
  242.        áááááThisá commandá allows you to specify the filename.ext of the
  243.        DB table information.  All this does is set up theá fileá control
  244.        block, it doesn't do any checking to see if there is a valid file
  245.        oná the disk.  If you enter a invalid file specification, a error
  246.        will be displayed at disassembly time.
  247.  
  248.                            [14] Write buffer to file 
  249.        
  250.        áááááWhen you finish patching your code, or want toá saveá itá on
  251.        disk,á use this command.  When this command is given, you will be
  252.        prompted for the name of the file you want data to beá savedá in.
  253.        Note:á noá ambiguousá charactersá areá allowed in the filename or
  254.        extension.  After the file is specified, youá willá beá askedá if
  255.        thisá isá aá binaryá image file, if so, the data will be saved in
  256.        binary format.  If it isn't a binary file, you will beá askedá if
  257.        itá isá toá beá writtená in ascii, if the answer is yes, the data
  258.        will
  259.        
  260.  
  261.  
  262.  
  263.        4-26-86                     Page -4-                By Gil Shultz
  264.        
  265.                                    DCOM8048
  266.        
  267.  
  268.  
  269.        Γe saved in ascii intel hex format, if the answerá isá no,á   the
  270.        dataá willá beá savedá iná a binary hex format (not ascii).  DCOM
  271.        will ask you if a filename exists withá theá sameá name,á doá you
  272.        wantá to erase it?  The choice is yours, but note no backup files
  273.        areá generated.á  Whená theá fileá isá writtená toáá andáá closed
  274.        successfully or if there is a error, you will be notified.
  275.  
  276.                        [15] Disassemble Program in buffer  
  277.        
  278.        áááááThisá commandá is the core of the program, and automatically
  279.        disassembles all of the data in the buffer.  Itá isá aá twoá pass
  280.        disassembler,á usingá theá symbol and db files you told it to do.
  281.        Ifá youá didn'tá specifyá aá symbolá thatá itá needs,áá itáá will
  282.        automaticallyá generateá one for you, and show it on the listing.
  283.        
  284.        áááááThis command generatesá 3á differentá outputs,á oneá toá the
  285.        console, one to the printer, and one to the disk.  Each output if
  286.        formattedá forá itsá destination,á withá theá console showing the
  287.        information in a general format, the printer will looká likeá the
  288.        outputá ofá aá assembler,á andá the disk file will be ready for a
  289.        assembler.
  290.  
  291.                             [16] Set output options 
  292.        
  293.        áááááThis command directs the output toá theá devicesá youá want.
  294.        Youá willá beá askedá if it is to go to the list device, and to a
  295.        disk file.  If a disk file is specified, you willá beá askedá for
  296.        theá nameá ofá theá file, no ambiguous characters please.  If the
  297.        file is already open, you will be asked to close it or flushá it,
  298.        the choice is yours.
  299.  
  300.                                  [17] Hex Math 
  301.        
  302.        áááááThisá commandá is useful for calculating address offsets and
  303.        jump values.  You will be asked for "value one" and "valueá two",
  304.        DCOMá willá thená display the sum and difference of value one and
  305.        two.  After the calculation, you will be asked if you want toá do
  306.        another calculation, the choice is yours.
  307.  
  308.                            [18] Exit, go back to CP/M 
  309.        
  310.        áááááThisá is the proper way to exit DCOM and go back to the CP/M
  311.        operating system.
  312.  
  313.                                      Enjoy 
  314.        
  315.                                    Gil Shultz 
  316.        
  317.        P.S.
  318.  
  319.        áááááIf any problems occur, you can leaveá meá aá messageá oná my
  320.        BBS.  In order to do this, enter "CHAT D", and this will take you
  321.        to the message handler.  If some enhancements are wanted, you can
  322.        alsoá leaveá aá message.á  I wrote this program in 1982, and have
  323.        decided to put it in the public domain, butá itá cannotá beá used
  324.        for
  325.        
  326.  
  327.  
  328.  
  329.        4-26-86                     Page -5-                By Gil Shultz
  330.        
  331.                                    DCOM8048
  332.        
  333.  
  334.  
  335.        ßnyá commercialá reason,á norá caná it be sold or used as a sales
  336.        tool.  (C) 4/29/86 By Gil Shultz
  337.                                    The Realm 
  338.                                  (313) 349-3408 
  339.                                  Novi, Michigan 
  340.        
  341.  
  342.  
  343.  
  344.  
  345.  
  346.  
  347.  
  348.  
  349.  
  350.  
  351.  
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367.  
  368.  
  369.        
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.        
  391.  
  392.  
  393.  
  394.        4-26-86                     Page -6-                By Gil Shultz
  395.        
  396.  
  397.                                    DCOM8048
  398.        
  399.  
  400.  
  401.