]> git.sur5r.net Git - cc65/blobdiff - doc/ca65.sgml
Merge pull request #122 from groessler/a5200
[cc65] / doc / ca65.sgml
index 08469347461ee6ace310441afb5d6a71ac9506a1..b222b4aac5e5e692d6311c5d3bb871fdd4cf6019 100644 (file)
@@ -2,8 +2,8 @@
 
 <article>
 <title>ca65 Users Guide
-<author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
-<date>2000-07-19, 2000-11-29, 2001-10-02, 2005-09-08
+<author><url url="mailto:uz@cc65.org" name="Ullrich von Bassewitz">
+<date>2014-04-24
 
 <abstract>
 ca65 is a powerful macro assembler for the 6502, 65C02 and 65816 CPUs. It is
@@ -112,14 +112,12 @@ Long options:
   --debug                       Debug mode
   --debug-info                  Add debug info to object file
   --feature name                Set an emulation feature
-  --forget-inc-paths            Forget include search paths
   --help                        Help (this text)
   --ignore-case                 Ignore case of symbols
   --include-dir dir             Set an include directory search path
   --large-alignment             Don't warn about large alignments
   --listing name                Create a listing file if assembly was ok
   --list-bytes n                Maximum number of bytes per listing line
-  --macpack-dir dir             Set a macro package directory
   --memory-model model          Set the memory model
   --pagelength n                Set the page length for the listing
   --relax-checks                Relax some checks (see docs)
@@ -153,10 +151,7 @@ Here is a description of all the command line options:
   Set the default for the CPU type. The option takes a parameter, which
   may be one of
 
-               6502, 65SC02, 65C02, 65816, sunplus, sweet16, HuC6280
-
-  The sunplus cpu is not available in the freeware version, because the
-  instruction set is "proprietary and confidential".
+               6502, 65SC02, 65C02, 65816, sweet16, HuC6280
 
 
   <label id="option-create-dep">
@@ -195,14 +190,6 @@ Here is a description of all the command line options:
   command for a list of emulation features.
 
 
-  <label id="option--forget-inc-paths">
-  <tag><tt>--forget-inc-paths</tt></tag>
-
-  Forget the builtin include paths. This is most useful when building
-  customized assembler modules, in which case the standard header files should
-  be ignored.
-
-
   <label id="option-g">
   <tag><tt>-g, --debug-info</tt></tag>
 
@@ -251,17 +238,6 @@ Here is a description of all the command line options:
   number of printed bytes.
 
 
-  <label id="option--macpack-dir">
-  <tag><tt>--macpack-dir dir</tt></tag>
-
-  This options allows to specify a directory containing macro files that are
-  used instead of the builtin images when a <tt><ref id=".MACPACK"
-  name=".MACPACK"></tt> directive is encountered. If <tt>--macpack-dir</tt>
-  was specified, a <tt>.mac</tt> extension is added to the package name and
-  the resulting file is loaded from the given directory. This is most useful
-  when debugging the builtin macro packages.
-
-
   <label id="option-mm">
   <tag><tt>-mm model, --memory-model model</tt></tag>
 
@@ -393,20 +369,19 @@ Here is a description of all the command line options:
 Normal include files are searched in the following places:
 
 <enum>
-<item>The current directory.
-<item>A compiled-in directory, which is often <tt>/usr/lib/cc65/asminc</tt>
-      on Linux systems.
+<item>The current file's directory.
+<item>Any directory added with the <tt/<ref id="option-I" name="-I">/ option
+on the command line.
 <item>The value of the environment variable <tt/CA65_INC/ if it is defined.
 <item>A subdirectory named <tt/asminc/ of the directory defined in the
       environment variable <tt/CC65_HOME/, if it is defined.
-<item>Any directory added with the <tt/<ref id="option-I" name="-I">/ option
-on the command line.
+<item>An optionally compiled-in directory.
 </enum>
 
 Binary include files are searched in the following places:
 
 <enum>
-<item>The current directory.
+<item>The current file's directory.
 <item>Any directory added with the <tt/<ref id="option--bin-include-dir"
 name="--bin-include-dir">/ option on the command line.
 </enum>
@@ -450,8 +425,6 @@ The assembler accepts
       <tt><ref id=".PC02" name=".PC02"></tt> command was given).
 <item>all valid 65618 mnemonics when in 65816 mode (after the
       <tt><ref id=".P816" name=".P816"></tt> command was given).
-<item>all valid SunPlus mnemonics when in SunPlus mode (after the
-      <tt><ref id=".SUNPLUS" name=".SUNPLUS"></tt> command was given).
 </itemize>
 
 
@@ -480,9 +453,8 @@ mnemonics:
 6502X mode is an extension to the normal 6502 mode. In this mode, several
 mnemonics for illegal instructions of the NMOS 6502 CPUs are accepted. Since
 these instructions are illegal, there are no official mnemonics for them. The
-unofficial ones are taken from <htmlurl
-url="http://www.oxyron.de/html/opcodes02.html"
-name="http://www.oxyron.de/html/opcodes02.html">. Please note that only the
+unofficial ones are taken from <url
+url="http://www.oxyron.de/html/opcodes02.html">. Please note that only the
 ones marked as "stable" are supported. The following table uses information
 from the mentioned web page, for more information, see there.
 
@@ -529,8 +501,7 @@ nor does it call the interpreter. All this must be done by your program. Apple
 ][ programmers do probably know how to use sweet16 mode.
 
 For more information about SWEET 16, see
-<htmlurl url="http://www.6502.org/source/interpreters/sweet16.htm"
-name="http://www.6502.org/source/interpreters/sweet16.htm">.
+<url url="http://www.6502.org/source/interpreters/sweet16.htm">.
 
 
 <sect1>Number format<p>
@@ -843,7 +814,7 @@ to find branch targets (this is the reason why I for my part do
 prefer the "cheap" local labels). Nevertheless, unnamed labels are
 convenient in some situations, so it's your decision.
 
-<bf/Note:/ <ref id="scopes" name="Scopes"> organize named symbols, not
+<em/Note:/ <ref id="scopes" name="Scopes"> organize named symbols, not
 unnamed ones, so scopes don't have an effect on unnamed labels.
 
 
@@ -1013,7 +984,7 @@ is actually the same as
 This is the reason why a procedure must have a name. If you want a scope
 without a name, use <tt/<ref id=".SCOPE" name=".SCOPE">/.
 
-<bf/Note:/ As you can see from the example above, scopes and symbols live in
+<em/Note:/ As you can see from the example above, scopes and symbols live in
 different namespaces. There can be a symbol named <tt/foo/ and a scope named
 <tt/foo/ without any conflicts (but see the section titled <ref
 id="scopesearch" name="&quot;Scope search order&quot;">).
@@ -1290,14 +1261,14 @@ writable.
   Reading this pseudo variable will give the assembler version according to
   the following formula:
 
-        VER_MAJOR*$100 + VER_MINOR*$10 + VER_PATCH
+        VER_MAJOR*$100 + VER_MINOR*$10
 
   It may be used to encode the assembler version or check the assembler for
   special features not available with older versions.
 
   Example:
 
-  Version 2.11.1 of the assembler will return $2B1 as numerical constant when
+  Version 2.14 of the assembler will return $2E0 as numerical constant when
   reading the pseudo variable <tt/.VERSION/.
 
 
@@ -1694,7 +1665,7 @@ either a string or an expression.
   <tscreen><verb>
         .struct Point                   ; Struct size = 4
                 xcoord  .word
-                xcoord  .word
+                ycoord  .word
         .endstruct
 
         P:      .tag    Point           ; Declare a point
@@ -2694,7 +2665,7 @@ Here's a list of all control commands and a description, what they do:
     <tscreen><verb>
         lda     #'a
     </verb></tscreen>
-    <bf/Note:/ This does not work in conjunction with <tt/.FEATURE
+    <em/Note:/ This does not work in conjunction with <tt/.FEATURE
     loose_string_term/, since in this case the input would be ambiguous.
 
   <tag><tt>org_per_seg</tt><label id="org_per_seg"></tag>
@@ -3674,10 +3645,7 @@ Here's a list of all control commands and a description, what they do:
   Switch the CPU instruction set. The command is followed by a string that
   specifies the CPU. Possible values are those that can also be supplied to
   the <tt><ref id="option--cpu" name="--cpu"></tt> command line option,
-  namely: 6502, 6502X, 65SC02, 65C02, 65816, sunplus and HuC6280. Please
-  note that support for the sunplus CPU is not available in the freeware
-  version, because the instruction set of the sunplus CPU is "proprietary
-  and confidential".
+  namely: 6502, 6502X, 65SC02, 65C02, 65816 and HuC6280.
 
   See: <tt><ref id=".CPU" name=".CPU"></tt>,
        <tt><ref id=".IFP02" name=".IFP02"></tt>,
@@ -3736,17 +3704,6 @@ Here's a list of all control commands and a description, what they do:
             <tt><ref id=".UNION" name=".UNION"></tt>
 
 
-<sect1><tt>.SUNPLUS</tt><label id=".SUNPLUS"><p>
-
-  Enable the SunPlus instructions set. This command will not work in the
-  freeware version of the assembler, because the instruction set is
-  "proprietary and confidential".
-
-  See: <tt><ref id=".P02" name=".P02"></tt>, <tt><ref id=".PSC02"
-  name=".PSC02"></tt>, <tt><ref id=".PC02" name=".PC02"></tt>, and
-  <tt><ref id=".P816" name=".P816"></tt>
-
-
 <sect1><tt>.TAG</tt><label id=".TAG"><p>
 
   Allocate space for a struct or union.
@@ -4319,6 +4276,15 @@ Currently defined macros are:
                 beq     Arg
                 bcc     Arg
         .endmacro
+
+        .macro  bnz     Arg
+                bne     Arg
+        .endmacro
+
+        .macro  bze     Arg
+                beq     Arg
+        .endmacro
+
 </verb></tscreen>
 
 
@@ -4378,7 +4344,6 @@ each supported CPU a constant similar to
     CPU_65SC02
     CPU_65C02
     CPU_65816
-    CPU_SUNPLUS
     CPU_SWEET16
     CPU_HUC6280
 </verb></tscreen>
@@ -4392,7 +4357,6 @@ another constant is defined:
     CPU_ISET_65SC02
     CPU_ISET_65C02
     CPU_ISET_65816
-    CPU_ISET_SUNPLUS
     CPU_ISET_SWEET16
     CPU_ISET_HUC6280
 </verb></tscreen>
@@ -4430,22 +4394,29 @@ For better orthogonality, the assembler defines similar symbols as the
 compiler, depending on the target system selected:
 
 <itemize>
-<item><tt/__APPLE2__/ - Target system is <tt/apple2/
+<item><tt/__APPLE2__/ - Target system is <tt/apple2/ or <tt/apple2enh/
 <item><tt/__APPLE2ENH__/ - Target system is <tt/apple2enh/
-<item><tt/__ATARI__/ - Target system is <tt/atari/
+<item><tt/__ATARI5200__/ - Target system is <tt/atari5200/
+<item><tt/__ATARI__/ - Target system is <tt/atari/ or <tt/atarixl/
+<item><tt/__ATARIXL__/ - Target system is <tt/atarixl/
 <item><tt/__ATMOS__/ - Target system is <tt/atmos/
 <item><tt/__BBC__/ - Target system is <tt/bbc/
 <item><tt/__C128__/ - Target system is <tt/c128/
-<item><tt/__C16__/ - Target system is <tt/c16/
+<item><tt/__C16__/ - Target system is <tt/c16/ or <tt/plus4/
 <item><tt/__C64__/ - Target system is <tt/c64/
 <item><tt/__CBM__/ - Target is a Commodore system
 <item><tt/__CBM510__/ - Target system is <tt/cbm510/
 <item><tt/__CBM610__/ - Target system is <tt/cbm610/
-<item><tt/__GEOS__/ - Target system is <tt/geos/
+<item><tt/__GEOS__/ - Target is a GEOS system
+<item><tt/__GEOS_APPLE__/ - Target system is <tt/geos-apple/
+<item><tt/__GEOS_CBM__/ - Target system is <tt/geos-cbm/
 <item><tt/__LUNIX__/ - Target system is <tt/lunix/
+<item><tt/__LYNX__/ - Target system is <tt/lynx/
 <item><tt/__NES__/ - Target system is <tt/nes/
 <item><tt/__PET__/ - Target system is <tt/pet/
 <item><tt/__PLUS4__/ - Target system is <tt/plus4/
+<item><tt/__SIM6502__/ - Target system is <tt/sim6502/
+<item><tt/__SIM65C02__/ - Target system is <tt/sim65c02/
 <item><tt/__SUPERVISION__/ - Target system is <tt/supervision/
 <item><tt/__VIC20__/ - Target system is <tt/vic20/
 </itemize>
@@ -4744,15 +4715,6 @@ are used for the cbm load address.
 </enum>
 
 
-<sect>Bugs/Feedback<p>
-
-If you have problems using the assembler, if you find any bugs, or if
-you're doing something interesting with the assembler, I would be glad to
-hear from you. Feel free to contact me by email
-(<htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">).
-
-
-
 <sect>Copyright<p>
 
 ca65 (and all cc65 binutils) are (C) Copyright 1998-2003 Ullrich von