]> git.sur5r.net Git - cc65/blob - doc/da65.sgml
First version of da65 docs
[cc65] / doc / da65.sgml
1 <!doctype linuxdoc system>
2
3 <article>
4 <title>da65 Users Guide
5 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
6 <date>2003-08-08
7
8 <abstract>
9 da65 is a 6502/65C02 disassembler that is able to read user supplied
10 information about its input data for better results. The output is ready for
11 feeding into ca65, the macro assembler supplied with the cc65 C compiler.
12 </abstract>
13
14 <!-- Table of contents -->
15 <toc>
16
17 <!-- Begin the document -->
18
19 <sect>Overview<p>
20
21 da65 is a disassembler for 6502/65C02 code. It is supplied as a utility with
22 the cc65 C compiler and generates output that is suitable for the ca65
23 macro assembler.
24
25 Besides generating output for ca65, one of the design goals was that the user
26 is able to feed additional information about the code into the disassembler
27 for improved results. This information may include the location and size of
28 tables, and their format.
29
30 One nice advantage of this concept is that disassembly information for
31 copyrighted binaries may be handled without problems: One can just pass the
32 information file for disassembling the binary, so everyone with a legal copy
33 of the binary can generate a nicely formatted disassembly with readable labels
34 and other information.
35
36
37 <sect>Usage<p>
38
39
40 <sect1>Command line option overview<p>
41
42 The assembler accepts the following options:
43
44 <tscreen><verb>
45 ---------------------------------------------------------------------------
46 Usage: da65 [options] file
47 Short options:
48   -g                    Add debug info to object file
49   -h                    Help (this text)
50   -o name               Name the output file
51   -v                    Increase verbosity
52   -F                    Add formfeeds to the output
53   -S addr               Set the start/load address
54   -V                    Print the disassembler version
55
56 Long options:
57   --cpu type            Set cpu type
58   --debug-info          Add debug info to object file
59   --formfeeds           Add formfeeds to the output
60   --help                Help (this text)
61   --pagelength n        Set the page length for the listing
62   --start-addr addr     Set the start/load address
63   --verbose             Increase verbosity
64   --version             Print the disassembler version
65 ---------------------------------------------------------------------------
66 </verb></tscreen>
67
68
69 <sect1>Command line options in detail<p>
70
71 Here is a description of all the command line options:
72
73 <descrip>
74
75   <label id="option--cpu">
76   <tag><tt>--cpu type</tt></tag>
77
78   Set the CPU type. The option takes a parameter, which may be one of
79
80         6502, 65SC02, 65C02
81
82   Support for the 65816 is currently not available.
83
84
85   <label id="option--formfeeds">
86   <tag><tt>-F, --formfeeds</tt></tag>
87
88   Add formfeeds to the generated output. This feature is useful together
89   with the <tt><ref id="option--pagelength" name="--pagelength"></tt> option.
90   If <tt/--formfeeds/ is given, a formfeed is added to the output after each
91   page.
92
93
94   <tag><tt>-g, --debug-info</tt></tag>
95
96   This option adds the <tt/.DEBUGINFO/ command to the output file, so the
97   assembler will generate debug information when reassembling the generated
98   output.
99
100
101   <tag><tt>-h, --help</tt></tag>
102
103   Print the short option summary shown above.
104
105
106   <tag><tt>-o name</tt></tag>
107
108   The default output name is the name of the input file with the extension
109   replaced by ".dis". If you don't like that, you may give another name with
110   the -o option. The output file will be placed in the same directory as
111   the source file, or, if -o is given, the full path in this name is used.
112
113
114   <label id="option--pagelength">
115   <tag><tt>--pagelength n</tt></tag>
116
117   Sets the length of a listing page in lines. After this number of lines, a
118   new page header is generated. If the <tt><ref id="option--formfeeds"
119   name="--formfeeds"></tt> is also given, a formfeed is inserted before
120   generating the page header.
121
122   A value of -1 for the page length will disable paging of the output.
123
124
125   <tag><tt>-S addr, --start-addr addr</tt></tag>
126
127   Specify the start/load address of the binary code that is going to be
128   disassembled. The given address is interpreted as an octal value if
129   preceeded with a '0' digit, as a hexadecimal value if preceeded with '0x',
130   '0X', or '$', and as a decimal value in all other cases. If no start address
131   is specified, 0xC000 is used - which is often not what you want.
132
133
134   <tag><tt>-v, --verbose</tt></tag>
135
136   Increase the assembler verbosity. Usually only needed for debugging
137   purposes. You may use this option more than one time for even more
138   verbose output.
139
140
141   <tag><tt>-V, --version</tt></tag>
142
143   Print the version number of the assembler. If you send any suggestions
144   or bugfixes, please include the version number.
145
146 </descrip>
147 <p>
148
149
150 <sect>Bugs/Feedback<p>
151
152 If you have problems using the disassembler, if you find any bugs, or if
153 you're doing something interesting with the assembler, I would be glad to hear
154 from you. Feel free to contact me by email (<htmlurl url="mailto:uz@cc65.org"
155 name="uz@cc65.org">).
156
157
158
159 <sect>Copyright<p>
160
161 da65 (and all cc65 binutils) are (C) Copyright 1998-2003 Ullrich von
162 Bassewitz. For usage of the binaries and/or sources the following
163 conditions do apply:
164
165 This software is provided 'as-is', without any expressed or implied
166 warranty.  In no event will the authors be held liable for any damages
167 arising from the use of this software.
168
169 Permission is granted to anyone to use this software for any purpose,
170 including commercial applications, and to alter it and redistribute it
171 freely, subject to the following restrictions:
172
173 <enum>
174 <item>  The origin of this software must not be misrepresented; you must not
175         claim that you wrote the original software. If you use this software
176         in a product, an acknowledgment in the product documentation would be
177         appreciated but is not required.
178 <item>  Altered source versions must be plainly marked as such, and must not
179         be misrepresented as being the original software.
180 <item>  This notice may not be removed or altered from any source
181         distribution.
182 </enum>
183
184
185
186 </article>
187
188
189
190