![kueller](/assets/img/avatar_default.png)
git-svn-id: svn://svn.compuextreme.de/Viitor/V962/Viitor_cc65@4352 504e572c-2e33-0410-9681-be2bf7408885
78 lines
2.9 KiB
HTML
78 lines
2.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<HTML>
|
|
<HEAD>
|
|
<META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.20">
|
|
<TITLE>da65 Users Guide: Detailed workings</TITLE>
|
|
<LINK HREF="da65-4.html" REL=next>
|
|
<LINK HREF="da65-2.html" REL=previous>
|
|
<LINK HREF="da65.html#toc3" REL=contents>
|
|
</HEAD>
|
|
<BODY>
|
|
<A HREF="da65-4.html">Next</A>
|
|
<A HREF="da65-2.html">Previous</A>
|
|
<A HREF="da65.html#toc3">Contents</A>
|
|
<HR>
|
|
<H2><A NAME="s3">3.</A> <A HREF="da65.html#toc3">Detailed workings</A></H2>
|
|
|
|
|
|
|
|
<H2><A NAME="ss3.1">3.1</A> <A HREF="da65.html#toc3.1">Supported CPUs</A>
|
|
</H2>
|
|
|
|
|
|
<P>The default (no CPU given on the command line or in the <CODE>GLOBAL</CODE> section of
|
|
the info file) is the 6502 CPU. The disassembler knows all "official" opcodes
|
|
for this CPU. Invalid opcodes are translated into <CODE>.byte</CODE> commands.</P>
|
|
<P>With the command line option <CODE>
|
|
<A HREF="da65-2.html#option--cpu">--cpu</A></CODE>, 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.</P>
|
|
<P>While there is some code for the 65816 in the sources, it is currently
|
|
unsupported.</P>
|
|
|
|
|
|
<H2><A NAME="ss3.2">3.2</A> <A HREF="da65.html#toc3.2">Attribute map</A>
|
|
</H2>
|
|
|
|
|
|
<P>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.</P>
|
|
|
|
<H2><A NAME="ss3.3">3.3</A> <A HREF="da65.html#toc3.3">Labels</A>
|
|
</H2>
|
|
|
|
|
|
<P>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 <CODE>Labcd</CODE>, where <CODE>abcd</CODE> is the hexadecimal
|
|
address of the label in upper case letters. You should probably avoid using
|
|
such label names for external labels.</P>
|
|
|
|
|
|
<H2><A NAME="ss3.4">3.4</A> <A HREF="da65.html#toc3.4">Info File</A>
|
|
</H2>
|
|
|
|
|
|
<P>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
|
|
<A HREF="da65-4.html#infofile">next section</A> for more information.</P>
|
|
|
|
|
|
|
|
<HR>
|
|
<A HREF="da65-4.html">Next</A>
|
|
<A HREF="da65-2.html">Previous</A>
|
|
<A HREF="da65.html#toc3">Contents</A>
|
|
</BODY>
|
|
</HTML>
|