]> git.sur5r.net Git - cc65/blobdiff - doc/da65.sgml
Forgot to add the new module that contains em_load_driver.
[cc65] / doc / da65.sgml
index 8f9ec91ec554ca395a3892fa1da0729a80878939..58d031eff37dec2b8eaa64d9f175cafe5d19eeb1 100644 (file)
@@ -55,14 +55,20 @@ Short options:
   -V                    Print the disassembler version
 
 Long options:
+  --argument-column n   Specify argument start column
+  --comment-column n    Specify comment start column
   --comments n          Set the comment level for the output
   --cpu type            Set cpu type
   --debug-info          Add debug info to object file
   --formfeeds           Add formfeeds to the output
   --help                Help (this text)
+  --hexoffs             Use hexadecimal label offsets
   --info name           Specify an info file
+  --label-break n       Add newline if label exceeds length n
+  --mnemonic-column n   Specify mnemonic start column
   --pagelength n        Set the page length for the listing
   --start-addr addr     Set the start/load address
+  --text-column n       Specify text start column
   --verbose             Increase verbosity
   --version             Print the disassembler version
 ---------------------------------------------------------------------------
@@ -75,6 +81,19 @@ Here is a description of all the command line options:
 
 <descrip>
 
+  <label id="option--argument-column">
+  <tag><tt>--argument-column n</tt></tag>
+
+  Specifies the column where the argument for a mnemonic or pseudo instruction
+  starts.
+
+
+  <label id="option--comment-column">
+  <tag><tt>--comment-column n</tt></tag>
+
+  Specifies the column where the comment for an instruction starts.
+
+
   <label id="option--comments">
   <tag><tt>--comments n</tt></tag>
 
@@ -88,9 +107,10 @@ Here is a description of all the command line options:
 
   Set the CPU type. The option takes a parameter, which may be one of
 
-               6502, 65SC02, 65C02
+               6502, 6502x, 65sc02, 65c02, huc6280
 
-  Support for the 65816 is currently not available.
+  6502x is the NMOS 6502 with illegal opcodes. huc6280 is the CPU of the PC
+  engine. Support for the 65816 is currently not available.
 
 
   <label id="option--formfeeds">
@@ -114,6 +134,12 @@ Here is a description of all the command line options:
   Print the short option summary shown above.
 
 
+  <label id="option--hexoffs">
+  <tag><tt>--hexoffs</tt></tag>
+
+  Output label offsets in hexadecimal instead of decimal notation.
+
+
   <label id="option--info">
   <tag><tt>-i name, --info name</tt></tag>
 
@@ -132,6 +158,23 @@ Here is a description of all the command line options:
   the output will go to the terminal.
 
 
+  <label id="option--label-break">
+  <tag><tt>--label-break n</tt></tag>
+
+  Adds a newline if the length of a label exceeds the given length.
+  Note: If the label would run into the code in the mid column, a
+  linefeed is always inserted regardless of this setting.
+
+  This option overrides the <ref id="global-options" name="global option">
+  <tt><ref id="LABELBREAK" name="LABELBREAK"></tt>.
+
+
+  <label id="option--mnemonic-column">
+  <tag><tt>--mnemonic-column n</tt></tag>
+
+  Specifies the column where a mnemonic or pseudo instrcuction is output.
+
+
   <label id="option--pagelength">
   <tag><tt>--pagelength n</tt></tag>
 
@@ -140,7 +183,7 @@ Here is a description of all the command line options:
   name="--formfeeds"></tt> is also given, a formfeed is inserted before
   generating the page header.
 
-  A value of -1 for the page length will disable paging of the output.
+  A value of zero for the page length will disable paging of the output.
 
 
   <label id="option--start-addr">
@@ -148,9 +191,16 @@ Here is a description of all the command line options:
 
   Specify the start/load address of the binary code that is going to be
   disassembled. The given address is interpreted as an octal value if
-  preceeded with a '0' digit, as a hexadecimal value if preceeded with '0x',
-  '0X', or '$', and as a decimal value in all other cases. If no start address
-  is specified, $10000 minus the size of the input file is used.
+  preceded with a '0' digit, as a hexadecimal value if preceded
+  with '0x', '0X', or '$', and as a decimal value in all other cases. If no
+  start address is specified, $10000 minus the size of the input file is used.
+
+
+  <label id="option--text-column">
+  <tag><tt>--text-column n</tt></tag>
+
+  Specifies the column where additional text is output. This additional text
+  consists of the bytes encoded in this line in text representation.
 
 
   <tag><tt>-v, --verbose</tt></tag>
@@ -247,38 +297,88 @@ following attributes are recognized:
 
 <descrip>
 
-  <tag><tt>COMMENTS</tt></tag>
+  <tag><tt/ARGUMENTCOLUMN/</tag>
+  This attribute specifies the column in the output, where the argument for
+  an opcode or pseudo instruction starts. The corresponding command line
+  option is
+  <tt><ref id="option--argument-column" name="--argument-column"></tt>.
+
+
+  <tag><tt/COMMENTCOLUMN/</tag>
+  This attribute specifies the column in the output, where the comment starts
+  in a line. It is only used for in-line comments. The corresponding command
+  line option is
+  <tt><ref id="option--comment-column" name="--comment-column"></tt>.
+
+
+  <label id="COMMENTS">
+  <tag><tt/COMMENTS/</tag>
   This attribute may be used instead of the <tt><ref id="option--comments"
   name="--comments"></tt> option on the command line. It takes a numerical
   parameter between 0 and 4. Higher values increase the amount of information
   written to the output file in form of comments.
 
 
-  <tag><tt>CPU</tt></tag>
+  <tag><tt/CPU/</tag>
   This attribute may be used instead of the <tt><ref id="option--cpu"
-  name="--cpu"></tt> option on the command line. It takes a string parameter.
+  name="--cpu"></tt> option on the command line. For possible values see
+  there. The value is a string and must be enclosed in quotes.
+
 
+  <tag><tt/HEXOFFS/</tag>
+  The attribute is followed by a boolean value. If true, offsets to labels are
+  output in hex, otherwise they're output in decimal notation. The default is
+  false. The attribute may be changed on the command line using the <tt><ref
+  id="option--hexoffs" name="--hexoffs"></tt> option.
 
-  <tag><tt>INPUTNAME</tt></tag>
+
+  <tag><tt/INPUTNAME/</tag>
   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.
 
 
-  <tag><tt>INPUTOFFS</tt></tag>
+  <tag><tt/INPUTOFFS/</tag>
   The attribute is followed by a numerical value that gives an offset into
   the input file which is skipped before reading data. The attribute may be
   used to skip headers or unwanted code sections in the input file.
 
 
-  <tag><tt>INPUTSIZE</tt></tag>
+  <tag><tt/INPUTSIZE/</tag>
   <tt/INPUTSIZE/ is followed by a numerical value that gives the amount of
   data to read from the input file. Data beyond <tt/INPUTOFFS + INPUTSIZE/
   is ignored.
 
 
+  <label id="LABELBREAK">
+  <tag><tt/LABELBREAK/</tag>
+  <tt/LABELBREAK/ is followed by a numerical value that specifies the label
+  length that will force a newline. To have all labels on their own lines,
+  you may set this value to zero.
+
+  See also the <tt><ref id="option--label-break" name="--label-break"></tt>
+  command line option. A <tt/LABELBREAK/ statement in the info file will
+  override any value given on the command line.
+
+
+  <tag><tt/MNEMONICCOLUMN/</tag>
+  This attribute specifies the column in the output, where the mnemonic or
+  pseudo instruction is placed. The corresponding command line option is
+  <tt><ref id="option--mnemonic-column" name="--mnemonic-column"></tt>.
+
+
+  <tag><tt/NEWLINEAFTERJMP/</tag>
+  This attribute is followed by a boolean value. When true, a newline is
+  inserted after each <tt/JMP/ instruction. The default is false.
+
+
+  <tag><tt/NEWLINEAFTERRTS/</tag>
+  This attribute is followed by a boolean value. When true, a newline is
+  inserted after each <tt/RTS/ instruction. The default is false.
+
+
   <label id="OUTPUTNAME">
-  <tag><tt>OUTPUTNAME</tt></tag>
+  <tag><tt/OUTPUTNAME/</tag>
   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 <tt><ref id="option-o" name="-o"></tt> option is
@@ -289,20 +389,28 @@ following attributes are recognized:
   the output will go to the terminal.
 
 
-  <tag><tt>PAGELENGTH</tt></tag>
+  <tag><tt/PAGELENGTH/</tag>
   This attribute may be used instead of the <tt><ref id="option--pagelength"
   name="--pagelength"></tt> option on the command line. It takes a numerical
   parameter. Using zero as page length (which is the default) means that no
   pages are generated.
 
 
-  <tag><tt>STARTADDR</tt></tag>
+  <tag><tt/STARTADDR/</tag>
   This attribute may be used instead of the <tt><ref id="option--start-addr"
   name="--start-addr"></tt> option on the command line. It takes a numerical
   parameter. The default for the start address is $10000 minus the size of
   the input file (this assumes that the input file is a ROM that contains the
   reset and irq vectors).
 
+
+  <tag><tt/TEXTCOLUMN/</tag>
+  This attribute specifies the column, where the data bytes are output
+  translated into ASCII text. It is only used if
+  <tt><ref id="COMMENTS" name="COMMENTS"></tt> is set to at least 4. The
+  corresponding command line option is
+  <tt><ref id="option--text-column" name="--text-column"></tt>.
+
 </descrip>
 
 
@@ -313,6 +421,11 @@ following attributes are recognized:
 
 <descrip>
 
+  <tag><tt>COMMENT</tt></tag>
+  This attribute is only allowed if a label is also given. It takes a string
+  as argument. See the description of the <tt><ref id="infofile-label"
+  name="LABEL"></tt> directive for an explanation.
+
   <tag><tt>END</tt></tag>
   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
@@ -388,12 +501,28 @@ code. The following attributes are recognized:
   <tag><tt>ADDR</tt></tag>
   Followed by a numerical value. Specifies the value of the label.
 
+  <tag><tt>COMMENT</tt></tag>
+  Attribute argument is a string. The comment will show up in a separate line
+  before the label, if the label is within code or data range, or after the
+  label if it is outside.
+
+  Example output:
+
+<tscreen><verb>
+        foo     := $0001        ; Comment for label named "foo"
+
+        ; Comment for label named "bar"
+        bar:
+</verb></tscreen>
+
   <tag><tt>NAME</tt></tag>
   The attribute is followed by a string value which gives the name of the
-  label.
+  label. Empty names are allowed, in this case the disassembler will create
+  an unnamed label (see the assembler docs for more information about unnamed
+  labels).
 
   <tag><tt>SIZE</tt></tag>
-  This attribute is optional and may be used to specifiy the size of the data
+  This attribute is optional and may be used to specify the size of the data
   that follows. If a size greater than 1 is specified, the disassembler will
   create labels in the form <tt/label+offs/ for all bytes within the given
   range, where <tt/label/ is the label name given with the <tt/NAME/
@@ -402,6 +531,72 @@ code. The following attributes are recognized:
 </descrip>
 
 
+<sect1>Specifying Segments<label id="infofile-segment"><p>
+
+The <tt/SEGMENT/ directive is used to specify a segment within the
+disassembled code. The following attributes are recognized:
+
+<descrip>
+
+  <tag><tt>START</tt></tag>
+  Followed by a numerical value. Specifies the start address of the segment.
+
+  <tag><tt>END</tt></tag>
+  Followed by a numerical value. Specifies the end address of the segment. The
+  end address is last the address that is part of the segment.
+
+  <tag><tt>NAME</tt></tag>
+  The attribute is followed by a string value which gives the name of the
+  segment.
+</descrip>
+
+All attributes are mandatory. Segments may not overlap. Since there is no
+explicit "end this segment" pseudo op, the disassembler cannot notify the
+assembler that one segment has ended. This may lead to errors if you don't
+define your segments carefully. As a rule of thumb, if you're using segments,
+your should define segments for all disassembled code.
+
+
+<sect1>Specifying Assembler Includes<label id="infofile-asminc"><p>
+
+The <tt/ASMINC/ directive is used to give the names of input files containing
+symbol assignments in assembler syntax:
+
+<tscreen><verb>
+               Name = value
+       Name := value
+</verb></tscreen>
+
+The usual conventions apply for symbol names. Values may be specified as hex
+(leading &dollar;), binary (leading %) or decimal. The values may optionally
+be signed.
+
+NOTE: The include file parser is very simple. Expressions are not allowed, and
+anything but symbol assignments is flagged as an error (but see the
+<tt/IGNOREUNKNOWN/ directive below).
+
+The following attributes are recognized:
+
+<descrip>
+
+  <tag><tt>FILE</tt></tag>
+  Followed by a string value. Specifies the name of the file to read.
+
+  <tag><tt>COMMENTSTART</tt></tag>
+  The optional attribute is followed by a character constant. It specifies the
+  character that starts a comment. The default value is a semicolon. This
+  value is ignored if <tt/IGNOREUNKNOWN/ is true.
+
+  <tag><tt>IGNOREUNKNOWN</tt></tag>
+  This attribute is optional and is followed by a boolean value. It allows to
+  ignore input lines that don't have a valid syntax. This allows to read in
+  assembler include files that contain more than just symbol assignments.
+  Note: When this attribute is used, the disassembler will ignore any errors
+  in the given include file. This may have undesired side effects.
+
+</descrip>
+
+
 <sect1>An Info File Example<p>
 
 The following is a short example for an info file that contains most of the
@@ -417,6 +612,8 @@ directives explained above:
             CPU             "6502";
         };
 
+        # One segment for the whole stuff
+        SEGMENT { START $E000;  END   $FFFF; NAME kernal; };
 
         RANGE {        START $E612;    END   $E631; TYPE Code;      };
         RANGE {        START $E632;    END   $E640; TYPE ByteTable; };
@@ -465,7 +662,7 @@ name="uz@cc65.org">).
 
 <sect>Copyright<p>
 
-da65 (and all cc65 binutils) are (C) Copyright 1998-2003 Ullrich von
+da65 (and all cc65 binutils) are (C) Copyright 1998-2007 Ullrich von
 Bassewitz. For usage of the binaries and/or sources the following
 conditions do apply: