From 53538332e5029593dcc31559c300b3f6df637d52 Mon Sep 17 00:00:00 2001 From: cuz Date: Tue, 12 Aug 2003 11:26:53 +0000 Subject: [PATCH] Completed the first version of the da65 docs git-svn-id: svn://svn.cc65.org/cc65/trunk@2270 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- doc/da65.sgml | 274 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 268 insertions(+), 6 deletions(-) diff --git a/doc/da65.sgml b/doc/da65.sgml index ffe4f8cc4..cadc92f0e 100644 --- a/doc/da65.sgml +++ b/doc/da65.sgml @@ -27,11 +27,11 @@ is able to feed additional information about the code into the disassembler for improved results. This information may include the location and size of tables, and their format. -One nice advantage of this concept is that disassembly information for -copyrighted binaries may be handled without problems: One can just pass the -information file for disassembling the binary, so everyone with a legal copy -of the binary can generate a nicely formatted disassembly with readable labels -and other information. +One nice advantage of this concept is that disassembly of copyrighted binaries +may be handled without problems: One can just pass the information file for +disassembling the binary, so everyone with a legal copy of the binary can +generate a nicely formatted disassembly with readable labels and other +information. Usage

@@ -43,10 +43,11 @@ The assembler accepts the following options: --------------------------------------------------------------------------- -Usage: da65 [options] file +Usage: da65 [options] [inputfile] Short options: -g Add debug info to object file -h Help (this text) + -i name Specify an info file -o name Name the output file -v Increase verbosity -F Add formfeeds to the output @@ -58,6 +59,7 @@ Long options: --debug-info Add debug info to object file --formfeeds Add formfeeds to the output --help Help (this text) + --info name Specify an info file --pagelength n Set the page length for the listing --start-addr addr Set the start/load address --verbose Increase verbosity @@ -103,6 +105,16 @@ Here is a description of all the command line options: Print the short option summary shown above. +

+Detailed workings

+ +Supported CPUs

+ +The default (no CPU given on the command line or in the , the +disassembler may be told to recognize either the 65SC02 or 65C02 CPUs. The +latter understands the same opcodes as the former, plus 16 additional bit +manipulation and bit test-and-branch commands. + +While there is some code for the 65816 in the sources, it is currently +unsupported. + + +Attribute map

+ +The disassembler works by creating an attribute map for the whole address +space ($0000 - $FFFF). Initially, all attributes are cleared. Then, an +external info file (if given) is read. Disassembly is done in several passes. +In all passes with the exception of the last one, information about the +disassembled code is gathered and added to the symbol and attribute maps. The +last pass generates output using the information from the maps. + +Labels

+ +Some instructions may generate labels in the first pass, while most other +instructions do not generate labels, but use them if they are available. Among +others, the branch and jump instructions will generate labels for the target +of the branch in the first pass. External labels (taken from the info file) +have precedence over internally generated ones, They must be valid identifiers +as specified for the ca65 assembler. Internal labels (generated by the +disassembler) have the form Info File

+ +The info file is used to pass additional information about the input code to +the disassembler. This includes label names, data areas or tables, and global +options like input and output file names. See the for more information. + + + +Info File Format

+ +Global options may be specified in a group with the name + + INPUTNAME + + The attribute is followed by a string value, which gives the name of the + input file to read. If it is present, the disassembler does not accept an + input file name on the command line. + + + OUTPUTNAME + + The attribute is followed by string value, which gives the name of the + output file to write. If it is present, specification of an output file on + the command line using the option is + not allowed. + + If no output name is specified, the name of the input file with the + extension replaced by ".dis" is used. + + + PAGELENGTH + + This attribute may be used instead of the option on the command line. It takes a numerical + parameter. + + + STARTADDR + + This attribute may be used instead of the option on the command line. It takes a numerical + parameter. + + + CPU + + This attribute may be used instead of the option on the command line. It takes a string parameter. + + + + +Specifying Ranges

+ +The + + START + + This gives the start address of the range. + + + END + + This gives the end address of the range. The end address is inclusive, that + means, it is part of the range. Of course, it may not be smaller than the + start address. + + + TYPE + + This attribute specifies the type of data within the range. The attribute + value is one of the following keywords: + + + CODE + The range consists of code. + + BYTETABLE + The range consists of data and is disassembled as a byte table. + + WORDTABLE + The range consists of data and is disassembled as a table of words + (16 bit values). + + DWORDTABLE + The range consists of data and is disassembled as a table of double + words (32 bit values). + + ADDRTABLE + The range consists of data and is disassembled as a table of words + (16 bit values). The difference to the RTSTABLE + The range consists of data and is disassembled as a table of words (16 bit + values). The values are interpreted as words that are pushed onto the + stack and jump to it via TEXTTABLE + The range consists of readable text. + + + + + +Specifying Labels

+ +The + + NAME + + The attribute is followed by a string value which gives the name of the + label. + + + ADDR + + Followed by a numerical value. Specifies the value of the label. + + + SIZE + + This attribute is optional and may be used to specifiy the size of the data + that follows. If a size greater than 1 is specified, the disassembler will + create labels in the form + + +An Info File Example

+ +The following is a short example for an info file that contains most of the +directives explained above: + + + GLOBAL { + OUTPUTNAME "kernal.s"; + INPUTNAME "kernal.bin"; + STARTADDR $E000; + PAGELENGTH -1; # No paging + CPU "6502"; + }; + + + RANGE { START $E612; END $E631; TYPE Code; }; + RANGE { START $E632; END $E640; TYPE ByteTable; }; + RANGE { START $EA51; END $EA84; TYPE RtsTable; }; + RANGE { START $EC6C; END $ECAB; TYPE RtsTable; }; + RANGE { START $ED08; END $ED11; TYPE AddrTable; }; + + # Zero page variables + LABEL { NAME "fnadr"; ADDR $90; SIZE 3; }; + LABEL { NAME "sal"; ADDR $93; }; + LABEL { NAME "sah"; ADDR $94; }; + LABEL { NAME "sas"; ADDR $95; }; + + # Stack + LABEL { NAME "stack"; ADDR $100; SIZE 255; }; + + # Indirect vectors + LABEL { NAME "cinv"; ADDR $300; SIZE 2; }; # IRQ + LABEL { NAME "cbinv"; ADDR $302; SIZE 2; }; # BRK + LABEL { NAME "nminv"; ADDR $304; SIZE 2; }; # NMI + + # Jump table at end of kernal ROM + LABEL { NAME "kscrorg"; ADDR $FFED; }; + LABEL { NAME "kplot"; ADDR $FFF0; }; + LABEL { NAME "kiobase"; ADDR $FFF3; }; + LABEL { NAME "kgbye"; ADDR $FFF6; }; + + # Hardware vectors + LABEL { NAME "hanmi"; ADDR $FFFA; }; + LABEL { NAME "hares"; ADDR $FFFC; }; + LABEL { NAME "hairq"; ADDR $FFFE; }; + + + + + + Bugs/Feedback

If you have problems using the disassembler, if you find any bugs, or if -- 2.39.5