]> git.sur5r.net Git - cc65/blobdiff - doc/cc65.sgml
Since we have now builtin search paths, we need to be able to forget them,
[cc65] / doc / cc65.sgml
index e939de852b42739c6d8e34e6090bf8c1aa6d0679..443f12798b87b145ee15028c074b27e00876e271 100644 (file)
@@ -3,7 +3,7 @@
 <article>
 <title>cc65 Users Guide
 <author>Ullrich von Bassewitz, <htmlurl url="mailto:uz@cc65.org" name="uz@cc65.org">
-<date>03.09.2000, 02.10.2001
+<date>03.09.2000, 02.10.2001, 2005-8-1
 
 <abstract>
 cc65 is a C compiler for 6502 targets. It supports several 6502 based home
@@ -29,21 +29,22 @@ next release, since there are too many limitations in the current code,
 and removing these limitations would mean a rewrite of many more parts of
 the compiler.
 
-There is a separate document named "library.txt" that covers the library
-available for the compiler. If you know C and are interested in doing
-actual programming, the library documentation is probably of much more use
-than this document.
+There are separate documents named <url url="library.html"> and <url
+url="funcref.html"> that cover the library that is available for the compiler.
+If you know C, and are interested in doing actual programming, the library
+documentation is probably of much more use than this document.
 
 If you need some hints for getting the best code out of the compiler, you
-may have a look at "coding.txt" which covers some code generation issues.
+may have a look at <url url="coding.html"> which covers some code generation
+issues.
 
 
 
 <sect>Usage<p>
 
-The compiler translates C files into files containing assembler code that
+The compiler translates C files into files containing assembly code that
 may be translated by the ca65 macroassembler (for more information about
-the assembler, have a look at ca65.txt).
+the assembler, have a look at <url url="ca65.html">).
 
 
 <sect1>Command line option overview<p>
@@ -54,7 +55,6 @@ The compiler may be called as follows:
 ---------------------------------------------------------------------------
 Usage: cc65 [options] file
 Short options:
-  -A                    Strict ANSI mode
   -Cl                   Make local variables static
   -Dsym[=defn]          Define a symbol
   -I dir                Set an include directory search path
@@ -76,7 +76,6 @@ Short options:
 
 Long options:
   --add-source          Include source as comment
-  --ansi                Strict ANSI mode
   --bss-name seg        Set the name of the BSS segment
   --check-stack         Generate stack overflow checks
   --code-name seg       Set the name of the CODE segment
@@ -86,16 +85,19 @@ Long options:
   --data-name seg       Set the name of the DATA segment
   --debug               Debug mode
   --debug-info          Add debug info to object file
+  --forget-inc-paths    Forget include search paths
   --help                Help (this text)
   --include-dir dir     Set an include directory search path
   --register-space b    Set space available for register variables
   --register-vars       Enable register variables
   --rodata-name seg     Set the name of the RODATA segment
   --signed-chars        Default characters are signed
+  --standard std        Language standard (c89, c99, cc65)
   --static-locals       Make local variables static
   --target sys          Set the target system
   --verbose             Increase verbosity
   --version             Print the compiler version number
+  --writable-strings    Make string literals writable
 ---------------------------------------------------------------------------
 </verb></tscreen>
 
@@ -106,14 +108,6 @@ Here is a description of all the command line options:
 
 <descrip>
 
-  <label id="option-A">
-  <tag><tt>-A, --ansi</tt></tag>
-
-  This option disables any compiler exensions. Have a look at section 5
-  for a discussion of compiler extensions. In addition, the macro
-  <tt/__STRICT_ANSI__/ is defined, when using one of these options.
-
-
   <tag><tt>--bss-name seg</tt></tag>
 
   Set the name of the bss segment.
@@ -122,7 +116,7 @@ Here is a description of all the command line options:
   <tag><tt>--check-stack</tt></tag>
 
   Tells the compiler to generate code that checks for stack overflows. See
-  <tt><ref id="pragma-checkstack" name="#pragma checkstack"></tt> for an
+  <tt><ref id="pragma-checkstack" name="#pragma&nbsp;checkstack"></tt> for an
   explanation of this feature.
 
 
@@ -131,12 +125,13 @@ Here is a description of all the command line options:
   Set the name of the code segment.
 
 
+  <label id="option-codesize">
   <tag><tt>--codesize x</tt></tag>
 
-  This options allows finer control about speed vs. size decisions in the
-  code generation phase. It gives the allowed size increase factor (in
-  percent). The default is 100 when not using <tt/-Oi/ and 200 when using
-  <tt/-Oi/ (<tt/-Oi/ is the same as <tt/--codesize 200/).
+  This options allows finer control about speed vs. size decisions in the code
+  generation and optimization phases. It gives the allowed size increase
+  factor (in percent). The default is 100 when not using <tt/-Oi/ and 200 when
+  using <tt/-Oi/ (<tt/-Oi/ is the same as <tt/-O --codesize&nbsp;200/).
 
 
   <tag><tt>--cpu CPU</tt></tag>
@@ -168,6 +163,13 @@ Here is a description of all the command line options:
   is defined to the value "1".
 
 
+  <tag><tt>--forget-inc-paths</tt></tag>
+
+  Forget the builtin include paths. This is most useful when building
+  customized C or runtime libraries, in which case the standard header
+  files should be ignored.
+
+
   <tag><tt>-g, --debug-info</tt></tag>
 
   This will cause the compiler to insert a <tt/.DEBUGINFO/ command into the
@@ -193,13 +195,13 @@ Here is a description of all the command line options:
   locations). There is some overhead involved with register variables, since
   the old contents of the registers must be saved and restored. Since register
   variables are of limited use without the optimizer, there is also a combined
-  switch: <tt/-Or/ will enable both, the optmizer and register variables.
+  switch: <tt/-Or/ will enable both, the optimizer and register variables.
 
   For more information about register variables see <ref id="regvars"
-  name="register variables">. 
+  name="register variables">.
 
   The compiler setting can also be changed within the source file by using
-  <tt><ref id="pragma-regvars" name="#pragma regvars"></tt>.
+  <tt><ref id="pragma-regvars" name="#pragma&nbsp;regvars"></tt>.
 
 
   <tag><tt>--register-space</tt></tag>
@@ -226,8 +228,24 @@ Here is a description of all the command line options:
   6502 has no provisions for sign extending characters (which is needed on
   almost any load operation), this will make the code larger and slower. A
   better way is to declare characters explicitly as "signed" if needed. You
-  can also use <tt><ref id="pragma-signedchars" name="#pragma
-  signedchars"></tt> for better control of this option.
+  can also use <tt><ref id="pragma-signedchars"
+  name="#pragma&nbsp;signedchars"></tt> for better control of this option.
+
+
+  <label id="option--standard">
+  <tag><tt>--standard std</tt></tag>
+
+  This option allows to set the language standard supported. The argument is
+  one of
+  <itemize>
+  <item>c89
+  <item>c99
+  <item>cc65
+  </itemize>
+
+  Please note that the compiler does not support the c99 standard and never
+  will. c99 mode is actually c89 mode with a few selected c99 extensions
+  (// comments for example).
 
 
   <tag><tt>-t target, --target target</tt></tag>
@@ -239,16 +257,22 @@ Here is a description of all the command line options:
   <itemize>
   <item>none
   <item>apple2
+  <item>apple2enh
   <item>atari
   <item>atmos
   <item>c16 (works also for the c116 with memory up to 32K)
   <item>c64
   <item>c128
-  <item>plus4
   <item>cbm510 (CBM-II series with 40 column video)
   <item>cbm610 (all CBM-II II computers with 80 column video)
-  <item>pet (all CBM PET systems except the 2001)
   <item>geos
+  <item>lunix
+  <item>lynx
+  <item>nes
+  <item>pet (all CBM PET systems except the 2001)
+  <item>plus4
+  <item>supervision
+  <item>vic20
   </itemize>
 
   <tag><tt>-v, --verbose</tt></tag>
@@ -257,6 +281,12 @@ Here is a description of all the command line options:
   or warnings are encountered.
 
 
+  <tag><tt>--writable-strings</tt></tag>
+
+  Make string literals writable by placing them into the data segment instead
+  of the rodata segment.
+
+
   <tag><tt>-Cl, --static-locals</tt></tag>
 
   Use static storage for local variables instead of storage on the stack.
@@ -274,8 +304,8 @@ Here is a description of all the command line options:
        }
   </verb></tscreen>
 
-  the variable a will always have the value 1 when entering the function
-  and using <tt/-Cl/, while in
+  the variable <tt/a/ will always have the value <tt/1/ when entering the
+  function and using <tt/-Cl/, while in
 
   <tscreen><verb>
        void f (void)
@@ -285,12 +315,13 @@ Here is a description of all the command line options:
        }
   </verb></tscreen>
 
-  the variable a will have the value 1 only the first time, the function
-  is entered, and will keep the old value from one call of the function to
-  the next.
+  the variable <tt/a/ will have the value <tt/1/ only the first time that the
+  function is entered, and will keep the old value from one call of the
+  function to the next.
 
-  You may also use <tt><ref id="pragma-staticlocals" name="#pragma
-  staticlocals"></tt> to change this setting in your sources.
+  You may also use <tt><ref id="pragma-staticlocals"
+  name="#pragma&nbsp;staticlocals"></tt> to change this setting in your
+  sources.
 
 
   <tag><tt>-I dir, --include-dir dir</tt></tag>
@@ -300,6 +331,7 @@ Here is a description of all the command line options:
   search list.
 
 
+  <label id="option-O">
   <tag><tt>-O, -Oi, -Or, -Os</tt></tag>
 
   Enable an optimizer run over the produced code.
@@ -308,7 +340,7 @@ Here is a description of all the command line options:
   runtime functions would have been called, even if the generated code is
   larger. This will not only remove the overhead for a function call, but will
   make the code visible for the optimizer. <tt/-Oi/ is an alias for
-  <tt/--codesize 200/.
+  <tt/-O --codesize&nbsp;200/.
 
   <tt/-Or/ will make the compiler honor the <tt/register/ keyword. Local
   variables may be placed in registers (which are actually zero page
@@ -326,8 +358,9 @@ Here is a description of all the command line options:
        <tt/-Os/ will actually break things.
        <p>
   <item>The inlined string and memory functions will not handle strings or
-       memory areas larger than 255 bytes. Similar, the inlined <tt/is..()/
-       functions will not work with values outside char range.
+       memory areas larger than 255 bytes. Similarly, the inlined <tt/is..()/
+       functions will not work with values outside the char. range (such as
+       <tt/EOF/).
        <p>
   </itemize>
   <p>
@@ -349,6 +382,7 @@ Here is a description of all the command line options:
   version.
 
 
+  <label id="option-W">
   <tag><tt>-W</tt></tag>
 
   This option will suppress any warnings generated by the compiler. Since
@@ -364,57 +398,56 @@ The compiler will accept one C file per invocation and create a file with
 the same base name, but with the extension replaced by ".s". The output
 file contains assembler code suitable for the use with the ca65 macro
 assembler.
-
-In addition to the paths named in the <tt/-I/ option on the command line, the
-directory named in the environment variable <tt/CC65_INC/ is added to the
-search path for include files on startup.
+                                               
+Include files in single quotes are searched in the following places:
+<enum>
+<item>The current directory.
+<item>The value of the environment variable <tt/CC65_INC/ if it is defined.
+<item>Any directory added with the <tt/-I/ option on the command line.
+</enum>
+
+Include files in angle brackets are searched in the following places:
+<enum>
+<item>A compiled in directory which is often <tt>/usr/lib/cc65/include</tt> on
+      Linux systems.
+<item>The value of the environment variable <tt/CC65_INC/ if it is defined.
+<item>A subdirectory named <tt/include/ of the directory defined in the 
+      environment variable <tt/CC65_HOME/, if it is defined.
+<item>Any directory added with the <tt/-I/ option on the command line.
+</enum>
 
 
 
 <sect>Differences to the ISO standard<p>
 
+Apart from the things listed below, the compiler does support additional
+keywords, has several functions in the standard headers with names outside the
+reserved namespace and a few syntax extensions. All these can be disabled with
+the <tt><ref id="option--standard" name="--standard"></tt> command line
+option. Its use for maximum standards compatibility is advised.
+
 Here is a list of differences between the language, the compiler accepts,
 and the one defined by the ISO standard:
 
 <itemize>
 
-<item> The compiler allows single line comments that start with //. This
-       feature is disabled in strict ANSI mode.
-       <p>
-<item> The compiler allows unnamed parameters in parameter lists. The
-       compiler will not issue warnings about unused parameters that don't
-       have a name. This feature is disabled in strict ANSI mode.
-       <p>
-<item> The compiler has some additional keywords:
-       <p>
-       <itemize>
-       <item><tt/asm/
-       <item><tt/__asm__/
-       <item><tt/fastcall/
-       <item><tt/__fastcall__/
-       <item><tt/__AX__/
-       <item><tt/__EAX__/
-       <item><tt/__func__/
-       <item><tt/__attribute__/
-       </itemize>
-       <p>
-       The keywords without the underlines are disabled in strict ANSI mode.
-       <p>
 <item> The datatypes "float" and "double" are not available.
        <p>
-<item> The compiler does not support bit fields.
-       <p>
 <item>         C Functions may not return structs (or unions), and structs may not
         be passed as parameters by value. However, struct assignment *is*
        possible.
        <p>
 <item> Part of the C library is available only with fastcall calling
-       conventions (see below). This means, that you may not mix pointers to
-       those functions with pointers to user written functions.
+       conventions (see below).  It means that you must not mix pointers to
+       those functions with pointers to user-written, not-fastcall functions.
+       <p>
+<item> The <tt/volatile/ keyword doesn't have an effect. This is not as bad
+        as it sounds, since the 6502 has so few registers that it isn't
+        possible to keep values in registers anyway.
        <p>
 </itemize>
 
-There may be some more minor differences, I'm currently not aware off. The
+There may be some more minor differences I'm currently not aware of. The
 biggest problem is the missing float data type. With this limitation in
 mind, you should be able to write fairly portable code.
 
@@ -426,11 +459,6 @@ This cc65 version has some extensions to the ISO C standard.
 
 <itemize>
 
-<item> The compiler allows // comments (like in C++ and in the proposed C9x
-       standard). This feature is disabled by <tt><ref id="option-A"
-       name="-A"></tt>.
-       <p>
-
 <item> The compiler allows to insert assembler statements into the output
        file. The syntax is
 
@@ -449,9 +477,8 @@ This cc65 version has some extensions to the ISO C standard.
        <ref id="inline-asm" name="see there">.
        <p>
 
-<item> There is a special calling convention named "fastcall". This calling
-       convention is currently only usable for functions written in
-       assembler. The syntax for a function declaration using fastcall is
+<item> There is a special calling convention named "fastcall".
+       The syntax for a function declaration using fastcall is
 
        <tscreen><verb>
        &lt;return type&gt; fastcall &lt;function name&gt; (&lt;parameter list&gt;)
@@ -464,8 +491,9 @@ This cc65 version has some extensions to the ISO C standard.
        <tscreen><verb>
                void __fastcall__ f (unsigned char c)
        </verb></tscreen>
-       The first form of the fastcall keyword is in the user namespace and is
-       therefore disabled in strict ANSI mode.
+       The first form of the fastcall keyword is in the user namespace and can
+       therefore be disabled with the <tt><ref id="option--standard"
+        name="--standard"></tt> command line option.
 
        For functions declared as <tt/fastcall/, the rightmost parameter is not
        pushed on the stack but left in the primary register when the function
@@ -482,7 +510,11 @@ This cc65 version has some extensions to the ISO C standard.
        sequences of assembler code. For example, the macro
 
        <tscreen><verb>
-               #define hi(x) (__AX__=(x),asm("\ttxa\n\tldx\t#$00",__AX__)
+               #define hi(x)           \
+            (__AX__ = (x),      \
+             asm ("txa"),       \
+             asm ("ldx #$00"),  \
+             __AX__)
        </verb></tscreen>
 
        will give the high byte of any unsigned value.
@@ -522,27 +554,28 @@ This cc65 version has some extensions to the ISO C standard.
        However, taking the address of the variable results in a <tt/void*/
        which may be passed to any function expecting a pointer.
 
-       See the <htmlurl url="geos.html" name="GEOS library"> for examples on
-       how to use this feature.
+       See the <url url="geos.html" name="GEOS library document"> for examples
+       on how to use this feature.
        <p>
 
 <item>  cc65 implements flexible array struct members as defined in the C99 ISO
-        standard. As an extension, in non ANSI mode, these fields may be
-        initialized. There are several exceptions, however (which is probably
-        the reason why the standard does not define this feature, because it is
-        highly unorthogonal). Flexible array members cannot be initialized...
+        standard. As an extension, these fields may be initialized. There are
+        several exceptions, however (which is probably the reason why the
+        standard does not define this feature, because it is highly
+        unorthogonal). Flexible array members cannot be initialized ...
 
         <itemize>
-        <item>  ...when defining an array of structs with flexible members.
-        <item>  ...if such a struct is a member field of another struct which
-                is not the last field.
-        <item>  If the struct which contains a flexible array member is
-                declared as <tt/register/ and the size and compiler settings
-                do allow the compiler to actually place the struct into the
+        <item>... when defining an array of structs with flexible
+                members.
+        <item>... if such a struct is a member field of another struct
+                which is not the last field.
+        <item>... if the struct which contains a flexible array member is
+                declared as <tt/register/, and the size and compiler settings
+                do allow the compiler actually to place the struct into the
                 register bank in the zero page.
         </itemize>
 
-        Please note that - as defined in the ISO C standard - the <tt/sizeof/
+        Please note that -- as defined in the ISO C standard -- the <tt/sizeof/
         operator returns the struct size with the flexible array member having
         size zero, even if it is initialized.
         <p>
@@ -560,13 +593,17 @@ The compiler defines several macros at startup:
   <tag><tt>__CC65__</tt></tag>
 
   This macro is always defined. Its value is the version number of the
-  compiler in hex. Version 2.0.1 of the compiler will have this macro defined
-  as 0x0201.
+  compiler in hex.  For example, version 2.10.1 of the compiler has this macro
+  defined as <tt/0x02A1/.
 
   <tag><tt>__APPLE2__</tt></tag>
 
   This macro is defined if the target is the Apple ][ (-t apple2).
 
+  <tag><tt>__APPLE2ENH__</tt></tag>
+
+  This macro is defined if the target is the enhanced Apple //e (-t apple2enh).
+
   <tag><tt>__ATARI__</tt></tag>
 
   This macro is defined if the target is one of the Atari computers
@@ -605,6 +642,18 @@ The compiler defines several macros at startup:
 
   This macro is defined if you are compiling for the GEOS system (-t geos).
 
+  <tag><tt>__LUNIX__</tt></tag>
+
+  This macro is defined if you are compiling for the LUnix system (-t lunix).
+
+  <tag><tt>__LYNX__</tt></tag>
+
+  This macro is defined if the target is the Atari Lynx (-t lynx).
+
+  <tag><tt>__NES__</tt></tag>
+
+  This macro is defined if the target is the NES (-t nes).
+
   <tag><tt>__PET__</tt></tag>
 
   This macro is defined if the target is the PET family of computers (-t pet).
@@ -613,6 +662,10 @@ The compiler defines several macros at startup:
 
   This macro is defined if the target is the plus/4 (-t plus4).
 
+  <tag><tt>__SUPERVISION__</tt></tag>
+
+  This macro is defined if the target is the supervision (-t supervision).
+
   <tag><tt>__VIC20__</tt></tag>
 
   This macro is defined if the target is the vic20 (-t vic20).
@@ -625,10 +678,15 @@ The compiler defines several macros at startup:
 
   This macro expands to the current line number.
 
-  <tag><tt>__STRICT_ANSI__</tt></tag>
+  <tag><tt>__CC65_STD__</tt></tag>
 
-  This macro is defined to 1 if the <tt/-A/ compiler option was given, and
-  undefined otherwise.
+  This macro is defined to one of the following depending on the <tt><ref
+  id="option--standard" name="--standard"></tt> command line option:
+  <itemize>
+  <item><tt/__CC65_STD_C89__/
+  <item><tt/__CC65_STD_C99__/
+  <item><tt/__CC65_STD_CC65__/
+  </itemize>
 
   <tag><tt>__OPT__</tt></tag>
 
@@ -649,7 +707,7 @@ The compiler defines several macros at startup:
 </descrip>
 
 
-<sect>#pragmas<label id="pragmas"><p>
+<sect>&num;pragmas<label id="pragmas"><p>
 
 The compiler understands some pragmas that may be used to change code
 generation and other stuff. Some of these pragmas understand a special form:
@@ -657,7 +715,7 @@ If the first parameter is <tt/push/, the old value is saved onto a stack
 before changing it. The value may later be restored by using the <tt/pop/
 parameter with the <tt/#pragma/.
 
-<sect1><tt>#pragma bssseg (&lt;name&gt;)</tt><p>
+<sect1><tt>#pragma bssseg (&lsqb;push,&rsqb;&lt;name&gt;)</tt><p>
 
   This pragma changes the name used for the BSS segment (the BSS segment
   is used to store uninitialized data). The argument is a string enclosed
@@ -671,6 +729,8 @@ parameter with the <tt/#pragma/.
   use another BSS segment, you have to do that yourself, otherwise
   uninitialized variables do not have the value zero.
 
+  The <tt/#pragma/ understands the push and pop parameters as explained above.
+
   Example:
   <tscreen><verb>
                #pragma bssseg ("MyBSS")
@@ -696,8 +756,8 @@ parameter with the <tt/#pragma/.
     <itemize>
     <item>The character index is actually the code of the character in the
          C source, so character mappings do always depend on the source
-         character set. This means that <tt/#pragma charmap/ is not portable
-         - it depends on the build environment.
+         character set. This means that <tt/#pragma&nbsp;charmap/ is not
+         portable -- it depends on the build environment.
     <item>While it is possible to use character literals as indices, the
          result may be somewhat unexpected, since character literals are
          itself translated. For this reason I would suggest to avoid
@@ -711,7 +771,7 @@ parameter with the <tt/#pragma/.
   </verb></tscreen>
 
 
-<sect1><tt>#pragma checkstack (on|off)</tt><label id="pragma-checkstack"><p>
+<sect1><tt>#pragma checkstack ([push,]on|off)</tt><label id="pragma-checkstack"><p>
 
   Tells the compiler to insert calls to a stack checking subroutine to detect
   stack overflows. The stack checking code will lead to somewhat larger and
@@ -724,7 +784,7 @@ parameter with the <tt/#pragma/.
 
   The <tt/#pragma/ understands the push and pop parameters as explained above.
 
-<sect1><tt>#pragma codeseg (&lt;name&gt;)</tt><p>
+<sect1><tt>#pragma codeseg ([push,]&lt;name&gt;)</tt><p>
 
   This pragma changes the name used for the CODE segment (the CODE segment
   is used to store executable code). The argument is a string enclosed in
@@ -734,13 +794,25 @@ parameter with the <tt/#pragma/.
   segments. If you use other segments, you have to create a new linker
   configuration file.
 
+  The <tt/#pragma/ understands the push and pop parameters as explained above.
+
   Example:
   <tscreen><verb>
        #pragma codeseg ("MyCODE")
   </verb></tscreen>
 
 
-<sect1><tt>#pragma dataseg (&lt;name&gt;)</tt><p>
+<sect1><tt>#pragma codesize ([push,]&lt;int&gt;)</tt><label id="pragma-codesize"><p>
+
+  This pragma allows finer control about speed vs. size decisions in the code
+  generation and optimization phase. It gives the allowed size increase factor
+  (in percent). The default is can be changed by use of the <tt/<ref
+  id="option-codesize" name="--codesize">/ compiler option.
+
+  The <tt/#pragma/ understands the push and pop parameters as explained above.
+
+
+<sect1><tt>#pragma dataseg ([push,]&lt;name&gt;)</tt><p>
 
   This pragma changes the name used for the DATA segment (the DATA segment
   is used to store initialized data). The argument is a string enclosed in
@@ -750,13 +822,31 @@ parameter with the <tt/#pragma/.
   segments. If you use other segments, you have to create a new linker
   configuration file.
 
+  The <tt/#pragma/ understands the push and pop parameters as explained above.
+
   Example:
   <tscreen><verb>
        #pragma dataseg ("MyDATA")
   </verb></tscreen>
 
 
-<sect1><tt>#pragma rodataseg (&lt;name&gt;)</tt><p>
+<sect1><tt>#pragma optimize ([push,]on|off)</tt><label id="pragma-optimize"><p>
+
+  Switch optimization on or off. If the argument is "off", optimization is
+  disabled, otherwise it is enabled. Please note that this pragma only effects
+  whole functions. The setting in effect when the function is encountered will
+  determine if the generated code is optimized or not.
+
+  Optimization and code generation is also controlled by the <ref
+  id="pragma-codesize" name="codesize pragma">.
+
+  The default is "off", but may be changed with the <tt/<ref name="-O"
+  id="option-O">/ compiler option.
+
+  The <tt/#pragma/ understands the push and pop parameters as explained above.
+
+
+<sect1><tt>#pragma rodataseg ([push,]&lt;name&gt;)</tt><p>
 
   This pragma changes the name used for the RODATA segment (the RODATA
   segment is used to store readonly data). The argument is a string
@@ -766,6 +856,8 @@ parameter with the <tt/#pragma/.
   segments. If you use other segments, you have to create a new linker
   configuration file.
 
+  The <tt/#pragma/ understands the push and pop parameters as explained above.
+
   Example:
   <tscreen><verb>
        #pragma rodataseg ("MyRODATA")
@@ -783,7 +875,7 @@ parameter with the <tt/#pragma/.
   declared as register. So your programs become non-portable if you use
   this pragma. In addition, your program may not work. This is usually the
   case if a subroutine is called with the address of a register variable,
-  and this subroutine (or a subroutine called from there) uses itself
+  and this subroutine (or a subroutine called from there) uses
   register variables. So be careful with this #pragma.
 
   The <tt/#pragma/ understands the push and pop parameters as explained above.
@@ -806,7 +898,7 @@ parameter with the <tt/#pragma/.
   The <tt/#pragma/ understands the push and pop parameters as explained above.
 
 
-<sect1><tt>#pragma signedchars (on|off)</tt><label id="pragma-signedchars"><p>
+<sect1><tt>#pragma signedchars ([push,]on|off)</tt><label id="pragma-signedchars"><p>
 
   Changes the signedness of the default character type. If the argument is
   "on", default characters are signed, otherwise characters are unsigned.
@@ -817,7 +909,7 @@ parameter with the <tt/#pragma/.
   The <tt/#pragma/ understands the push and pop parameters as explained above.
 
 
-<sect1><tt>#pragma staticlocals (on|off)</tt><label id="pragma-staticlocals"<p>
+<sect1><tt>#pragma staticlocals ([push,]on|off)</tt><label id="pragma-staticlocals"<p>
 
   Use variables in the bss segment instead of variables on the stack. This
   pragma changes the default set by the compiler option <tt/-Cl/. If the
@@ -827,9 +919,18 @@ parameter with the <tt/#pragma/.
   The <tt/#pragma/ understands the push and pop parameters as explained above.
 
 
+<sect1><tt>#pragma warn ([push,]on|off)</tt><label id="pragma-warn"><p>
+
+  Switch compiler warnings on or off. If the argument is "off", warnings are
+  disabled, otherwise they're enabled. The default is "on", but may be changed
+  with the <tt/<ref name="-W" id="option-W">/ compiler option.
+
+  The <tt/#pragma/ understands the push and pop parameters as explained above.
+
+
 <sect1><tt>#pragma zpsym (&lt;name&gt;)</tt><p>
 
-  Tell the compiler that the - previously as external declared - symbol with
+  Tell the compiler that the -- previously as external declared -- symbol with
   the given name is a zero page symbol (usually from an assembler file).
   The compiler will create a matching import declaration for the assembler.
 
@@ -899,7 +1000,7 @@ or
 <p>
 
 The first form is in the user namespace and is disabled by <tt><ref
-id="option-A" name="-A"></tt>.
+id="option--standard" name="--standard"></tt> if the argument is not <tt/cc65/.
 
 The asm statement may be used inside a function and on global file level. An
 inline assembler statement is a primary expression, so it may also be used as
@@ -925,11 +1026,12 @@ each format specifier, an argument is expected which is inserted instead of
 the format specifier before passing the assembly code line to the backend.
 
 <itemize>
-  <item><tt/%b/ - Numerical 8 bit value
-  <item><tt/%w/ - Numerical 16 bit value
-  <item><tt/%l/ - Numerical 32 bit value
+  <item><tt/%b/ - Numerical 8-bit value
+  <item><tt/%w/ - Numerical 16-bit value
+  <item><tt/%l/ - Numerical 32-bit value
   <item><tt/%v/ - Assembler name of a (global) variable or function
   <item><tt/%o/ - Stack offset of a (local) variable
+  <item><tt/%g/ - Assembler name of a C label
   <item><tt/%s/ - The argument is converted to a string
   <item><tt/%%/ - The % sign itself
 </itemize><p>
@@ -957,28 +1059,42 @@ Or, to access a struct member of a static variable:
 </verb></tscreen>
 <p>
 
-Note: Do not embedd the assembler labels that are used as names of global
+Note: Do not embed the assembler labels that are used as names of global
 variables or functions into your asm statements. Code like this
 
 <tscreen><verb>
         int foo;
         int bar () { return 1; }
-               __asm__ ("lda _foo");   /* DON'T DO THAT! */
+               __asm__ ("lda _foo");           /* DON'T DO THAT! */
         ...
-        __asm__ ("jsr _bar");   /* DON'T DO THAT EITHER! */
+        __asm__ ("jsr _bar");           /* DON'T DO THAT EITHER! */
 </verb></tscreen>
 <p>
 
 may stop working if the way, the compiler generates these names is changed in
-a future version. Instead use the format specifiers from the table above.
+a future version. Instead use the format specifiers from the table above:
+
+<tscreen><verb>
+               __asm__ ("lda %v", foo);        /* OK */
+        ...
+        __asm__ ("jsr %v", bar);        /* OK */
+</verb></tscreen>
 <p>
 
 
+<sect>Implementation-defined behavior<p>
+
+This section describes the behavior of cc65 when the standard describes the
+behavior as implementation-defined.
+
+(to be done)
+
 <sect>Bugs/Feedback<p>
 
 If you have problems using the compiler, if you find any bugs, or if you're
 doing something interesting with it, 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">).
+free to contact me by email (<htmlurl url="mailto:uz@cc65.org"
+name="uz@cc65.org">).
 
 
 
@@ -1024,14 +1140,28 @@ This is the original compiler copyright:
 --------------------------------------------------------------------------
 </verb></tscreen>
 
-In acknowledgment of this copyright, I will place my own changes to the
-compiler under the same copyright. Please note however, that the library
-and all binutils are covered by another copyright, and that I'm planning
-to do a complete rewrite of the compiler, after which the compiler
-copyright will also change.
-
-For the list of changes requested by this copyright see newvers.txt.
-
+Small parts of the compiler (parts of the preprocessor and main parser) are
+still covered by this copyright. The main portion is covered by the usual
+cc65 license, which reads:
+
+This software is provided 'as-is', without any expressed or implied
+warranty.  In no event will the authors be held liable for any damages
+arising from the use of this software.
+
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it
+freely, subject to the following restrictions:
+
+<enum>
+<item>         The origin of this software must not be misrepresented; you must not
+               claim that you wrote the original software. If you use this software
+               in a product, an acknowledgment in the product documentation would be
+       appreciated but is not required.
+<item> Altered source versions must be plainly marked as such, and must not
+       be misrepresented as being the original software.
+<item> This notice may not be removed or altered from any source
+       distribution.
+</enum>
 
 </article>