* doc/sdccman.lyx: fixed unmeant removal of spaces
[fw/sdcc] / doc / sdccman.lyx
index 92f96031b1730f9cff0c1c968c168cbbe90c3c76..629c0c2cbc824d42d78fd460db596fb9b0d3dd58 100644 (file)
@@ -1,4 +1,4 @@
-#LyX 1.4.4 created this file. For more info see http://www.lyx.org/
+#LyX 1.4.5 created this file. For more info see http://www.lyx.org/
 \lyxformat 245
 \begin_document
 \begin_header
@@ -104,7 +104,7 @@ SDCC Compiler User Guide
 \begin_layout Date
 
 \size normal
-SDCC 2.6.5
+SDCC 2.7.5
 \size footnotesize
 
 \newline
@@ -730,7 +730,7 @@ open source
 freeware
 \emph default
 ; source code for all the sub-packages (pre-processor, assemblers, linkers
- etc) is distributed with the package.
+ etc.) is distributed with the package.
  This documentation is maintained using a free open source word processor
  (LyX).
 \newline
@@ -836,8 +836,20 @@ It would be fine to add to each item, in which version was it changed.
 \begin_layout Itemize
 short is now equivalent to int (16 bits), it used to be equivalent to char
  (8 bits) which is not ANSI compliant.
- To maintain compatibility, old programs may be compiled using the --short-is-8b
-its commandline option (see 
+ To maintain compatibility, old programs may be compiled using the -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-short-is-8bits commandline option (see 
 \begin_inset LatexCommand \vref{lyx:--short-is-8bits}
 
 \end_inset
@@ -1404,7 +1416,25 @@ status collapsed
 
 \end_inset
 
--disable-pic-port Excludes the PIC port
+-disable-pic-port Excludes the PIC14 port
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-disable-pic16-port Excludes the PIC16 port
 \end_layout
 
 \begin_layout List
@@ -1534,14 +1564,14 @@ status collapsed
 
 \end_inset
 
--help` and the man/info pages of `configure` for details.
+-help' and the man/info pages of `configure' for details.
 \newline
 
 \newline
 The names of the
  standard libraries STD_LIB, STD_INT_LIB, STD_LONG_LIB, STD_FP_LIB, STD_DS390_LI
 B, STD_XA51_LIB and the environment variables SDCC_DIR_NAME, SDCC_INCLUDE_NAME,
- SDCC_LIB_NAME are defined by `configure` too.
+ SDCC_LIB_NAME are defined by `configure' too.
  At the moment it's not possible to change the default settings (it was
  simply never required).
 \newline
@@ -2811,7 +2841,7 @@ model
 
 \begin_layout Standard
 \noindent
-The install paths can still be changed during `make install` with e.g.:
+The install paths can still be changed during `make install' with e.g.:
 \end_layout
 
 \begin_layout LyX-Code
@@ -3923,7 +3953,7 @@ Type
 \end_layout
 
 \begin_layout Subsection
-Building SDCC on OSX 2.x
+Building SDCC on Mac OS X
 \end_layout
 
 \begin_layout Standard
@@ -3931,8 +3961,8 @@ Follow the instruction for Linux.
 \newline
 
 \newline
-On OSX 2.x it was reported, that the default
- gcc (version 3.1 20020420 (prerelease)) fails to compile SDCC.
+On Mac OS X 10.2.x it was reported, that the
default gcc (version 3.1 20020420 (prerelease)) fails to compile SDCC.
  Fortunately there's also gcc 2.9.x installed, which works fine.
  This compiler can be selected by running 'configure' with:
 \end_layout
@@ -3941,6 +3971,36 @@ On OSX 2.x it was reported, that the default
 ./configure CC=gcc2 CXX=g++2
 \end_layout
 
+\begin_layout Standard
+Universal (ppc and i386) binaries can be produced on Mac OS X 10.4.x with
+ Xcode.
+ Run 'configure' with:
+\end_layout
+
+\begin_layout LyX-Code
+./configure 
+\backslash
+
+\end_layout
+
+\begin_layout LyX-Code
+LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch
+ ppc" 
+\backslash
+
+\end_layout
+
+\begin_layout LyX-Code
+CXXFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch
+ ppc" 
+\backslash
+
+\end_layout
+
+\begin_layout LyX-Code
+CFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
+\end_layout
+
 \begin_layout Subsection
 Cross compiling SDCC on Linux for Windows
 \end_layout
@@ -4611,8 +4671,8 @@ This is not only usefull for building different binaries, e.g.
  generated files are not scattered between the source files.
  And the best thing is: if you want to change a file you can leave the original
  file untouched in the source directory.
- Simply copy it to the build directory, edit it, enter `make clean`, `rm
- Makefile.dep` and `make`.
+ Simply copy it to the build directory, edit it, enter `make clean', `rm
+ Makefile.dep' and `make'.
  
 \series bold
 make
@@ -6249,6 +6309,28 @@ sdcclib libint.lib _moduint.rel
 \family sans
 \series bold
 sdcclib libint.lib _mulint.rel
+\family default
+\series default
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+Or, if you preffer:
+\family sans
+\series bold
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+sdcclib libint.lib _divsint.rel _divuint.rel _modsint.rel _moduint.rel _mulint.rel
+\family default
 \series default
 
 \newline
@@ -6257,7 +6339,110 @@ sdcclib libint.lib _mulint.rel
 
 \begin_layout Standard
 If the file already exists in the library, it will be replaced.
- To see what modules and symbols are included in the library, options -s
+ If a list of .rel files is available, you can tell sdcclib to add those
+ files to a library.
+ For example, if the file 'myliblist.txt' contains
+\family sans
+\series bold
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+_divsint.rel
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+_divuint.rel
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+_modsint.rel
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+_moduint.rel
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+_mulint.rel
+\family default
+\series default
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+Use
+\family sans
+\series bold
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+sdcclib -l libint.lib myliblist.txt
+\family default
+\series default
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+Additionally, you can instruct sdcclib to compiles the files before adding
+ them to the library.
+ This is achieved using the environment variables SDCCLIB_CC and/or SDCCLIB_AS.
+ For example:
+\family sans
+\series bold
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+set SDCCLIB_CC=sdcc -c
+\end_layout
+
+\begin_layout Standard
+
+\family sans
+\series bold
+sdcclib -l libint.lib myliblist.txt
+\family default
+\series default
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+To see what modules and symbols are included in the library, options -s
  and -m are available.
  For example:
 \newline
@@ -8060,6 +8245,38 @@ status collapsed
  Causes the linker to use old style for allocating memory areas.
 \end_layout
 
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-acall-ajmp
+\series default
+\InsetSpace ~
+
+\begin_inset LatexCommand \index{-\/-acall-ajmp}
+
+\end_inset
+
+ Replaces the three byte instructions lcall/ljmp with the two byte instructions
+ acall/ajmp.
+ Only use this option if your code is in the same 2k block of memory.
+ You may need to use this option for some 8051 derivatives which lack the
+ lcall/ljmp instructions..
+\end_layout
+
 \begin_layout Standard
 \begin_inset VSpace bigskip
 \end_inset
@@ -8264,77 +8481,10 @@ status collapsed
 \begin_layout List
 \labelwidthstring 00.00.0000
 
-\series bold
---stack-8-bit - switches off the 10-bit mode
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout List
-\labelwidthstring 00.00.0000
-
-\series bold
--
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-/
-\end_layout
-
-\end_inset
-
--stack-probe
-\begin_inset LatexCommand \index{DS390!Options!-\/-stack-probe}
-
-\end_inset
-
-
-\series default
- insert call to function __stack_probe at each function prologue.
-\end_layout
-
-\begin_layout List
-\labelwidthstring 00.00.0000
-
-\series bold
--
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-/
-\end_layout
-
-\end_inset
-
--tini-libid
-\begin_inset LatexCommand \index{DS390!Options!-\/-tini-libid}
-
-\end_inset
-
-
-\series default
- <nnnn> LibraryID used in -mTININative.
-\end_layout
-
-\begin_layout List
-\labelwidthstring 00.00.0000
-
 \series bold
 -
 \begin_inset ERT
-status collapsed
+status open
 
 \begin_layout Standard
 
@@ -8345,33 +8495,113 @@ status collapsed
 
 \end_inset
 
--use-accelerator
-\begin_inset LatexCommand \index{DS390!Options!-\/-use-accelerator}
-
-\end_inset
-
-
-\series default
- generate code for DS390 Arithmetic Accelerator.
-\end_layout
-
-\begin_layout Standard
-\begin_inset VSpace bigskip
-\end_inset
-
-
+-stack-8-bit - switches off the 10-bit mode
 \end_layout
 
-\begin_layout Subsection
-Z80 Options
-\begin_inset LatexCommand \index{Options Z80}
-
-\end_inset
-
-
-\begin_inset LatexCommand \index{Z80}
-
+\end_inset
+
+
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-stack-probe
+\begin_inset LatexCommand \index{DS390!Options!-\/-stack-probe}
+
+\end_inset
+
+
+\series default
+ insert call to function __stack_probe at each function prologue.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-tini-libid
+\begin_inset LatexCommand \index{DS390!Options!-\/-tini-libid}
+
+\end_inset
+
+
+\series default
+ <nnnn> LibraryID used in -mTININative.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-use-accelerator
+\begin_inset LatexCommand \index{DS390!Options!-\/-use-accelerator}
+
+\end_inset
+
+
+\series default
+ generate code for DS390 Arithmetic Accelerator.
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Z80 Options
+\begin_inset LatexCommand \index{Options Z80}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{Z80}
+
 \end_inset
 
 
@@ -8436,7 +8666,257 @@ status collapsed
 
  When linking, skip the standard crt0.o object file.
  You must provide your own crt0.o for your system when linking.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-portmode=
+\series default
+<Value>
+\begin_inset LatexCommand \index{Z80!Options!-\/-portmode=<Value>}
+
+\end_inset
+
+ Determinate PORT I/O mode (<Value> is z80 or z180).
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-asm=
+\series default
+<Value>
+\begin_inset LatexCommand \index{Z80!Options!-\/-asm=<Value>}
+
+\end_inset
+
+ Define assembler name (<Value> is rgbds, asxxxx, isas or z80asm).
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-codeseg
+\series default
+\InsetSpace ~
+<Value>
+\begin_inset LatexCommand \index{Z80!Options!-\/-codeseg <Value>}
+
+\end_inset
+
+ Use <Value> for the code segment name.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-constseg
+\series default
+\InsetSpace ~
+<Value>
+\begin_inset LatexCommand \index{Z80!Options!-\/-constseg <Value>}
+
+\end_inset
+
+ Use <Value> for the const segment name.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+GBZ80 Options
+\begin_inset LatexCommand \index{Options GBZ80}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{GBZ80}
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-callee-saves-bc
+\series default
+
+\begin_inset LatexCommand \index{GBZ80!Options!-\/-callee-saves-bc}
+
+\end_inset
+
+
+\size large
+\emph on
  
+\size default
+\emph default
+Force a called function to always save BC.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-bo
+\series default
+\InsetSpace ~
+<Num>
+\begin_inset LatexCommand \index{GBZ80!Options!-bo <Num>}
+
+\end_inset
+
+ Use code bank <Num>.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-ba
+\series default
+\InsetSpace ~
+<Num>
+\begin_inset LatexCommand \index{GBZ80!Options!-ba <Num>}
+
+\end_inset
+
+ Use data bank <Num>.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-codeseg
+\series default
+\InsetSpace ~
+<Value>
+\begin_inset LatexCommand \index{GBZ80!Options!-\/-codeseg <Value>}
+
+\end_inset
+
+ Use <Value> for the code segment name.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-constseg
+\series default
+\InsetSpace ~
+<Value>
+\begin_inset LatexCommand \index{GBZ80!Options!-\/-constseg <Value>}
+
+\end_inset
+
+ Use <Value> for the const segment name.
 \end_layout
 
 \begin_layout Standard
@@ -9031,11 +9511,74 @@ status collapsed
 
  
 \series default
-The output path resp.
file where everything will be placed.
+The output path where everything will be placed or the file name used for
all generated output files.
  If the parameter is a path, it must have a trailing slash (or backslash
  for the Windows binaries) to be recognized as a path.
+
+\emph on
  
+\emph default
+Note for Windows users: if the path contains spaces, it should be surrounded
+ by quotes.
+ The trailing backslash should be doubled in order to prevent escaping the
+ final quote, for example: 
+\emph on
+-o 
+\begin_inset Quotes sld
+\end_inset
+
+F:
+\backslash
+Projects
+\backslash
+test3
+\backslash
+output 1
+\backslash
+
+\backslash
+
+\begin_inset Quotes srd
+\end_inset
+
+
+\emph default
+ or put after the final quote, for example: 
+\emph on
+-o 
+\begin_inset Quotes sld
+\end_inset
+
+F:
+\backslash
+Projects
+\backslash
+test3
+\backslash
+output 1
+\begin_inset Quotes srd
+\end_inset
+
+
+\backslash
+
+\emph default
+.
+ The path using slashes for directory delimiters can be used too, for example:
+\emph on
+-o 
+\begin_inset Quotes sld
+\end_inset
+
+F:/Projects/test3/output 1/
+\begin_inset Quotes srd
+\end_inset
+
+
+\emph default
+.
 \end_layout
 
 \begin_layout List
@@ -9091,7 +9634,41 @@ reentrant
  Parameters and Local Variables for more details.
  If this option is used all source files in the project should be compiled
  with this option.
- It automatically implies --int-long-reent and --float-reent.
+ It automatically implies -
+\series bold
+
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+
+\series default
+-int-long-reent and -
+\series bold
+
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+
+\series default
+-float-reent.
  
 \end_layout
 
@@ -9436,7 +10013,24 @@ status collapsed
  unsigned
 \family default
 .
- To set the signess for characters to unsigned, use the option --funsigned-char.
+ To set the signess for characters to unsigned, use the option -
+\series bold
+
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+
+\series default
+-funsigned-char.
  If this option is set and no signedness keyword (unsigned/signed) is given,
  a char will be signed.
  All other types are unaffected.
@@ -9630,14 +10224,14 @@ status collapsed
 
 \end_inset
 
--no-peep-comments
-\begin_inset LatexCommand \index{-\/-no-peep-comments}
+-fverbose-asm
+\begin_inset LatexCommand \index{-\/-no-gen-comments}
 
 \end_inset
 
 
 \series default
Will not include peep-hole comments in the generated files.
Include code generator and peep-hole comments in the generated asm files.
 \end_layout
 
 \begin_layout List
@@ -9657,14 +10251,31 @@ status collapsed
 
 \end_inset
 
--no-gen-comments
-\begin_inset LatexCommand \index{-\/-no-gen-comments}
+-no-peep-comments
+\begin_inset LatexCommand \index{-\/-no-peep-comments}
 
 \end_inset
 
 
 \series default
- Will not include code generator comments in the generated files.
+ Don't include peep-hole comments in the generated asm files even if -
+\series bold
+
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+
+\series default
+-fverbose-asm option is specified.
 \end_layout
 
 \begin_layout List
@@ -9782,6 +10393,33 @@ status collapsed
 \begin_layout Standard
 
 
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-Werror
+\begin_inset LatexCommand \index{-\/-Werror}
+
+\end_inset
+
+
+\series default
+ Treat all warnings as errors.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
 \backslash
 /
 \end_layout
@@ -10068,7 +10706,7 @@ status collapsed
 
 \InsetSpace ~
 <Name> The name to be used for the const
-\begin_inset LatexCommand \index{code}
+\begin_inset LatexCommand \index{const}
 
 \end_inset
 
@@ -10382,7 +11020,7 @@ status collapsed
 
 
 \series default
- Will create a dump of iCode's, after global subexpression elimination
+ Will create a dump of iCodes, after global subexpression elimination
 \begin_inset LatexCommand \index{Global subexpression elimination}
 
 \end_inset
@@ -10416,7 +11054,7 @@ status collapsed
 
 
 \series default
- Will create a dump of iCode's, after deadcode elimination
+ Will create a dump of iCodes, after deadcode elimination
 \begin_inset LatexCommand \index{Dead-code elimination}
 
 \end_inset
@@ -10453,7 +11091,7 @@ status collapsed
 \size large
  
 \size default
-Will create a dump of iCode's, after loop optimizations
+Will create a dump of iCodes, after loop optimizations
 \begin_inset LatexCommand \index{Loop optimization}
 
 \end_inset
@@ -10490,7 +11128,7 @@ status collapsed
 \size large
  
 \size default
-Will create a dump of iCode's, after live range analysis
+Will create a dump of iCodes, after live range analysis
 \begin_inset LatexCommand \index{Live range analysis}
 
 \end_inset
@@ -10559,7 +11197,7 @@ status collapsed
  
 \series default
 \bar default
-Will create a dump of iCode's, after register assignment
+Will create a dump of iCodes, after register assignment
 \begin_inset LatexCommand \index{Register assignment}
 
 \end_inset
@@ -10640,7 +11278,7 @@ Redirecting output on Windows Shells
 \end_layout
 
 \begin_layout Standard
-By default SDCC writes it's error messages to 
+By default SDCC writes its error messages to 
 \begin_inset Quotes sld
 \end_inset
 
@@ -12507,29 +13145,36 @@ status collapsed
 \end_inset
 
 ) are good places to look for such overlaps.
- Variables with an absolute address are 
-\emph on
-not
-\begin_inset Marginal
-status collapsed
+\end_layout
 
 \begin_layout Standard
-
-\series bold
-\InsetSpace ~
-!
-\end_layout
+If however you provide an initializer
+\begin_inset LatexCommand \index{Variable initialization}
 
 \end_inset
 
+ actual memory allocation will take place and overlaps will be detected
+ by the linker.
+ E.g.:
+\end_layout
 
-\emph default
- initialized
-\begin_inset LatexCommand \index{Variable initialization}
+\begin_layout Verse
 
+\family typewriter
+__code __at (0x7ff0) char Id[5] = 
+\begin_inset Quotes sld
 \end_inset
 
-.
+SDCC
+\begin_inset Quotes srd
+\end_inset
+
+;
+\end_layout
+
+\begin_layout Standard
+In the above example the variable Id will be located from 0x7ff0 to 0x7ff4
+ in code memory.
 \end_layout
 
 \begin_layout Standard
@@ -12882,7 +13527,7 @@ Parameters
 Automatic (local) variables and parameters to functions can either be placed
  on the stack or in data-space.
  The default action of the compiler is to place these variables in the internal
- RAM (for small model) or external RAM (for large model).
+ RAM (for small model) or external RAM (for medium or large model).
  This in fact makes them similar to 
 \emph on
 static
@@ -14793,7 +15438,24 @@ The compiler triggers the linker to link certain initialization modules
 
  called crt<something>.
  Only the necessary ones are linked, for instance crtxstack.asm (GSINIT1,
- GSINIT5) is not linked unless the --xstack option is used.
+ GSINIT5) is not linked unless the -
+\series bold
+
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+
+\series default
+-xstack option is used.
  These modules are highly entangled by the use of special segments/areas,
  but a common layout is shown below:
 \end_layout
@@ -15293,6 +15955,17 @@ mov a,r0
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
+orl a,#(l_PSEG
+ >> 8)
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
 jz 00006$
 \newline
 \InsetSpace ~
@@ -15303,8 +15976,7 @@ jz 00006$
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-mov
- r1,#s_PSEG
+mov r1,#s_PSEG
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -15327,7 +15999,8 @@ mov __XPAGE,#(s_PSEG >> 8)
 clr a
 \newline
 00005$:\InsetSpace ~
-movx @r1,a
+movx
+ @r1,a
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -15349,8 +16022,7 @@ inc r1
 \InsetSpace ~
 djnz r0,00005$
 \newline
-0
-0006$:
+00006$:
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -15380,7 +16052,8 @@ mov a,r0
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-orl a,#(l_XSEG >> 8)
+orl a,#(l_XSEG >>
+ 8)
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -15400,8 +16073,7 @@ jz 00008$
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-mov r1,#((l_XSEG
- + 255) >> 8)
+mov r1,#((l_XSEG + 255) >> 8)
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -15424,7 +16096,8 @@ mov dptr,#s_XSEG
 clr a
 \newline
 00007$:\InsetSpace ~
-movx @dptr,a
+movx
+ @dptr,a
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -15454,8 +16127,7 @@ djnz r0,00007$
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-djnz
- r1,00007$
+djnz r1,00007$
 \newline
 00008$:
 \end_layout
@@ -15748,6 +16420,75 @@ status collapsed
 \end_inset
 
  about MCS51-variants.
+\newline
+
+\end_layout
+
+\begin_layout Standard
+While these initialization modules are meant as generic startup code there
+ might be the need for customization.
+ Let's assume the return value of 
+\emph on
+_sdcc_external_startup()
+\emph default
+ in 
+\emph on
+crtstart.asm
+\emph default
+ should not be checked (or 
+\emph on
+_sdcc_external_startup()
+\emph default
+ should not be called at all).
+ The recommended way would be to copy 
+\emph on
+crtstart.asm
+\emph default
+ (f.e.
+ from 
+\begin_inset LatexCommand \url{http://sdcc.svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/device/lib/mcs51/crtstart.asm}
+
+\end_inset
+
+) into the source directory, adapt it there, then assemble it with 
+\emph on
+asx8051 -plosgff
+\begin_inset Foot
+status open
+
+\begin_layout Standard
+\begin_inset Quotes sld
+\end_inset
+
+-plosgff
+\begin_inset Quotes srd
+\end_inset
+
+ are the assembler options used in 
+\begin_inset LatexCommand \url{http://sdcc.svn.sourceforge.net/viewvc/sdcc/trunk/sdcc/device/lib/mcs51/Makefile.in?view=markup }
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+ crtstart.asm
+\emph default
+ and when linking your project explicitely specify 
+\emph on
+crtstart.rel
+\emph default
+.
+ As a bonus a listing of the relocated object file 
+\emph on
+crtstart.rst
+\emph default
+ is generated.
+\end_layout
+
+\begin_layout Standard
 \begin_inset VSpace bigskip
 \end_inset
 
@@ -17036,8 +17777,8 @@ Use of Labels within Inline Assembler
 \begin_layout Standard
 SDCC allows the use of in-line assembler with a few restrictions regarding
  labels.
- In older versions of the compiler all labels defined within inline assembler
- code had to be of the form 
+ All labels defined within inline assembler code have to be of the form
 \emph on
 nnnnn$
 \emph default
@@ -17050,6 +17791,33 @@ per function
 )
 \noun default
 .
+\begin_inset Foot
+status open
+
+\begin_layout Standard
+This is a slightly more stringent rule than absolutely necessary, but stays
+ always on the safe side.
+ Labels in the form of nnnnn$ are local labels in the assembler, locality
+ of which is confined within two labels of the standard form.
+ The compiler uses the same form for labels within a function (but starting
+ from nnnnn=00100); and places always a standard label at the beginning
+ of a function, thus limiting the locality of labels within the scope of
+ the function.
+ So, if the inline assembler part would be embedded into C-code, an improperly
+ placed non-local label in the assembler would break up the reference space
+ for labels created by the compiler for the C-code, leading to an assembling
+ error.
+\end_layout
+
+\begin_layout Standard
+The numeric part of local labels does not need to have 5 digits (although
+ this is the form of labels output by the compiler), any valid integer will
+ do.
+ Please refer to the assemblers documentation for further details.
+\end_layout
+
+\end_inset
+
  
 \end_layout
 
@@ -17145,7 +17913,7 @@ _asm
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-ljmp $0003 
+ljmp 0003$ 
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -17164,6 +17932,21 @@ clabel:\InsetSpace ~
 \InsetSpace ~
 /* inline assembler cannot reference this
  label */ 
+\begin_inset Foot
+status open
+
+\begin_layout Standard
+Here, the C-label 
+\family typewriter
+clabel
+\family default
+ is translated by the compiler into a local label, so the locality of labels
+ within the function is not broken.
+\end_layout
+
+\end_inset
+
+
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -17175,8 +17958,7 @@ _asm
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-$0003: ;label (can be referenced by inline assembler only)
+0003$: ;label (can be referenced by inline assembler only) 
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -17257,8 +18039,8 @@ and
 
 
 \emph default
- to pass the first parameter to a function, and also to pass the return
- value 
+ to pass the first (non-bit) parameter to a function, and also to pass the
return value 
 \begin_inset LatexCommand \index{return value}
 
 \end_inset
@@ -17360,7 +18142,21 @@ status collapsed
 \end_inset
 
 -stack-auto is used) or in data/xdata memory (depending on the memory model).
+\end_layout
+
+\begin_layout Standard
+Bit parameters are passed in a virtual register called 'bits' in bit-addressable
+ space for reentrant functions or allocated directly in bit memory otherwise.
+\end_layout
+
+\begin_layout Standard
+Functions (with two or more parameters or bit parameters) that are called
+ through function pointers
+\begin_inset LatexCommand \index{function pointers}
+
+\end_inset
+
+ must therefor be reentrant so the compiler knows how to pass the parameters.
 \end_layout
 
 \begin_layout Subsection
@@ -20992,7 +21788,7 @@ less_pedantic
 
 \end_inset
 
-- the compiler will not warn you anymore for obvious mistakes, you'r on
+- the compiler will not warn you anymore for obvious mistakes, you're on
  your own now ;-( .
  See also the command line option -
 \begin_inset ERT
@@ -21109,24 +21905,6 @@ disable_warning
 \end_inset
 
  - the compiler will not warn you anymore about warning number <nnnn>.
-\begin_inset Note Note
-status open
-
-\begin_layout Itemize
-\begin_inset Quotes sld
-\end_inset
-
-For list of warnings and corresponding codes, see err_warn.txt
-\begin_inset Quotes srd
-\end_inset
-
- This list should probably be part of the manual? See Patch #1697136 
-\end_layout
-
-\end_inset
-
-.
 \end_layout
 
 \begin_layout Itemize
@@ -21775,7 +22553,7 @@ int foo ()
 
 \begin_layout Standard
 The compiler will generate a warning message when extra space is allocated.
- It is strongly recommended that the save and restore pragma's be used when
+ It is strongly recommended that the save and restore pragmas be used when
  changing options for a function.
 \newline
 
@@ -22479,37 +23257,101 @@ The HC08 port passes the regression test suite (see section
 \end_layout
 
 \begin_layout Section
-The PIC14 port
+The PIC14
+\begin_inset LatexCommand \index{PIC14}
+
+\end_inset
+
+ port
 \end_layout
 
 \begin_layout Standard
-The 14bit PIC
+The PIC14 port adds support for Microchip
+\begin_inset LatexCommand \index{Microchip}
+
+\end_inset
+
+
+\begin_inset Formula $^{\text{TM}}$
+\end_inset
+
+ PIC
 \begin_inset LatexCommand \index{PIC14}
 
 \end_inset
 
- port still requires a major effort from the development community.
- However it can work for simple code.
- It passes its (smaller set of) regression tests
-\begin_inset LatexCommand \index{Regression test (PIC14)}
 
+\begin_inset Formula $^{\text{TM}}$
 \end_inset
 
- in the directory 
-\shape italic
-sdcc/src/regression
-\shape default
-.
+ MCUs with 14 bit wide instructions.
+ This port is not yet mature and still lacks many features.
+ However, it can work for simple code.
+\end_layout
+
+\begin_layout Standard
+Currently supported devices include:
+\end_layout
+
+\begin_layout Standard
+12F: 629, 635, 675, 683
+\end_layout
+
+\begin_layout Standard
+16C: 432, 433
+\end_layout
+
+\begin_layout Standard
+16C: 554, 557, 558
+\end_layout
+
+\begin_layout Standard
+16C: 62, 620, 620a, 621, 621a, 622, 622a, 63a, 65b
+\end_layout
+
+\begin_layout Standard
+16C: 71, 710, 711, 715, 717, 72, 73b, 745, 74b, 765, 770, 771, 773, 774,
+ 781, 782
+\end_layout
+
+\begin_layout Standard
+16C: 925, 926
+\end_layout
+
+\begin_layout Standard
+16F: 627, 627a, 628, 628a, 630, 636, 639, 648a, 676, 684, 685, 687, 688,
+ 689, 690
+\end_layout
+
+\begin_layout Standard
+16F: 716, 72, 73, 737, 74, 76, 767, 77, 777, 785
+\end_layout
+
+\begin_layout Standard
+16F: 818, 819, 84, 84a, 87, 870, 871, 872, 873, 873a, 874, 874a, 876, 876a,
+ 877, 877a, 88
+\end_layout
+
+\begin_layout Standard
+16F: 913, 914, 916, 917
+\end_layout
+
+\begin_layout Standard
+An up-to-date list of currently supported devices can be obtained via 
+\family typewriter
+sdcc -mpic14 -phelp foo.c
+\family default
+ (foo.c must exist...).
 \end_layout
 
 \begin_layout Subsection
-C code and 14bit PIC code page
+PIC Code Pages
 \begin_inset LatexCommand \index{code page (pic14)}
 
 \end_inset
 
- and RAM banks
-\begin_inset LatexCommand \index{RAM bank (pic14)}
+ and Memory Banks
+\begin_inset LatexCommand \index{Memory bank (pic14)}
 
 \end_inset
 
@@ -22519,56 +23361,116 @@ C code and 14bit PIC code page
 \begin_layout Standard
 The linker organizes allocation for the code page and RAM banks.
  It does not have intimate knowledge of the code flow.
- It will put all the code section of a single asm file into a single code
+ It will put all the code section of a single .asm file into a single code
  page.
  In order to make use of multiple code pages, separate asm files must be
  used.
- The compiler treats all functions of a single C file as being in the same
- code page unless it is non static.
+ The compiler assigns all 
+\emph on
+static
+\emph default
+ functions of a single .c file into the same code page.
 \newline
 
 \newline
-To get the best follow these guide lines:
+To get the best results,
+ follow these guidelines:
 \end_layout
 
 \begin_layout Enumerate
 Make local functions static, as non static functions require code page selection
  overhead.
+\newline
+Due to the way sdcc handles functions, place called functions prior
+ to calling functions in the file wherever possible: Otherwise sdcc will
+ insert unneccessary pagesel directives around the call, believing that
+ the called function is externally defined.
 \end_layout
 
 \begin_layout Enumerate
 For devices that have multiple code pages it is more efficient to use the
- same number of files as pages, i.e.
- for the 16F877 use 4 separate files and i.e.
- for the 16F874 use 2 separate files.
+ same number of files as pages: Use up to 4 separate .c files for the 16F877,
+ but only 2 files for the 16F874.
  This way the linker can put the code for each file into different code
- pages and there's less page selection overhead.
+ pages and there will be less page selection overhead.
 \end_layout
 
 \begin_layout Enumerate
-And as for any 8 bit micro (especially for PIC 14 as they have a very simple
- instruction set), use 'unsigned char' whereever possible instead of 'int'.
+And as for any 8 bit micro (especially for PIC14 as they have a very simple
+ instruction set), use `unsigned char' wherever possible instead of `int'.
 \end_layout
 
 \begin_layout Subsection
-Creating a device include file 
+Adding New Devices to the Port 
 \end_layout
 
 \begin_layout Standard
-For generating a device include file
-\begin_inset LatexCommand \index{PIC14!Header files}
+Adding support for a new 14
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+,
+\end_layout
 
 \end_inset
 
- use the support perl script inc2h.pl kept in directory support/script.
+bit PIC MCU requires the following steps:
+\end_layout
+
+\begin_layout Enumerate
+Create a new device description.
+\newline
+Each device is described in two files: pic16f*.h
+ and pic16f*.c.
+ These files primarily define SFRs, structs to access their bits, and symbolic
+ configuration options.
+ Both files can be generated from gputils' .inc files using the perl script
+\family typewriter
+support/scripts/inc2h.pl
+\family default
+.
+ This file also contains further instructions on how to proceed.
+\end_layout
+
+\begin_layout Enumerate
+Copy the .h file into SDCC's include path and either add the .c file to your
+ project or copy it to 
+\family typewriter
+device/lib/pic/libdev
+\family default
+.
+ Afterwards, rebuild and install the libraries.
+\end_layout
+
+\begin_layout Enumerate
+Edit pic14devices.txt in SDCC's include path (
+\family typewriter
+device/include/pic/
+\family default
+ in the source tree or 
+\family typewriter
+/usr/local/share/sdcc/include/pic
+\family default
+ after installation).
+\newline
+You need to add a device specification here to make
+ the memory layout (code banks, RAM, aliased memory regions, ...) known to
+ the compiler.
+ Probably you can copy and modify an existing entry.
+ The file format is documented at the top of the file.
 \end_layout
 
 \begin_layout Subsection
-Interrupt code
+Interrupt Code
 \end_layout
 
 \begin_layout Standard
-For the interrupt function, use the keyword '__interrupt'
+For the interrupt function, use the keyword `__interrupt'
 \begin_inset LatexCommand \index{PIC14!interrupt}
 
 \end_inset
@@ -22593,7 +23495,7 @@ T0IF = 0; /* Clear timer interrupt */
 \end_layout
 
 \begin_layout Subsection
-Linking and assembling
+Linking and Assembling
 \end_layout
 
 \begin_layout Standard
@@ -22603,13 +23505,13 @@ For assembling you can use either GPUTILS'
 \end_inset
 
  gpasm.exe or MPLAB's mpasmwin.exe.
- GPUTILS is available from 
+ GPUTILS are available from 
 \begin_inset LatexCommand \url{http://sourceforge.net/projects/gputils}
 
 \end_inset
 
 .
- For linking you can use either GPUTIL's gplink or MPLAB's mplink.exe.
+ For linking you can use either GPUTILS' gplink or MPLAB's mplink.exe.
  If you use MPLAB and an interrupt function then the linker script file
  vectors section will need to be enlarged to link with mplink.
 \newline
@@ -22635,17 +23537,7 @@ Makefile
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-sdcc -S -V -mpic14 -p16F877 $< 
-\newline
-\InsetSpace ~
-\InsetSpace ~
-\InsetSpace ~
-\InsetSpace ~
-\InsetSpace ~
-\InsetSpace ~
-\InsetSpace ~
-\InsetSpace ~
-gpasm -c $*.asm
+sdcc -V -mpic14 -p16f877 -c $< 
 \newline
 
 \newline
@@ -22659,8 +23551,8 @@ $(PRJ).hex: $(OBJS)
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-gplink
- -m -s $(PRJ).lkr -o $(PRJ).hex $(OBJS) libsdcc.lib
+gplink -m -s $(PRJ).lkr
+ -o $(PRJ).hex $(OBJS) libsdcc.lib
 \end_layout
 
 \begin_layout Standard
@@ -22684,7 +23576,7 @@ Makefile
 \InsetSpace ~
 \InsetSpace ~
 \InsetSpace ~
-sdcc -S -V -mpic14 -p16F877 $< 
+sdcc -S -V -mpic14 -p16f877 $< 
 \newline
 \InsetSpace ~
 \InsetSpace ~
@@ -22721,7 +23613,7 @@ Please note that indentations within a
 \end_layout
 
 \begin_layout Subsection
-Command-line options
+Command-Line Options
 \end_layout
 
 \begin_layout Standard
@@ -22742,8 +23634,7 @@ status collapsed
 -help):
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -22757,7 +23648,7 @@ status collapsed
 
 \end_inset
 
--debug-extra
+-debug-xtra
 \begin_inset LatexCommand \index{PIC14!Options!-\/-debug-extra}
 
 \end_inset
@@ -22765,8 +23656,7 @@ status collapsed
  emit debug info in assembly output
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -22788,8 +23678,7 @@ status collapsed
  disable (slightly faulty) optimization on pCode
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -22812,8 +23701,7 @@ status collapsed
  large shared databank to reduce BANKSEL overhead)
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -22836,19 +23724,37 @@ status collapsed
 \end_layout
 
 \begin_layout Subsection
-The library
+Environment Variables
 \end_layout
 
-\begin_layout Subsubsection
-error: missing definition for symbol 
-\begin_inset Quotes sld
-\end_inset
+\begin_layout Standard
+The PIC14 port recognizes the following environment variables:
+\end_layout
 
-__gptrget1
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Description
+SDCC_PIC14_SPLIT_LOCALS If set and not empty, sdcc will allocate each temporary
+ register (the ones called r0xNNNN) in a section of its own.
+ By default (if this variable is unset), sdcc tries to cluster registers
+ in sections in order to reduce the BANKSEL overhead when accessing them.
+\end_layout
+
+\begin_layout Subsection
+The Library
+\end_layout
 
+\begin_layout Standard
+The PIC14 library currently only contains support routines required by the
+ compiler to implement multiplication, division, and floating point support.
+ No libc-like replacement is available at the moment, though many of the
+ common sdcc library sources (in 
+\family typewriter
+device/lib
+\family default
+) should also compile with the PIC14 port.
+\end_layout
 
+\begin_layout Subsubsection
+error: missing definition for symbol ``__gptrget1''
 \end_layout
 
 \begin_layout Standard
@@ -22871,20 +23777,25 @@ libsdcc.lib
 \end_layout
 
 \begin_layout Subsubsection
-Processor mismatch in file 
-\begin_inset Quotes sld
-\end_inset
-
-XXX
-\begin_inset Quotes srd
-\end_inset
-
-.
+Processor mismatch in file ``XXX''.
 \end_layout
 
 \begin_layout Standard
 This warning can usually be ignored due to the very good compatibility amongst
- 14 bit PIC
+ 14
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+,
+\end_layout
+
+\end_inset
+
+bit PIC
 \begin_inset LatexCommand \index{PIC14}
 
 \end_inset
@@ -22904,46 +23815,37 @@ device/lib/pic/Makefile
 \family default
  to reflect your device.
  This might even improve performance for smaller devices as unneccesary
- BANKSELs migth be removed.
+ BANKSELs might be removed.
 \end_layout
 
 \begin_layout Subsection
-Known bugs
+Known Bugs
 \end_layout
 
 \begin_layout Subsubsection
-initialized data
+Function arguments
 \end_layout
 
 \begin_layout Standard
-Currently, data can only be initialized if it resides in the source file
- together with 
-\emph on
-main()
-\emph default
-.
- Data in other source files will silently 
-\series bold
-not
-\series default
- be initialized.
-\family typewriter
-\size footnotesize
+Functions with variable argument lists (like printf) are not yet supported.
+ Similarly, taking the argument of the first argument passed into a function
+ does not work: It is currently passed in WREG and has no address...
+\end_layout
 
-\begin_inset Marginal
-status collapsed
+\begin_layout Subsubsection
+Regression tests fail
+\end_layout
 
 \begin_layout Standard
-
-\series bold
-\InsetSpace ~
-!
+Though the small subset of regression tests in src/regression passes, SDCC
+ regression test suite does not, indicating that there are still major bugs
+ in the port.
+ However, many smaller projects have successfully used SDCC in the past...
 \end_layout
 
-\end_inset
-
+\begin_layout Standard
 
-\family default
+\size footnotesize
 
 \newpage
 
@@ -22959,262 +23861,53 @@ The PIC16
 \end_layout
 
 \begin_layout Standard
-The PIC16
-\begin_inset LatexCommand \index{PIC16}
-
-\end_inset
-
- port is the portion of SDCC that is responsible to produce code for the
- Microchip
+The PIC16 port adds support for Microchip
 \begin_inset LatexCommand \index{Microchip}
 
 \end_inset
 
-(TM) microcontrollers with 16 bit core.
- Currently this family of microcontrollers contains the PIC18Fxxx and PIC18Fxxxx.
- Currently supported devices are:
-\end_layout
-
-\begin_layout Standard
-\align center
-\begin_inset Tabular
-<lyxtabular version="3" rows="4" columns="6">
-<features>
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" width="0">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F242
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F248
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F252
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F258
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F442
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F448
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F452
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F458
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F1220
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F2220
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F2550
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F4331
-\end_layout
-
-\end_inset
-</cell>
-</row>
-<row topline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F4455
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F6520
-\end_layout
-
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
-\begin_layout Standard
-18F6620
-\end_layout
 
+\begin_inset Formula $^{\text{TM}}$
 \end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
 
-\begin_layout Standard
-18F6680
-\end_layout
+ PIC
+\begin_inset LatexCommand \index{PIC}
 
 \end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
 
-\begin_layout Standard
-18F6720
-\end_layout
 
+\begin_inset Formula $^{\text{TM}}$
 \end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
 
-\begin_layout Standard
-18F8520
+ MCUs with 16 bit wide instructions.
+ Currently this family of microcontrollers contains the PIC18Fxxx and PIC18Fxxxx
+; devices supported by the port include:
 \end_layout
 
-\end_inset
-</cell>
-</row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
 \begin_layout Standard
-18F8620
+18F: 242, 248, 252, 258, 442, 448, 452, 458
 \end_layout
 
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
 \begin_layout Standard
-18F8680
+18F: 1220, 1320
 \end_layout
 
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
-
 \begin_layout Standard
-18F8720
+18F: 2220, 2221, 2320, 2321, 2331, 2431, 2455, 24j10, 2525, 2550, 25j10,
+ 2620
 \end_layout
 
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
 \begin_layout Standard
-
+18F: 4220, 4221, 4320, 4321, 4331, 4431, 4455, 44j10, 4520, 4525, 4550,
+ 45j10, 4620
 \end_layout
 
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
 \begin_layout Standard
-
+18F: 6520, 6620, 6680, 6720
 \end_layout
 
-\end_inset
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
-\begin_inset Text
-
 \begin_layout Standard
-
-\end_layout
-
-\end_inset
-</cell>
-</row>
-</lyxtabular>
-
-\end_inset
-
-
+18F: 8520, 8620, 8680, 8720
 \end_layout
 
 \begin_layout Subsection
@@ -23227,8 +23920,7 @@ PIC16 port supports the standard command line arguments as supposed, with
  list:
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23263,8 +23955,7 @@ status collapsed
 -all-callee-saves
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23296,20 +23987,31 @@ Port Specific Options
 \end_layout
 
 \begin_layout Standard
-The port specific options appear after the global options in the sdcc --help
- output.
+The port specific options appear after the global options in the sdcc -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-help output.
 \end_layout
 
 \begin_layout Subsubsection
-General Options
+Code Generation Options
 \end_layout
 
 \begin_layout Standard
-General options enable certain port features and optimizations.
+These options influence the generated assembler code.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23324,7 +24026,7 @@ status collapsed
 \end_inset
 
 -pstack-model=[model] Used in conjuction with the command above.
- Defines the stack model to be used, valid stack models are : 
+ Defines the stack model to be used, valid stack models are:
 \end_layout
 
 \begin_deeper
@@ -23351,8 +24053,7 @@ large
 \end_layout
 
 \end_deeper
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23366,13 +24067,10 @@ status collapsed
 
 \end_inset
 
--preplace-udata-with=[kword] Replaces the default udata keyword for allocating
- unitialized data variables with [kword].
- Valid keywords are: "udata_acs", "udata_shr", "udata_ovr".
+-pno-banksel Do not generate BANKSEL assembler directives.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23386,12 +24084,15 @@ status collapsed
 
 \end_inset
 
--ivt-loc <nnnn> positions the Interrupt Vector Table at location <nnnn>.
- Useful for bootloaders.
+-extended Enable extended instruction set/literal offset addressing mode.
+ Use with care!
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Subsubsection
+Optimization Options
+\end_layout
+
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23405,11 +24106,37 @@ status collapsed
 
 \end_inset
 
--asm= sets the full path and name of an external assembler to call.
+-obanksel=n Set optimization level for inserting BANKSELs.
+\newline
+
+\end_layout
+
+\begin_deeper
+\begin_layout List
+\labelwidthstring 00.00.0000
+0 no optimization
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+1 checks previous used register and if it is the same then does not emit
+ BANKSEL, accounts only for labels.
 \end_layout
 
 \begin_layout List
 \labelwidthstring 00.00.0000
+2 tries to check the location of (even different) symbols and removes BANKSELs
+ if they are in the same bank.
+\newline
+
+\emph on
+Important: There might be problems if the linker script has data sections
+ across bank borders!
+\end_layout
+
+\end_deeper
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23423,11 +24150,11 @@ status collapsed
 
 \end_inset
 
--link= sets the full path and name of an external linker to call.
+-denable-peeps Force the usage of peepholes.
+ Use with care.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23441,21 +24168,27 @@ status collapsed
 
 \end_inset
 
--mplab-comp MPLAB
-\begin_inset LatexCommand \index{PIC16!MPLAB}
+-optimize-goto Try to use (conditional) BRA instead of GOTO.
+\end_layout
 
-\end_inset
+\begin_layout Description
+-
+\begin_inset ERT
+status collapsed
 
- compatibility option.
- Currently only suppresses special gpasm directives.
+\begin_layout Standard
+
+
+\backslash
+/
 \end_layout
 
-\begin_layout Subsubsection
-Optimization Options
+\end_inset
+
+-optimize-cmp Try to optimize some compares.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23469,11 +24202,14 @@ status collapsed
 
 \end_inset
 
--optimize-goto Try to use (conditional) BRA instead of GOTO
+-optimize-df Analyze the dataflow of the generated code and improve it.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Subsubsection
+Assembling Options
+\end_layout
+
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23487,11 +24223,10 @@ status collapsed
 
 \end_inset
 
--optimize-cmp Try to optimize some compares.
+-asm= Sets the full path and name of an external assembler to call.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23505,11 +24240,20 @@ status collapsed
 
 \end_inset
 
--optimize-df Analyze the dataflow of the generated code and improve it.
+-mplab-comp MPLAB
+\begin_inset LatexCommand \index{PIC16!MPLAB}
+
+\end_inset
+
+ compatibility option.
+ Currently only suppresses special gpasm directives.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Subsubsection
+Linking Options
+\end_layout
+
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23523,42 +24267,51 @@ status collapsed
 
 \end_inset
 
--obanksel=nn Set optimization level for inserting BANKSELs.
-\newline
-
+-link= Sets the full path and name of an external linker to call.
 \end_layout
 
-\begin_deeper
-\begin_layout List
-\labelwidthstring 00.00.0000
-0 no optimization
+\begin_layout Description
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
-1 checks previous used register and if it is the same then does not emit
- BANKSEL, accounts only for labels.
+\end_inset
+
+-preplace-udata-with=[kword] Replaces the default udata keyword for allocating
+ unitialized data variables with [kword].
+ Valid keywords are: "udata_acs", "udata_shr", "udata_ovr".
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
-2 tries to check the location of (even different) symbols and removes BANKSELs
- if they are in the same bank.
-\newline
+\begin_layout Description
+-
+\begin_inset ERT
+status collapsed
 
-\emph on
-Important: There might be problems if the linker script has data sections
- across bank borders!
+\begin_layout Standard
+
+
+\backslash
+/
 \end_layout
 
-\end_deeper
-\begin_layout Subsubsection
-Linking Options
+\end_inset
+
+-ivt-loc=n Place the interrupt vector table at address 
+\emph on
+n
+\emph default
+.
+ Useful for bootloaders.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23572,11 +24325,10 @@ status collapsed
 
 \end_inset
 
--nodefaultlibs do not link default libraries when linking
+-nodefaultlibs Do not link default libraries when linking.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23590,11 +24342,10 @@ status collapsed
 
 \end_inset
 
--no-crt Don't link the default run-time modules
+-use-crt= Use a custom run-time module instead of the defaults.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23608,7 +24359,7 @@ status collapsed
 
 \end_inset
 
--use-crt= Use a custom run-time module instead of the defaults.
+-no-crt Don't link the default run-time modules
 \end_layout
 
 \begin_layout Subsubsection
@@ -23619,8 +24370,7 @@ Debugging Options
 Debugging options enable extra debugging information in the output files.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23655,8 +24405,7 @@ status collapsed
 , but dumps more information.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23672,11 +24421,10 @@ status collapsed
 
 -debug-ralloc Force register allocator to dump <source>.d file with debugging
  information.
- <source> is the name of the file compiled.
+ <source> is the name of the file being compiled.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23693,27 +24441,7 @@ status collapsed
 -pcode-verbose Enable pcode debugging information in translation.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
--
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-/
-\end_layout
-
-\end_inset
-
--denable-peeps Force the usage of peepholes.
- Use with care.
-\end_layout
-
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23727,11 +24455,10 @@ status collapsed
 
 \end_inset
 
--gstack Trace push/pops for stack pointer overflow
+-calltree Dump call tree in .calltree file.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 -
 \begin_inset ERT
 status collapsed
@@ -23745,11 +24472,11 @@ status collapsed
 
 \end_inset
 
--call-tree dump call tree in .calltree file
+-gstack Trace push/pops for stack pointer overflow.
 \end_layout
 
 \begin_layout Subsection
-Enviromental Variables
+Enviroment Variables
 \end_layout
 
 \begin_layout Standard
@@ -23763,26 +24490,24 @@ abled at will.
 Currently there is only two such variables available:
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
-OPTIMIZE_BITFIELD_POINTER_GET when this variable exists reading of structure
+\begin_layout Description
+OPTIMIZE_BITFIELD_POINTER_GET When this variable exists, reading of structure
  bitfields is optimized by directly loading FSR0 with the address of the
  bitfield structure.
  Normally SDCC will cast the bitfield structure to a bitfield pointer and
  then load FSR0.
- This step saves data ram and code space for functions that perform heavy
use of bitfields.
- (ie.
80 bytes of code space are saved when compiling malloc.c with this option).
+ This step saves data ram and code space for functions that make heavy use
+ of bitfields.
+ (i.e., 80 bytes of code space are saved when compiling malloc.c with this
+ option).
  
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
-NO_REG_OPT do not perform pCode registers optimization.
+\begin_layout Description
+NO_REG_OPT Do not perform pCode registers optimization.
  This should be used for debugging purposes.
- In some where bugs in the pcode optimizer are found, users can benefit
from temporarily disabling the optimizer until the bug is fixed.
+ If bugs in the pcode optimizer are found, users can benefit from temporarily
+ disabling the optimizer until the bug is fixed.
 \end_layout
 
 \begin_layout Subsection
@@ -24222,7 +24947,7 @@ Pragmas
 \end_layout
 
 \begin_layout Standard
-PIC16
+The PIC16
 \begin_inset LatexCommand \index{PIC16}
 
 \end_inset
@@ -24230,21 +24955,15 @@ PIC16
  port currently supports the following pragmas:
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 stack
 \begin_inset LatexCommand \index{PIC16!Pragmas!\#pragma stack}
 
 \end_inset
 
- pragma stack
-\begin_inset LatexCommand \index{PIC16!stack}
-
-\end_inset
-
- forces the code generator to initialize the stack & frame pointers at a
- specific address.
- This is an adhoc solution for cases where no STACK directive is available
+ This forces the code generator to initialize the stack & frame pointers
+ at a specific address.
+ This is an ad hoc solution for cases where no STACK directive is available
  in the linker script or gplink is not instructed to create a stack section.
 \newline
 The
@@ -24267,10 +24986,14 @@ The old format (ie.
 
 \newline
 The format is as follows:
+\newline
+
 \end_layout
 
 \begin_layout LyX-Code
 #pragma stack bottom_address [stack_size]
+\newline
+
 \end_layout
 
 \begin_layout Standard
@@ -24305,14 +25028,13 @@ If the stack_size field is omitted then a stack is created with the default
  with deep function nesting or excessive stack usage.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 code
 \begin_inset LatexCommand \index{PIC16!Pragmas!\#pragma code}
 
 \end_inset
 
- place a function symbol at static FLASH address
+ Force a function to a static FLASH address.
 \end_layout
 
 \begin_layout LyX-Code
@@ -24335,8 +25057,7 @@ Example:
 
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 library instructs the linker to use a library module.
 \newline
 Usage:
@@ -24586,10 +25307,9 @@ ignore
  keyword will reject all modules specified by the library pragma.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
-udata pragma udata instructs the compiler to emit code so that linker will
- place a variable at a specific memory bank
+\begin_layout Description
+udata The pragma udata instructs the compiler to emit code so that linker
+ will place a variable at a specific memory bank.
 \end_layout
 
 \begin_layout LyX-Code
@@ -24820,7 +25540,7 @@ Before using SDCC/pic16 there are some libraries that need to be compiled.
 \end_layout
 
 \begin_layout Standard
-The steps to compile the pic16 libraries under Linux are:
+The steps to compile the pic16 libraries under Linux and Mac OS X are:
 \end_layout
 
 \begin_layout LyX-Code
@@ -24879,6 +25599,118 @@ device/lib/pic16/pics.build
 make lib-io
 \end_layout
 
+\begin_layout Subsection
+Adding New Devices to the Port
+\end_layout
+
+\begin_layout Standard
+Adding support for a new 16
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+,
+\end_layout
+
+\end_inset
+
+bit PIC MCU requires the following steps:
+\end_layout
+
+\begin_layout Enumerate
+Create picDEVICE.c and picDEVICE.h from pDEVICE.inc using
+\newline
+
+\family typewriter
+perl /path/to/sdcc/support/scripts/inc2h-pic16.pl /path/to/gputils/header/pDEVICE.
+inc
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+mv picDEVICE.h /path/to/sdcc/device/include/pic16
+\end_layout
+
+\begin_layout Enumerate
+
+\family typewriter
+mv picDEVICE.c /path/to/sdcc/device/lib/pic16/libdev
+\end_layout
+
+\begin_layout Enumerate
+Add DEVICE to 
+\family typewriter
+/path/to/sdcc/device/lib/pic16/pics.all
+\family default
+ (and 
+\family typewriter
+.build
+\family default
+).
+\newline
+Note: No 18f prefix here!
+\end_layout
+
+\begin_layout Enumerate
+Adjust 
+\family typewriter
+/path/to/sdcc/device/lib/pic16/libio/*.ignore
+\family default
+
+\newline
+Add your DEVICE if it does not compile in 
+\family typewriter
+adc
+\family default
+, 
+\family typewriter
+i2c
+\family default
+, or 
+\family typewriter
+usart
+\family default
+.
+\end_layout
+
+\begin_layout Enumerate
+Edit 
+\family typewriter
+/path/to/sdcc/device/include/pic16/pic18fregs.h
+\family default
+.
+ The file format is self-explanatory, just add
+\newline
+
+\family typewriter
+#elif defined(picDEVICE)
+\newline
+# include <picDEVICE.h>
+\family default
+
+\newline
+at the right place (keep it sorted).
+\end_layout
+
+\begin_layout Enumerate
+Edit 
+\family typewriter
+/path/to/sdcc/src/pic16/devices.inc
+\family default
+.
+ Copy and modify an existing entry and insert it at the correct place (keep
+ the file sorted).
+ The file is hardly documented, look at the entries for the 18f2221...
+\end_layout
+
+\begin_layout Enumerate
+Recompile SDCC, including the pic16 libraries.
+\end_layout
+
 \begin_layout Subsection
 Memory Models
 \end_layout
@@ -25043,13 +25875,11 @@ The stack
  FSR2.
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 FSR1 is assigned as stack pointer
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 FSR2 is assigned as frame pointer
 \end_layout
 
@@ -25233,8 +26063,7 @@ In addition to the standard SDCC function keywords, PIC16
  port makes available two more:
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 wparam
 \begin_inset LatexCommand \index{PIC16!wparam}
 
@@ -25272,8 +26101,7 @@ void func_wparam(int a) wparam
 }
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 shadowregs
 \begin_inset LatexCommand \index{PIC16!shadowregs}
 
@@ -25683,7 +26511,7 @@ not
  Address of the specific interrupt.
  This is not a problem for the LOW priority interrupts, but it is a problem
  for the RESET and the HIGH priority interrupts because code may be written
- at the next interrupt´s vector address and cause undeterminate program
+ at the next interrupt's vector address and cause undeterminate program
  behaviour if that interrupt is raised.
 \begin_inset Foot
 status open
@@ -25701,7 +26529,7 @@ disabled
 \end_layout
 
 \begin_layout Enumerate
-when the ISR is small enough not to reach the next interrupt´s vector address.
+when the ISR is small enough not to reach the next interrupt's vector address.
 \end_layout
 
 \end_inset
@@ -25714,7 +26542,7 @@ when the ISR is small enough not to reach the next interrupt
 \emph on
 n
 \emph default
is possible to be omitted.
may be omitted.
  This way a function is generated similar to an ISR, but it is not assigned
  to any interrupt.
 \end_layout
@@ -26432,8 +27260,7 @@ In the libc library there exist the functions that are used to write to
  These are
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 _
 \begin_inset ERT
 status collapsed
@@ -26450,8 +27277,7 @@ status collapsed
 _stream_usart_putchar writes a character at the USART stream
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 _
 \begin_inset ERT
 status collapsed
@@ -26468,8 +27294,7 @@ status collapsed
 _stream_mssp_putchar writes a character at the MSSP stream
 \end_layout
 
-\begin_layout List
-\labelwidthstring 00.00.0000
+\begin_layout Description
 putchar dummy function.
  This writes a character to a user specified manner.
 \end_layout
@@ -26530,9 +27355,17 @@ void main(void)
 \end_layout
 
 \begin_layout LyX-Code
-    printf (¨This is a printf test
+    printf (
+\begin_inset Quotes sld
+\end_inset
+
+This is a printf test
 \backslash
-n¨);
+n
+\begin_inset Quotes srd
+\end_inset
+
+);
 \end_layout
 
 \begin_layout LyX-Code
@@ -27257,7 +28090,7 @@ status collapsed
 \end_layout
 
 \begin_layout Subsection
-Known bugs
+Known Bugs
 \end_layout
 
 \begin_layout Standard
@@ -30296,11 +31129,11 @@ Related open source tools
 \begin_layout Standard
 \align left
 \begin_inset Tabular
-<lyxtabular version="3" rows="14" columns="3">
+<lyxtabular version="3" rows="16" columns="3">
 <features>
 <column alignment="left" valignment="top" leftline="true" width="0pt">
 <column alignment="block" valignment="top" leftline="true" width="30line%">
-<column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt">
+<column alignment="left" valignment="top" leftline="true" rightline="true" width="40col%">
 <row topline="true" bottomline="true">
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 \begin_inset Text
@@ -30807,6 +31640,111 @@ Debugger, serves nicely as GUI to SDCDB
 \end_inset
 
 
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+d52
+\begin_inset LatexCommand \index{d52}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{d52 (disassembler)}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+Disassembler, can count instruction cycles
+\begin_inset LatexCommand \index{instruction cycles (count)}
+
+\end_inset
+
+, use with options -pnd
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset LatexCommand \url{http://www.8052.com/users/disasm/}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+cmake
+\begin_inset LatexCommand \index{cmake}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+Cross platform build system, generates Makefiles
+\begin_inset LatexCommand \index{Makefile}
+
+\end_inset
+
+ and project workspaces
+\begin_inset LatexCommand \index{project workspace}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset LatexCommand \url{http://www.cmake.org}
+
+\end_inset
+
+ \InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+and a dedicated wiki entry: 
+\begin_inset LatexCommand \url{http://www.cmake.org/Wiki/CmakeSdcc}
+
+\end_inset
+
+
 \end_layout
 
 \end_inset
@@ -31833,7 +32771,24 @@ Subversion Source Code Repository
 The output of 
 \family sans
 \series bold
-sdcc --version
+sdcc -
+\family default
+
+\begin_inset ERT
+status open
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+
+\family sans
+-version
 \family default
 \series default
  or the filenames of the snapshot versions of SDCC include date and its
@@ -31890,18 +32845,18 @@ Historically there often were long delays between official releases and
 \end_inset
 
 .
A release wiki
The SDCC Wiki
 \begin_inset LatexCommand \index{wiki}
 
 \end_inset
 
 
-\begin_inset LatexCommand \index{Release wiki}
+\begin_inset LatexCommand \index{SDCC Wiki}
 
 \end_inset
 
  at 
-\begin_inset LatexCommand \url{http://sdcc.sf.net/release_wiki/}
+\begin_inset LatexCommand \url{http://sdcc.wiki.sourceforge.net/}
 
 \end_inset
 
@@ -31989,9 +32944,9 @@ regression tests
 \end_inset
 
  check that SDCC itself compiles flawlessly on several host platforms (i386,
- Opteron, 64 bit Alpha, ppc64, MacOS X on PPC, Solaris on Sparc) and checks
- the quality of the code generated by SDCC by running the code for several
- target platforms through simulators.
+ Opteron, 64 bit Alpha, ppc64, Mac OS X on ppc and i386, Solaris on Sparc)
+ and checks the quality of the code generated by SDCC by running the code
for several target platforms through simulators.
  The regression test suite comprises more than 100 files which expand to
  more than 500 test cases which include more than 4500 tests.
  The results of these tests are published daily on SDCC's snapshot page
@@ -32061,7 +33016,7 @@ make test-mcs51
 \end_layout
 
 \begin_layout Standard
-The 14bit pic port uses a different set of regression tests 
+The PIC14 port uses a different set of regression tests 
 \begin_inset LatexCommand \index{Regression test (PIC14)}
 
 \end_inset
@@ -32168,8 +33123,8 @@ not tie students to a specific host platform and instead allow them to use
 \emph on
 their
 \emph default
- choice (among them Alpha, i386, i386_64, MacOs, Mips, Sparc, Windows and
- eventually 
+ choice (among them Alpha, i386, i386_64, Mac OS X, Mips, Sparc, Windows
and eventually 
 \begin_inset LatexCommand \url[OLPC]{http://www.laptop.org}
 
 \end_inset
@@ -35061,6 +36016,34 @@ replace { lcall %1 } by { acall %1 }
 replace { ljmp %1 } by { ajmp %1 }
 \end_layout
 
+\begin_layout Standard
+(NOTE: from version 2.7.3 on, you can use option -
+\emph on
+
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+
+\emph default
+-acall-ajmp
+\begin_inset LatexCommand \index{-\/-acall-ajmp}
+
+\end_inset
+
+, which also takes care of aligning the interrupt vectors properly.)
+\newline
+
+\end_layout
+
 \begin_layout Standard
 The 
 \emph on
@@ -35534,7 +36517,7 @@ Old K&R style
 \family typewriter
 foo(i,j) /* this old style of function declarations */ 
 \newline
-int i,j; /* are valid
+int i,j; /* is valid
  in ANSI but not valid in SDCC */ 
 \newline
 { 
@@ -35551,7 +36534,24 @@ int i,j; /* are valid
 
 \end_deeper
 \begin_layout Itemize
-Most enhancements in C99 are not supported, f.e.:
+Most enhancements in C99 are not supported, e.g.:
+\end_layout
+
+\begin_deeper
+\begin_layout Verse
+
+\family typewriter
+for (
+\series bold
+int
+\series default
+ i=0; i<10; i++) /* is invalid in SDCC although allowed in C99 */
+\end_layout
+
+\end_deeper
+\begin_layout Itemize
+But some have been added recently in SDCC 2.7.0.
+ They must be considered alpha quality however.
 \end_layout
 
 \begin_deeper
@@ -35566,21 +36566,19 @@ inline
 
 
 \series default
- int increment (int a) { return a+1; } /* is invalid in SDCC although allowed
- in C99.
- An empty define 
-\emph on
-#define inline
-\emph default
- can be used as a work around */
+ int increment (int a) { return a+1; } /* inlines the increment without
+ function call overhead */
 \newline
-
-\newline
-for (
+int * 
 \series bold
-int
+restrict
+\begin_inset LatexCommand \index{inline (not supported)}
+
+\end_inset
+
+
 \series default
i=0; i<10; i++) /* is invalid in SDCC although allowed in C99 */
p; /* accepted but ignored */
 \end_layout
 
 \end_deeper
@@ -35642,6 +36640,135 @@ t', 'near', 'nonbanked', 'pdata', 'reentrant', 'sbit', 'sfr', 'shadowregs',
  '__data' instead of 'data'.
 \end_layout
 
+\begin_layout Itemize
+integer promotion of variable arguments is not performed if the argument
+ is explicitly taypecasted unless the
+\series bold
+ -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c89
+\begin_inset LatexCommand \index{-\/-std-c89}
+
+\end_inset
+
+ or -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c99
+\begin_inset LatexCommand \index{-\/-std-c99}
+
+\end_inset
+
+
+\series default
+ command line options are used.
+\end_layout
+
+\begin_deeper
+\begin_layout Verse
+
+\family typewriter
+void vararg_func (char *str, ...) { atr; }
+\newline
+
+\newline
+void main (void)
+\newline
+{
+\newline
+\InsetSpace ~
+\InsetSpace ~
+char c = 10;
+\newline
+
+\newline
+\InsetSpace ~
+\InsetSpace ~
+/* argument
+ u is promoted to int before
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* passing to function */
+\newline
+\InsetSpace ~
+\InsetSpace ~
+vararg_func (
+\begin_inset Quotes sld
+\end_inset
+
+%c
+\begin_inset Quotes srd
+\end_inset
+
+, c);
+\newline
+
+\newline
+\InsetSpace ~
+\InsetSpace ~
+/* argument u is not promoted to int,
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* it is passed as char to function
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+*
+ if --std-cXX is not defined;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* is promoted to int before passing
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* to function
+ if --std-cXX is defined */
+\newline
+\InsetSpace ~
+\InsetSpace ~
+vararg_func (
+\begin_inset Quotes sld
+\end_inset
+
+%bc
+\begin_inset Quotes srd
+\end_inset
+
+, (char)u);
+\newline
+}
+\end_layout
+
+\end_deeper
 \begin_layout Section
 Cyclomatic Complexity
 \begin_inset LatexCommand \index{Cyclomatic complexity}
@@ -35800,13 +36927,13 @@ As mentioned in the optimization section the peep-hole optimizer is rule
 \end_layout
 
 \begin_layout Standard
-More information is available in a wiki
+More information is available on SDCC Wiki
 \begin_inset LatexCommand \index{wiki}
 
 \end_inset
 
  (preliminary link 
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/release_wiki/index.php?page=SDCC+internals+and+porting}
+\begin_inset LatexCommand \url{http://sdcc.wiki.sourceforge.net/SDCC+internals+and+porting}
 
 \end_inset
 
@@ -39313,38 +40440,23 @@ Thanks to all the other volunteer developers who have helped with coding,
 \newline
 
 \emph on
-Also thanks to Sourceforge 
+Thanks to Sourceforge 
 \begin_inset LatexCommand \url{http://www.sf.net}
 
 \end_inset
 
  which has hosted the project since 1999 and donates significant download
- bandwidth and probably more than 
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-$10^{13}$
-\end_layout
-
-\end_inset
+ bandwidth.
+\emph default
 
-CPU cycles per day.
 \newline
-\begin_inset Note Note
-status open
 
-\begin_layout Standard
-more than 10^13 is an estimate: on my Athlon 2800+ it takes about (0.5+6.5+20)
- minutes for (configure+make+regression test), and there is (i386, amd64,
- alpha, ppc64, (mingw32), sparc, macosx).
-\end_layout
-
-\end_inset
+\newline
 
+\emph on
+Also thanks to all SDCC Distributed Compile Farm members for donating CPU
+ cycles and bandwidth for snapshot builds.
+\newline
 
 \end_layout