* src/SDCC.lex, src/SDCCmain.c, sdc/SDCCglobl.h, doc/sdccman.lyx:
[fw/sdcc] / doc / sdccman.lyx
index bac24d8703dd3cf5dffc43c8a8da52f993d85378..eb16337ed11ee2e862c4ece108fe103efdf91ed1 100644 (file)
@@ -7,7 +7,7 @@
   pdftitle={SDCC Compiler User Guide},
   pdfauthor={SDCC development team},
   pdfsubject={installation, user manual},
-  pdfkeywords={68hc08 8032 8051 ansi c compiler CPU DS390                 embedded free Freescale GPL HC08 Intel manual Maxim mcs51 Microchip microcontroller open source PIC Z80 Zilog},
+  pdfkeywords={68hc08 8032 8051 ansi c compiler assembler CPU DS390 embedded development free Floating Point Arithmetic Freescale GPL HC08 inline Intel ISO/IEC 9899:1990 Linux MAC OS X manual Maxim mcs51 Microchip microcontroller open source PIC Unix Windows Z80 Zilog},
   pdfpagemode=UseOutlines,
   colorlinks=true,
   linkcolor=blue] {hyperref}
@@ -82,7 +82,7 @@ SDCC Compiler User Guide
 
 
 \size normal 
-SDCC 2.5.6
+SDCC 2.6.4
 \size footnotesize 
 
 \newline 
@@ -142,8 +142,8 @@ Sandeep Dutta
 
 , etc.), Dallas DS80C390 variants, Freescale (formerly Motorola) HC08 and
  Zilog Z80 based MCUs.
- It can be retargetted for other microprocessors, support for Microchip
PIC, Atmel AVR is under development.
+ It can be retargeted for other microprocessors, support for Microchip PIC,
+ Atmel AVR is under development.
  The entire source code for the compiler is distributed under GPL.
  SDCC uses ASXXXX
 \begin_inset LatexCommand \index{asXXXX (as-gbz80, as-hc08, asx8051, as-z80)}
@@ -155,7 +155,7 @@ Sandeep Dutta
 
 \end_inset 
 
-, an open source retargettable assembler & linker.
+, an open source retargetable assembler & linker.
  SDCC has extensive language extensions suitable for utilizing various microcont
 rollers and underlying hardware effectively.
  
@@ -212,7 +212,7 @@ Supported data-types are:
 <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">
+<column alignment="block" valignment="top" leftline="true" rightline="true" width="20text%">
 <row topline="true" bottomline="true">
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 \begin_inset Text
@@ -461,7 +461,7 @@ signed
 
 \layout Standard
 
-0, +4.294.967.296
+0, +4.294.967.295
 \end_inset 
 </cell>
 </row>
@@ -502,6 +502,16 @@ signed
 
 \layout Standard
 
+1.175494351E-38, 
+\family roman 
+\series medium 
+\shape up 
+\size normal 
+\emph off 
+\bar no 
+\noun off 
+\color none
+3.402823466E+38
 \end_inset 
 </cell>
 </row>
@@ -578,9 +588,7 @@ status Collapsed
 
 \newline 
 SDCC also comes with a companion source level debugger SDCDB, the debugger
- currently uses ucSim a freeware simulator for 8051 and other micro-controllers.
- SDCDB and ucSim are currently not available on Win32 platforms.
+ currently uses ucSim a freeware simulator for 8051 and other micro-controllers.<
 \newline 
 
 \newline 
@@ -723,8 +731,24 @@ the default directory for gcc-builds where include, library and documentation
  files are stored is now in /usr/local/share.
 \layout Itemize
 
-char type parameters to vararg functions are casted to int unless explicitly
- casted, e.g.: 
+char type parameters to vararg
+\begin_inset LatexCommand \index{vararg, va\_arg}
+
+\end_inset 
+
+ functions are casted to int unless explicitly casted
+\begin_inset Marginal
+collapsed true
+
+\layout Standard
+
+
+\series bold 
+\SpecialChar ~
+!
+\end_inset 
+
+, e.g.: 
 \newline 
 
 \family typewriter 
@@ -825,9 +849,14 @@ bit b;
 \newline 
 \SpecialChar ~
 \SpecialChar ~
-b = ~b; /* equivalent to b=1 instead of toggling b */
+b = ~
+\begin_inset LatexCommand \index{\~\/ Operator}
+
+\end_inset 
+
+b; /* equivalent to b=1 instead of toggling b */
 \begin_inset Marginal
-collapsed false
+collapsed true
 
 \layout Standard
 
@@ -954,13 +983,13 @@ For most users it is sufficient to skip to either section
 
 \end_inset 
 
- or section 
(Unix) or section 
 \begin_inset LatexCommand \ref{sub:Windows-Install}
 
 \end_inset 
 
-.
- More detailled instructions follow below.
+ (Windows).
+ More detailed instructions follow below.
 \layout Section
 
 Configure Options
@@ -1033,18 +1062,42 @@ status Collapsed
 \layout List
 \labelwidthstring 00.00.0000
 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-datarootdir see table below
+\newline 
+
+\layout List
+\labelwidthstring 00.00.0000
+
+\SpecialChar ~
+\SpecialChar ~
 docdir environment variable, see table below
 \layout List
 \labelwidthstring 00.00.0000
 
+\SpecialChar ~
+\SpecialChar ~
 include_dir_suffix environment variable, see table below
 \layout List
 \labelwidthstring 00.00.0000
 
+\SpecialChar ~
+\SpecialChar ~
 lib_dir_suffix environment variable, see table below
 \layout List
 \labelwidthstring 00.00.0000
 
+\SpecialChar ~
+\SpecialChar ~
 sdccconf_h_dir_separator environment variable, either / or 
 \backslash 
 
@@ -1052,6 +1105,8 @@ sdccconf_h_dir_separator environment variable, either / or
  makes sense here.
  This character will only be used in sdccconf.h; don't forget it's a C-header,
  therefore a double-backslash is needed there.
+\newline 
+
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -1206,6 +1261,8 @@ status Collapsed
 \end_inset 
 
 -disable-packihx Disables building packihx
+\newline 
+
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -1308,7 +1365,7 @@ These defaults are:
 \align center 
 
 \begin_inset  Tabular
-<lyxtabular version="3" rows="8" columns="3">
+<lyxtabular version="3" rows="9" columns="3">
 <features>
 <column alignment="block" valignment="top" leftline="true" width="0in">
 <column alignment="block" valignment="top" leftline="true" width="0in">
@@ -1419,7 +1476,7 @@ BINDIR
 
 
 \emph on 
-$EXECPREFIX
+$EXEC_PREFIX
 \emph default 
 /bin
 \end_inset 
@@ -1431,7 +1488,7 @@ $EXECPREFIX
 
 
 \emph on 
-$EXECPREFIX
+$EXEC_PREFIX
 \emph default 
 
 \backslash 
@@ -1456,6 +1513,38 @@ DATADIR
 \layout Standard
 
 
+\emph on 
+$DATAROOTDIR
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\emph on 
+$DATAROOTDIR
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\emph on 
+DATAROOTDIR
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
 \emph on 
 $PREFIX
 \emph default 
@@ -1491,7 +1580,7 @@ DOCDIR
 
 
 \emph on 
-$DATADIR
+$DATAROOTDIR
 \emph default 
 /sdcc/doc
 \end_inset 
@@ -1503,7 +1592,7 @@ $DATADIR
 
 
 \emph on 
-$DATADIR
+$DATAROOTDIR
 \emph default 
 
 \backslash 
@@ -1741,7 +1830,7 @@ status Collapsed
 /
 \end_inset 
 
--datadir=
+-datarootdir=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1858,7 +1947,7 @@ status Collapsed
 /
 \end_inset 
 
--datadir=
+-datarootdir=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1874,7 +1963,9 @@ docdir=
 \begin_inset Quotes srd
 \end_inset 
 
-/sdcc/doc
+
+\backslash 
+${datarootdir}/doc
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1950,7 +2041,7 @@ status Collapsed
 /
 \end_inset 
 
--disable-ucsim
+-host=i586-mingw32msvc
 \backslash 
 
 \newline 
@@ -1964,16 +2055,6 @@ status Collapsed
 /
 \end_inset 
 
--host=i586-mingw32msvc -
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash 
-/
-\end_inset 
-
 -build=unknown-unknown-linux-gnu
 \layout Standard
 
@@ -1992,30 +2073,6 @@ compile on Cygwin for Mingw32 (see also sdcc/support/scripts/sdcc_cygwin_mingw32
 ./configure -C 
 \backslash 
 
-\newline 
-CFLAGS=
-\begin_inset Quotes srd
-\end_inset 
-
--mno-cygwin -O2
-\begin_inset Quotes srd
-\end_inset 
-
-\backslash 
-
-\newline 
-LDFLAGS=
-\begin_inset Quotes srd
-\end_inset 
-
--mno-cygwin
-\begin_inset Quotes srd
-\end_inset 
-
-\backslash 
-
 \newline 
 -
 \begin_inset ERT
@@ -2049,7 +2106,7 @@ status Collapsed
 /
 \end_inset 
 
--datadir=
+-datarootdir=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -2065,7 +2122,9 @@ docdir=
 \begin_inset Quotes srd
 \end_inset 
 
-/sdcc/doc
+
+\backslash 
+${datarootdir}/doc
 \begin_inset Quotes srd
 \end_inset 
 
@@ -2117,17 +2176,27 @@ sdccconf_h_dir_separator=
 \backslash 
 
 \newline 
--
-\begin_inset ERT
-status Collapsed
+CC=
+\begin_inset Quotes srd
+\end_inset 
 
-\layout Standard
+gcc -mno-cygwin
+\begin_inset Quotes srd
+\end_inset 
 
 \backslash 
-/
+
+\newline 
+CXX=
+\begin_inset Quotes srd
+\end_inset 
+
+g++ -mno-cygwin
+\begin_inset Quotes srd
 \end_inset 
 
--disable-ucsim
 \layout Standard
 
 'configure' is quite slow on Cygwin (at least on windows before Win2000/XP).
@@ -3410,14 +3479,6 @@ With the Mingw32 gcc cross compiler it's easy to compile SDCC for Win32.
  See section 'Configure Options'.
 \layout Subsection
 
-Building SDCC on Windows 
-\layout Standard
-
-With the exception of Cygwin the SDCC binaries uCsim and sdcdb can't be
- built on Windows.
- They use Unix-sockets, which are not available on Win32.
-\layout Subsection
-
 Building SDCC using Cygwin and Mingw32
 \layout Standard
 
@@ -3617,8 +3678,7 @@ Download the source package
 
 \series default 
  SDCC is distributed with all the projects, workspaces, and files you need
- to build it using Visual C++ 6.0/NET (except for sdcdb.exe which currently
- doesn't build under MSVC).
+ to build it using Visual C++ 6.0/NET (except for SDCDB and ucSim).
  The workspace name is 'sdcc.dsw'.
  Please note that as it is now, all the executables are created in a folder
  called sdcc
@@ -3818,7 +3878,7 @@ Building SDCC Using Borland
 
 From the sdcc directory, run the command "make -f Makefile.bcc".
  This should regenerate all the .exe files in the bin directory except for
sdcdb.exe (which currently doesn't build under Borland C++).
SDCDB and ucSim.
 \layout Enumerate
 
 If you modify any source files and need to rebuild, be aware that the dependenci
@@ -4081,6 +4141,11 @@ x).
 \layout Section
 
 Reading the Documentation
+\begin_inset LatexCommand \index{Documentation}
+
+\end_inset 
+
+
 \layout Standard
 
 Currently reading the document in pdf format is recommended, as for unknown
@@ -4638,11 +4703,9 @@ link-gbz80 - The Z80 and GameBoy Z80 linkers.
 \layout Itemize
 
 s51 - The ucSim 8051 simulator.
- Not available on Win32 platforms.
 \layout Itemize
 
 sdcdb - The source debugger.
- Not available on Win32 platforms.
 \layout Itemize
 
 packihx - A tool to pack (compress) Intel hex files.
@@ -4686,7 +4749,17 @@ The preprocessor
 
 \end_inset 
 
- is a modified version of the GNU preprocessor.
+ is a modified version of the GNU cpp
+\begin_inset LatexCommand \index{cpp|see{sdcpp}}
+
+\end_inset 
+
+ preprocessor 
+\begin_inset LatexCommand \url{http://gcc.gnu.org/}
+
+\end_inset 
+
+.
  The C preprocessor is used to pull in #include sources, process #ifdef
  statements, #defines and so on.
 \layout Subsection
@@ -4726,19 +4799,18 @@ S51
 .
  It currently supports the core mcs51, the Dallas DS80C390 and the Phillips
  XA51 family.
- S51 is currently not available on Win32 platfors.
 \layout Subsection
 
 sdcdb - Source Level Debugger
 \layout Standard
 
-Sdcdb
-\begin_inset LatexCommand \index{sdcdb (debugger)}
+SDCDB
+\begin_inset LatexCommand \index{SDCDB (debugger)}
 
 \end_inset 
 
  is the companion source level debugger.
- More about sdcdb in section 
+ More about SDCDB in section 
 \begin_inset LatexCommand \ref{cha:Debugging-with-SDCDB}
 
 \end_inset 
@@ -4750,7 +4822,6 @@ Sdcdb
 \end_inset 
 
 , but can be easily changed to use other simulators.
- Sdcdb is currently not available on Win32 platfors.
 \layout Chapter
 
 Using SDCC
@@ -4935,7 +5006,7 @@ sourcefile.adb
  - An intermediate file containing debug information needed to create the
  .cdb file (with -
 \begin_inset ERT
-status Open
+status Collapsed
 
 \layout Standard
 
@@ -5059,6 +5130,137 @@ Anatomy of the compiler
 ).
 \layout Subsection
 
+Postprocessing the Intel Hex
+\begin_inset LatexCommand \index{Intel hex format}
+
+\end_inset 
+
+ file
+\layout Standard
+
+In most cases this won't be needed but the Intel Hex file
+\begin_inset LatexCommand \index{<file>.ihx}
+
+\end_inset 
+
+ which is generated by SDCC might include lines of varying length and the
+ addresses within the file are not guaranteed to be strictly ascending.
+ If your toolchain or a bootloader does not like this you can use the tool
+\family typewriter 
+packihx
+\family default 
+
+\begin_inset LatexCommand \index{packihx (tool)}
+
+\end_inset 
+
+ which is part of the SDCC distribution: 
+\newline 
+
+\newline 
+
+\family sans 
+\series bold 
+ packihx sourcefile.ihx >sourcefile.hex
+\family default 
+\series default 
+
+\newline 
+
+\newline 
+The separately available
+\emph on 
+ srecord
+\emph default 
+
+\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
+
+\end_inset 
+
+ package additionally allows to set undefined locations to a predefined
+ value, to insert checksums
+\begin_inset LatexCommand \index{checksum}
+
+\end_inset 
+
+ of various flavours (crc, add, xor) and to perform other manipulations
+ (convert, split, crop, offset, ...).
+\newline 
+
+\newline 
+
+\family sans 
+\series bold 
+srec_cat\SpecialChar ~
+\SpecialChar ~
+sourcefile.ihx -intel\SpecialChar ~
+\SpecialChar ~
+-o sourcefile.hex -intel
+\newline 
+
+\newline 
+
+\family default 
+\series default 
+An example for a more complex command line
+\begin_inset Foot
+collapsed false
+
+\layout Standard
+
+the command backfills
+\begin_inset LatexCommand \index{backfill unused memory}
+
+\end_inset 
+
+ unused memory with 0x12 and the overall 16 bit sum of the complete 64 kByte
+ block is zero.
+ If the program counter on an mcs51 runs wild the backfill pattern 0x12
+ will be interpreted as an 
+\family typewriter 
+lcall
+\family default 
+ to address 
+\family typewriter 
+0x1212
+\family default 
+ (where an emergency routine could sit).
+\end_inset 
+
+ could look like:
+\newline 
+
+\newline 
+
+\family sans 
+\series bold 
+\size footnotesize 
+srec_cat\SpecialChar ~
+sourcefile.ihx -intel\SpecialChar ~
+\SpecialChar ~
+-fill 0x12 0x0000 0xfffe\SpecialChar ~
+-little-endian-checksum-nega
+tive 0xfffe 0x02 0x02\SpecialChar ~
+\SpecialChar ~
+-o sourcefile.hex -intel
+\size default 
+
+\newline 
+
+\newline 
+
+\family default 
+\series default 
+The srecord package is available at 
+\begin_inset LatexCommand \url{http://sf.net/projects/srecord}
+
+\end_inset 
+
+ .
+\layout Subsection
+
 Projects with Multiple Source Files
 \layout Standard
 
@@ -5507,10 +5709,10 @@ __mulint
 \newline 
 
 \layout Standard
-
+\added_space_bottom bigskip 
 If the source files are compiled using -
 \begin_inset ERT
-status Open
+status Collapsed
 
 \layout Standard
 
@@ -5682,7 +5884,7 @@ Processor Selection Options
 
 \end_inset 
 
- processor (In development, not complete).
+ processor (Not maintained, not complete).
  AVR users should probably have a look at winavr 
 \begin_inset LatexCommand \url{http://sourceforge.net/projects/winavr}
 
@@ -5754,7 +5956,7 @@ p16f627 p16f628 p16f84 p16f873 p16f877?
 
  processor (Not maintained, not complete).
 \layout List
-\labelwidthstring 00.00.0000
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
 
 
 \series bold 
@@ -5973,6 +6175,33 @@ Like `-dD' except that the macro arguments and contents are omitted.
 \labelwidthstring 00.00.0000
 
 
+\series bold 
+-pedantic-parse-number
+\begin_inset LatexCommand \index{-pedantic-parse-number}
+
+\end_inset 
+
+
+\size large 
+\bar under 
+\series default 
+\size default 
+\bar default 
+Pedentic parse numbers so that situations like 0xfe-LO_B(3) are parsed properly
+ and the macro LO_B(3) gets expanded.
+ See also #pragma pedantic_parse_number in section
+\begin_inset LatexCommand \ref{sec:Pragmas}
+
+\end_inset 
+
+\emph on 
+Note: this functionality is not in conformance with standard!
+\layout List
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
+
+
 \series bold 
 -Wp\SpecialChar ~
 preprocessorOption[,preprocessorOption]
@@ -5993,9 +6222,29 @@ sdcpp
 \end_inset 
 
 .
- SDCC uses an adapted version of the preprocessor cpp of the GNU Compiler
- Collection (gcc), if you need more dedicated options please refer to the
- documentation at 
+ SDCC uses an adapted version of the preprocessor 
+\emph on 
+cpp
+\emph default 
+ of the GNU Compiler Collection
+\begin_inset LatexCommand \index{gcc (GNU Compiler Collection)}
+
+\end_inset 
+
+ (
+\emph on 
+gcc
+\emph default 
+\begin_inset LatexCommand \url{http://gcc.gnu.org/}
+
+\end_inset 
+
+), if you need more dedicated options please refer to the GCC\SpecialChar ~
+4.1.1\SpecialChar ~
+CPP\SpecialChar ~
+Manual
+ at 
 \begin_inset LatexCommand \htmlurl{http://www.gnu.org/software/gcc/onlinedocs/}
 
 \end_inset 
@@ -6136,8 +6385,12 @@ status Collapsed
 \end_inset 
 
  segment, default value 0.
- Note when this option is used the interrupt vector table is also relocated
- to the given address.
+ Note when this option is used the interrupt vector table
+\begin_inset LatexCommand \index{interrupt vector table}
+
+\end_inset 
+
+ is also relocated to the given address.
  The value entered can be in Hexadecimal or Decimal format, e.g.: -
 \begin_inset ERT
 status Collapsed
@@ -6287,7 +6540,12 @@ status Collapsed
 
 \end_inset 
 
- is placed after the pdata segment.
+ is placed after the pdata
+\begin_inset LatexCommand \index{pdata (mcs51, ds390 storage class)}
+
+\end_inset 
+
+ segment.
  Using this option the xstack can be placed anywhere in the external memory
  space of the 8051.
  The value entered can be in Hexadecimal or Decimal format, e.g.
@@ -6552,6 +6810,11 @@ status Collapsed
 \end_inset 
 
 
+\begin_inset LatexCommand \index{HC08!Options!-\/-out-fmt-elf}
+
+\end_inset 
+
+
 \bar under 
  
 \series default 
@@ -6562,9 +6825,14 @@ The linker output (final object code) is in ELF format
 \end_inset 
 
 .
- (Currently only supported for the HC08 processors)
+ (Currently only supported for the HC08
+\begin_inset LatexCommand \index{HC08}
+
+\end_inset 
+
+ processors)
 \layout List
-\labelwidthstring 00.00.0000
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
 
 
 \series bold 
@@ -6578,7 +6846,23 @@ linkOption[,linkOption]
 
 ...
  Pass the linkOption to the linker.
- See file sdcc/as/doc/asxhtm.html for more on linker options.
+ If a bootloader is used an option like 
+\begin_inset Quotes sld
+\end_inset 
+
+-Wl\SpecialChar ~
+-bCSEG=0x1000
+\begin_inset Quotes srd
+\end_inset 
+
+ would be typical to set the start of the code segment.
+ See also #pragma constseg and #pragma codeseg in section 
+\begin_inset LatexCommand \ref{sec:Pragmas}
+
+\end_inset 
+
+ .
+ File sdcc/as/doc/asxhtm.html has more on linker options.
 \layout Subsection
 
 MCS51 Options
@@ -6698,8 +6982,13 @@ status Collapsed
 
 
 \series default 
- Uses a pseudo stack in the first 256 bytes in the external ram for allocating
- variables and passing parameters.
+ Uses a pseudo stack in the pdata
+\begin_inset LatexCommand \index{pdata (mcs51, ds390 storage class)}
+
+\end_inset 
+
+ area (usually the first 256 bytes in the external ram) for allocating variables
+ and passing parameters.
  See section 
 \begin_inset LatexCommand \ref{sub:External-Stack}
 
@@ -6833,7 +7122,7 @@ status Collapsed
  data, idata and stack together.
  This is the default now.
 \layout List
-\labelwidthstring 00.00.0000
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
 
 
 \series bold 
@@ -6864,7 +7153,7 @@ DS390 / DS400 Options
 \end_inset 
 
 
-\begin_inset LatexCommand \index{DS390 options}
+\begin_inset LatexCommand \index{DS390}
 
 \end_inset 
 
@@ -6887,7 +7176,7 @@ status Collapsed
 -model-flat24
 \series default 
 
-\begin_inset LatexCommand \index{-\/-model-flat24}
+\begin_inset LatexCommand \index{DS390!Options!-\/-model-flat24}
 
 \end_inset 
 
@@ -6921,7 +7210,7 @@ status Collapsed
 \end_inset 
 
 -protect-sp-update
-\begin_inset LatexCommand \index{-\/-protect-sp-update}
+\begin_inset LatexCommand \index{DS390!Options!-\/-protect-sp-update}
 
 \end_inset 
 
@@ -6946,7 +7235,7 @@ status Collapsed
 -stack-10bit
 \series default 
 
-\begin_inset LatexCommand \index{-\/-stack-10bit}
+\begin_inset LatexCommand \index{DS390!Options!-\/-stack-10bit}
 
 \end_inset 
 
@@ -7041,7 +7330,7 @@ status Collapsed
 \end_inset 
 
 -stack-probe
-\begin_inset LatexCommand \index{-\/-stack-probe}
+\begin_inset LatexCommand \index{DS390!Options!-\/-stack-probe}
 
 \end_inset 
 
@@ -7064,7 +7353,7 @@ status Collapsed
 \end_inset 
 
 -tini-libid
-\begin_inset LatexCommand \index{-\/-tini-libid}
+\begin_inset LatexCommand \index{DS390!Options!-\/-tini-libid}
 
 \end_inset 
 
@@ -7073,7 +7362,7 @@ status Collapsed
  <nnnn> LibraryID used in -mTININative.
  
 \layout List
-\labelwidthstring 00.00.0000
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
 
 
 \series bold 
@@ -7088,7 +7377,7 @@ status Collapsed
 \end_inset 
 
 -use-accelerator
-\begin_inset LatexCommand \index{-\/-use-accelerator}
+\begin_inset LatexCommand \index{DS390!Options!-\/-use-accelerator}
 
 \end_inset 
 
@@ -7104,7 +7393,7 @@ Z80 Options
 \end_inset 
 
 
-\begin_inset LatexCommand \index{Z80 options}
+\begin_inset LatexCommand \index{Z80}
 
 \end_inset 
 
@@ -7127,7 +7416,7 @@ status Collapsed
 -callee-saves-bc
 \series default 
 
-\begin_inset LatexCommand \index{-\/-callee-saves-bc}
+\begin_inset LatexCommand \index{Z80!Options!-\/-callee-saves-bc}
 
 \end_inset 
 
@@ -7139,7 +7428,7 @@ status Collapsed
 \emph default 
 Force a called function to always save BC.
 \layout List
-\labelwidthstring 00.00.0000
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
 
 
 \series bold 
@@ -7156,7 +7445,7 @@ status Collapsed
 -no-std-crt0
 \series default 
 
-\begin_inset LatexCommand \index{-\/-no-std-crt0}
+\begin_inset LatexCommand \index{Z80!Options!-\/-no-std-crt0}
 
 \end_inset 
 
@@ -7563,7 +7852,7 @@ status Collapsed
  The compiler will optimize code generation towards fast code, possibly
  at the expense of code size.
 \layout List
-\labelwidthstring 00.00.0000
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
 
 
 \series bold 
@@ -7986,8 +8275,8 @@ status Collapsed
 \series default 
  This option can be used if the code generated is called by a monitor program
  or if the main routine includes an endless loop.
- This option might result in slightly smaller code and save two bytes of
- stack space.
+ This option results in slightly smaller code and saves two bytes of stack
+ space.
  The return from the 'main'
 \begin_inset LatexCommand \index{main return}
 
@@ -8257,7 +8546,19 @@ status Collapsed
 
 \series default 
  Display errors and warnings using MSVC style, so you can use SDCC with
- visual studio.
+ the visual studio IDE
+\begin_inset LatexCommand \index{IDE}
+
+\end_inset 
+
+.
+ With SDCC both offering a GCC-like (the default) and a MSVC-like
+\begin_inset LatexCommand \index{MSVC output style}
+
+\end_inset 
+
+ output style, integration into most programming editors should be straightforwa
+rd.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -8475,6 +8776,29 @@ status Collapsed
 \labelwidthstring 00.00.0000
 
 
+\series bold 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-fdollars-in-identifiers
+\begin_inset LatexCommand \index{-\/-fdollars-in-identifiers}
+
+\end_inset 
+
+
+\series default 
+ Permit '$' as an identifier character
+\layout List
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
+
+
 \series bold 
 more-pedantic
 \series default 
@@ -8858,7 +9182,7 @@ status Collapsed
 \series default 
  Will create a dump of the live ranges of iTemp's
 \layout List
-\labelwidthstring 00.00.0000
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
 
 
 \series bold 
@@ -8889,7 +9213,7 @@ Will cause all the above mentioned dumps to be created.
 
 Redirecting output on Windows Shells
 \layout Standard
-
+\added_space_bottom bigskip 
 By default SDCC writes it's error messages to 
 \begin_inset Quotes sld
 \end_inset 
@@ -9132,7 +9456,7 @@ Search Paths
 
 ..
 \layout Standard
-
+\added_space_bottom bigskip 
 There are some more environment variables recognized by SDCC, but these
  are solely used for debugging purposes.
  They can change or disappear very quickly, and will never be documented.
@@ -9654,6 +9978,11 @@ sfr
 \end_inset 
 
 
+\begin_inset LatexCommand \index{sbit}
+
+\end_inset 
+
+
 \layout Standard
 
 Like the bit keyword, 
@@ -9699,12 +10028,19 @@ __sfr __at
  (0x80) P0;\SpecialChar ~
  /* special function register P0 at location 0x80 */
 \newline 
-/* 16 bit special function register combination for timer 0 */
+
+\newline 
+/* 16 bit special function register combination for timer 0
 \newline 
-/* with the high byte at location 0x8C and the low byte at location 0x8A
- */
+\SpecialChar ~
+\SpecialChar ~
+ with the high byte at location 0x8C and the low byte at location 0x8A */
+\newline 
+__sfr16 __at (0x8C8A) TMR0;
+\newline 
+
 \newline 
-__sfr16 __at
+__sbit __at
 \begin_inset LatexCommand \index{at}
 
 \end_inset 
@@ -9714,9 +10050,8 @@ __sfr16 __at
 
 \end_inset 
 
- (0x8C8A) TMR0;
-\newline 
-__sbit __at (0xd7) CY; /* CY (Carry Flag
+ (0xd7) CY;\SpecialChar ~
+ /* CY (Carry Flag
 \begin_inset LatexCommand \index{Flags}
 
 \end_inset 
@@ -9748,6 +10083,61 @@ sfr32.
 \emph default 
  Allthough SDCC usually accesses them Least Significant Byte (LSB) first,
  this is not guaranteed.
+\newline 
+
+\layout Standard
+
+Please note, if you use a header file which was written for another compiler
+ then the sfr / sfr16 / sfr32 / sbit Storage Class extensions will most
+ likely be 
+\emph on 
+not 
+\emph default 
+compatible.
+ Specifically the syntax 
+\family typewriter 
+\SpecialChar ~
+sfr P0 = 0x80;\SpecialChar ~
+
+\family default 
+ is compiled 
+\emph on 
+without warning
+\emph default 
+ by SDCC to an assignment of 0x80 to a variable called P0 
+\family typewriter 
+
+\begin_inset Marginal
+collapsed true
+
+\layout Standard
+
+
+\series bold 
+\SpecialChar ~
+!
+\end_inset 
+
+.
+\family default 
+Nevertheless it is possible to write header files
+\begin_inset LatexCommand \index{Header files}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Include files}
+
+\end_inset 
+
+ which can be shared among different compilers (see section 
+\begin_inset LatexCommand \ref{sec:Porting-code-to-other-compilers}
+
+\end_inset 
+
+).
 \layout Subsubsection
 
 Pointers
@@ -9801,15 +10191,24 @@ __code unsigned char * __code p;
 \newline 
 
 \newline 
-/* the following is a generic pointer physically located in xdata space
- */
+/* generic pointer physically located in xdata space */
 \newline 
-char * __xdata p;
+unsigned char * __xdata p;
 \newline 
 
 \newline 
-/* the following is a function pointer physically located in data space
- */
+/* generic pointer physically located in default memory space */
+\newline 
+unsigned char * p;
+\newline 
+
+\newline 
+/* the following is a function pointer
+\begin_inset LatexCommand \index{function pointer}
+
+\end_inset 
+
+ physically located in data space */
 \newline 
 char (* __data fp)(void);
 \layout Standard
@@ -9849,8 +10248,12 @@ generic
 \end_inset 
 
  routines.
- Explicitly specifying the pointer type will generate the most efficient
- code.
+ Explicitly specifying the pointer
+\begin_inset LatexCommand \index{pointer}
+
+\end_inset 
+
+ type will generate the most efficient code.
 \layout Subsubsection
 
 Notes on MCS51 memory
@@ -10144,7 +10547,7 @@ status Collapsed
  If in doubt, don't specify any options and see if the resulting memory
  layout is appropriate, then you can adjust it.
 \layout Standard
-
+\added_space_bottom bigskip 
 The linker generates two files with memory allocation information.
  The first, with extension .map
 \begin_inset LatexCommand \index{<file>.map}
@@ -10167,7 +10570,7 @@ The linker generates two files with memory allocation information.
 \layout Subsection
 
 Z80/Z180 Storage Class
-\begin_inset LatexCommand \index{Storage class}
+\begin_inset LatexCommand \index{Z80!Storage class}
 
 \end_inset 
 
@@ -10204,6 +10607,16 @@ utput memory.
  I/O memory
 \begin_inset LatexCommand \index{I/O memory (Z80, Z180)}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Z80!I/O memory}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Z180!I/O memory}
+
 \end_inset 
 
  is accessed with special instructions, e.g.:
@@ -10317,13 +10730,13 @@ sfr
 \end_inset 
 
 /HD64180
-\begin_inset LatexCommand \index{HD64180}
+\begin_inset LatexCommand \index{HD64180 (see Z180)}
 
 \end_inset 
 
 )
 \layout Standard
-
+\added_space_bottom bigskip 
 The compiler option -
 \begin_inset ERT
 status Collapsed
@@ -10334,13 +10747,18 @@ status Collapsed
 /
 \end_inset 
 
--portmode=180 (80) and a compiler #pragma\SpecialChar ~
+-portmode
+\begin_inset LatexCommand \index{Z180!Options!-\/-portmode}
+
+\end_inset 
+
+=180 (80) and a compiler #pragma\SpecialChar ~
 portmode
-\begin_inset LatexCommand \index{\#pragma portmode}
+\begin_inset LatexCommand \index{Z180!Pragmas!\#pragma portmode}
 
 \end_inset 
 
-=z180 (z80) is used to turn on (off) the Z180/HD64180 port addressing instructio
+ z180 (z80) is used to turn on (off) the Z180/HD64180 port addressing instructio
 ns 
 \family typewriter 
 in0/out0
@@ -10354,7 +10772,7 @@ in/out
 \layout Subsection
 
 HC08 Storage Class
-\begin_inset LatexCommand \index{Storage class}
+\begin_inset LatexCommand \index{HC08!Storage class}
 
 \end_inset 
 
@@ -10376,8 +10794,12 @@ data
 
 The data storage class declares a variable that resides in the first 256
  bytes of memory (the direct page).
- The HC08 is most efficient at accessing variables (especially pointers)
- stored here.
+ The HC08
+\begin_inset LatexCommand \index{HC08}
+
+\end_inset 
+
+ is most efficient at accessing variables (especially pointers) stored here.
 \layout Subsubsection
 
 xdata
@@ -10392,7 +10814,7 @@ xdata
 
  
 \layout Standard
-
+\added_space_bottom bigskip 
 The xdata storage class declares a variable that can reside anywhere in
  memory.
  This is the default if no storage class is specified.
@@ -10446,10 +10868,10 @@ xdata
 
 \end_inset 
 
(0x7ffe) unsigned int chksum;
0x7ffe unsigned int chksum;
 \layout Standard
 
-or
+or, better conforming to ISO/IEC 9899 C:
 \layout Verse
 
 
@@ -10810,7 +11232,7 @@ __bit
 \SpecialChar ~
 /* I/O port 1, bit 2 */
 \layout Standard
-
+\added_space_bottom bigskip 
 and you can use the same hardware dependent routine without changes, as
  for example in a library.
  This is somehow similar to sbit, but only one absolute address has to be
@@ -11061,8 +11483,12 @@ Parameters
 It is however allowed to use bit parameters in reentrant functions and also
  non-static local bit variables are supported.
  Efficient use is limited to 8 semi-bitregisters in bit space.
- They are pushed and popped to stack as a single byte just like the normal
- registers.
+ They are pushed and popped to stack
+\begin_inset LatexCommand \index{stack}
+
+\end_inset 
+
+ as a single byte just like the normal registers.
 \layout Section
 
 Overlaying
@@ -11212,7 +11638,7 @@ set_error(10);
 \newline 
 }
 \layout Standard
-
+\added_space_bottom bigskip 
 In the above example the parameter 
 \emph on 
 errcd
@@ -11288,7 +11714,12 @@ interrupt
 \emph default 
  keyword is the interrupt number this routine will service.
  When present, the compiler will insert a call to this routine in the interrupt
- vector table for the interrupt number specified.
+ vector table
+\begin_inset LatexCommand \index{interrupt vector table}
+
+\end_inset 
+
+ for the interrupt number specified.
  If you have multiple source files in your project, interrupt service routines
  can be present in any of them, but a prototype of the isr MUST be present
  or included in the file that contains the function 
@@ -11296,7 +11727,7 @@ interrupt
 main
 \emph default 
 .
- The optional 
+ The optional (8051 specific) keyword 
 \emph on 
 using
 \begin_inset LatexCommand \index{using (mcs51, ds390 register bank)}
@@ -11310,15 +11741,23 @@ using
 
 
 \emph default 
- keyword can be used to tell the compiler to use the specified register
bank (8051 specific) when generating code for this function.
+ can be used to tell the compiler to use the specified register bank when
+ generating code for this function.
  
 \newline 
+Interrupt service routines open the door for some very interesting bugs:
+\layout Subsubsection
+
 
+\begin_inset LatexCommand \label{sub:Common-interrupt-pitfall-volatile}
+
+\end_inset 
+
+Common interrupt pitfall: variable not declared 
+\emph on 
+volatile
 \layout Standard
 
-Interrupt service routines open the door for some very interesting bugs:
-\newline 
 If an interrupt service routine changes variables which are accessed by
  other functions these variables have to be declared 
 \emph on 
@@ -11330,7 +11769,22 @@ volatile
 \end_inset 
 
 .
+ See 
+\begin_inset LatexCommand \url{http://en.wikipedia.org/wiki/Volatile_variable}
+
+\end_inset 
+
+ .
+\layout Subsubsection
+
+
+\begin_inset LatexCommand \label{sub:Common-interrupt-pitfall-non-atomic}
+
+\end_inset 
+
+Common interrupt pitfall: 
+\emph on 
+non-atomic access
 \layout Standard
 
 If the access to these variables is not 
@@ -11346,8 +11800,10 @@ atomic
  the processor needs more than one instruction for the access and could
  be interrupted while accessing the variable) the interrupt must be disabled
  during the access to avoid inconsistent data.
- Access to 16 or 32 bit variables is obviously not atomic on 8 bit CPUs
- and should be protected by disabling interrupts.
+\newline 
+Access to 16 or 32 bit variables is obviously not atomic on 8 bit CPUs and
+ should be protected by disabling interrupts.
  You're not automatically on the safe side if you use 8 bit variables though.
  We need an example here: f.e.
  on the 8051 the harmless looking 
@@ -11404,8 +11860,19 @@ counter\SpecialChar ~
 counter
 \family default 
  is located in data memory.
- Bugs like these are hard to reproduce and can cause a lot of trouble.
+\newline 
+Bugs like these are hard to reproduce and can cause a lot of trouble.
  
+\layout Subsubsection
+
+
+\begin_inset LatexCommand \label{sub:Common-interrupt-pitfall-stack-overflow}
+
+\end_inset 
+
+Common interrupt pitfall: 
+\emph on 
+stack overflow
 \layout Standard
 
 The return address and the registers used in the interrupt service routine
@@ -11436,6 +11903,16 @@ deepest
 
  subroutine when the stack is already in use for f.e.
  many return addresses.
+\layout Subsubsection
+
+
+\begin_inset LatexCommand \label{sub:Common-interrupt-pitfall-non-reentrant}
+
+\end_inset 
+
+Common interrupt pitfall: 
+\emph on 
+use of non-reentrant functions
 \layout Standard
 
 A special note here, int (16 bit) and long (32 bit) integer division
@@ -11458,8 +11935,7 @@ A special note here, int (16 bit) and long (32 bit) integer division
 
 \end_inset 
 
- operations are implemented using external support routines developed in
- ANSI-C.
+ operations are implemented using external support routines.
  If an interrupt service routine needs to do any of these operations then
  the support routines (as mentioned in a following section) will have to
  be recompiled using the
@@ -11501,28 +11977,51 @@ status Collapsed
 \end_inset 
 
  compiler option.
- Note, the type promotion
+\newline 
+Note, the type promotion
 \begin_inset LatexCommand \index{type promotion}
 
 \end_inset 
 
- required by ANSI C can cause 16 bit routines to be used without the programmer
- being aware of it.
+ required by ANSI C can cause 16 bit routines to be used
+\begin_inset Marginal
+collapsed true
+
 \layout Standard
 
-Calling other functions from an interrupt service routine is not recommended,
- avoid it if possible.
- Note that when some function is called from an interrupt service routine
- it should be preceded by a #pragma\SpecialChar ~
-nooverlay
-\begin_inset LatexCommand \index{\#pragma nooverlay}
 
+\series bold 
+\SpecialChar ~
+!
 \end_inset 
 
- if it is not reentrant.
- Furthermore nonreentrant functions should not be called from the main program
- while the interrupt service routine might be active.
+ without the programmer being aware of it.
+ See f.e.
+ the cast 
+\family typewriter 
+(unsigned char)(tail-1)
+\family default 
+ within the if clause in section 
+\begin_inset LatexCommand \ref{sub:A-Step-by Assembler Introduction}
+
+\end_inset 
+
+.
+\layout Standard
+\added_space_bottom bigskip 
+Calling other functions from an interrupt service routine is not recommended,
+ avoid it if possible.
+ Note that when some function is called from an interrupt service routine
+ it should be preceded by a #pragma\SpecialChar ~
+nooverlay
+\begin_inset LatexCommand \index{\#pragma nooverlay}
+
+\end_inset 
+
+ if it is not reentrant.
+ Furthermore nonreentrant functions should not be called from the main program
+ while the interrupt service routine might be active.
  They also must not be called from low priority interrupt service routines
  while a high priority interrupt service routine might be active.
  You could use semaphores or make the function
@@ -11531,9 +12030,7 @@ nooverlay
 \emph default 
  if all parameters are passed in registers.
 \newline 
-
-\newline 
-Also see section 
+ Also see section 
 \begin_inset LatexCommand \ref{sub:Overlaying}
 
 \end_inset 
@@ -11551,10 +12048,19 @@ about Functions using private register banks.
 MCS51/DS390 Interrupt Service Routines
 \layout Standard
 
-Interrupt numbers and the corresponding address & descriptions for the Standard
- 8051/8052 are listed below.
- SDCC will automatically adjust the interrupt vector table to the maximum
- interrupt number specified.
+Interrupt
+\begin_inset LatexCommand \index{interrupt}
+
+\end_inset 
+
+ numbers and the corresponding address & descriptions for the Standard 8051/8052
+ are listed below.
+ SDCC will automatically adjust the 
+\begin_inset LatexCommand \index{interrupt vector table}
+
+\end_inset 
+
+ to the maximum interrupt number specified.
 \newline 
 
 \layout Standard
@@ -11832,7 +12338,7 @@ using
  This scheme may be advantageous for small interrupt service routines which
  have low register usage.
 \layout Standard
-
+\added_space_bottom bigskip 
 If the interrupt service routine is defined to be using a specific register
  bank then only 
 \emph on 
@@ -11840,16 +12346,31 @@ a, b, dptr
 \emph default 
  & psw are saved and restored, if such an interrupt service routine calls
  another function (using another register bank) then the entire register
- bank of the called function will be saved on the stack.
+ bank of the called function will be saved on the stack
+\begin_inset LatexCommand \index{stack}
+
+\end_inset 
+
+.
  This scheme is recommended for larger interrupt service routines.
 \layout Subsection
 
-HC08 Interrupt Service Routines
+HC08
+\begin_inset LatexCommand \index{HC08}
+
+\end_inset 
+
+ Interrupt Service Routines
 \layout Standard
+\added_space_bottom bigskip 
+Since the number of interrupts
+\begin_inset LatexCommand \index{HC08!interrupt}
+
+\end_inset 
 
-Since the number of interrupts available is chip specific and the interrupt
- vector table always ends at the last byte of memory, the interrupt numbers
corresponds to the interrupt vectors in reverse order of address.
+ available is chip specific and the interrupt vector table always ends at
+ the last byte of memory, the interrupt numbers corresponds to the interrupt
+ vectors in reverse order of address.
  For example, interrupt 1 will use the interrupt vector at 0xfffc, interrupt
  2 will use the interrupt vector at 0xfffa, and so on.
  However, interrupt 0 (the reset vector at 0xfffe) is not redefinable in
@@ -11864,7 +12385,16 @@ Since the number of interrupts available is chip specific and the interrupt
 Z80 Interrupt Service Routines
 \layout Standard
 
-The Z80 uses several different methods for determining the correct interrupt
+The Z80
+\begin_inset LatexCommand \index{Z80}
+
+\end_inset 
+
+ uses several different methods for determining the correct interrupt
+\begin_inset LatexCommand \index{Z80!interrupt}
+
+\end_inset 
+
  vector depending on the hardware implementation.
  Therefore, SDCC ignores the optional interrupt number and does not attempt
  to generate an interrupt vector table.
@@ -11895,7 +12425,7 @@ void nmi_isr (void) critical interrupt
 \newline 
 }
 \layout Standard
-
+\added_space_bottom bigskip 
 However if you need to create a non-interruptable interrupt service routine
  you would also require the 
 \emph on 
@@ -12136,7 +12666,12 @@ On other architectures which have seperate opcodes for enabling and disabling
 
 \end_inset 
 
- (HC08):
+ (HC08
+\begin_inset LatexCommand \index{HC08!interrupt}
+
+\end_inset 
+
+):
 \layout Verse
 
 
@@ -12410,7 +12945,23 @@ possible exception: if a function is called ONLY from 'interrupt' functions
 \newline 
 
 \emph on 
-(pending: I don't think this has been done yet)
+(pending: Note, nowadays the 
+\emph default 
+using
+\emph on 
+ attribute has an effect on
+\emph default 
+\emph on 
+the generated code for a 
+\emph default 
+non-interrupt
+\emph on 
+ function
+\emph default 
+.
+\emph on 
+)
 \layout Standard
 
 An 
@@ -12450,7 +13001,7 @@ used
  own: I suggest using the default bank zero and taking the small performance
  hit.
 \layout Standard
-
+\added_space_bottom bigskip 
 It is most efficient if your ISR calls no other functions.
  If your ISR must call other functions, it is most efficient if those functions
  use the same bank as the ISR (see note 1 below); the next best is if the
@@ -12518,7 +13069,12 @@ _sdcc_external_startup()
 \end_inset 
 
  memory has to be explicitly enabled before it can be accessed or if the
- watchdog needs to be disabled, this is the place to do it.
+ watchdog
+\begin_inset LatexCommand \index{watchdog}
+
+\end_inset 
+
+ needs to be disabled, this is the place to do it.
  The startup code clears all internal data memory, 256 bytes by default,
  but from 0 to n-1 if 
 \emph on 
  is used.
  (recommended for Chipcon CC1010).
 \layout Standard
-
-See also the compiler option 
+\added_space_bottom bigskip 
+See also the compiler options 
 \emph on 
 -
 \begin_inset ERT
@@ -12564,6 +13120,25 @@ opt
 
 \begin_inset LatexCommand \index{-\/-no-xinit-opt}
 
+\end_inset 
+
+, 
+\emph on 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-main-return
+\emph default 
+
+\begin_inset LatexCommand \index{-\/-main-return}
+
 \end_inset 
 
  and section 
@@ -12571,21 +13146,30 @@ opt
 
 \end_inset 
 
-\SpecialChar ~
-about MCS51-variants.
+ about MCS51-variants.
 \layout Subsection
 
 HC08 Startup Code
 \layout Standard
+\added_space_bottom bigskip 
+The HC08
+\begin_inset LatexCommand \index{HC08}
+
+\end_inset 
 
-The HC08 startup code follows the same scheme as the MCS51 startup code.
+ startup code follows the same scheme as the MCS51 startup code.
 \layout Subsection
 
 Z80 Startup Code
 \layout Standard
+\added_space_bottom bigskip 
+On the Z80
+\begin_inset LatexCommand \index{Z80}
+
+\end_inset 
 
-On the Z80 the startup code is inserted by linking with crt0.o which is generated
from sdcc/device/lib/z80/crt0.s.
+ the startup code is inserted by linking with crt0.o which is generated from
+ sdcc/device/lib/z80/crt0.s.
  If you need a different startup code you can use the compiler option 
 \emph on 
 -
@@ -12668,7 +13252,85 @@ unsigned char __far
 
 
 \newline 
-unsigned char head, tail;
+unsigned char head, tail;\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+/* if interrupts
+\begin_inset LatexCommand \index{interrupt}
+
+\end_inset 
+
+ are involved see
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+section 
+\begin_inset LatexCommand \ref{sub:Common-interrupt-pitfall-volatile}
+
+\end_inset 
+
+ about
+\series bold 
+ volatile
+\series default 
+ */
 \newline 
 
 \newline 
@@ -12697,7 +13359,7 @@ needed
 
  to integer */
 \begin_inset Marginal
-collapsed false
+collapsed true
 
 \layout Standard
 
@@ -12803,7 +13465,22 @@ mov\SpecialChar ~
 \SpecialChar ~
 r2,dpl 
 \newline 
-;buffer.c if( head != (unsigned char)(tail-1) ) 
+;buffer.c if( head != (unsigned char)(tail-1) ) \SpecialChar ~
+/* cast 
+\series bold 
+needed
+\series default 
+ to avoid promotion
+\begin_inset LatexCommand \index{promotion to signed int}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{type promotion}
+
+\end_inset 
+
+ to integer */
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -13205,13 +13882,8 @@ _endasm
 \layout Standard
 
 The inline assembler code can contain any valid code understood by the assembler
-, this includes any assembler directives and comment lines
-\begin_inset Foot
-collapsed false
-
-\layout Standard
-
-The assembler does not like some characters like ':' or ''' in comments.
+, this includes any assembler directives and comment lines.
+ The assembler does not like some characters like ':' or ''' in comments.
  You'll find an 100+ pages assembler manual in sdcc/as/doc/asxhtm.html
 \begin_inset LatexCommand \index{asXXXX (as-gbz80, as-hc08, asx8051, as-z80)}
 
@@ -13222,11 +13894,16 @@ The assembler does not like some characters like ':' or ''' in comments.
 
 \end_inset 
 
+ or online at 
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/as/doc/asxhtm.html}
 
 \end_inset 
 
+\SpecialChar ~
 .
- The compiler does not do any validation of the code within the 
+\layout Standard
+
+The compiler does not do any validation of the code within the 
 \family typewriter 
 _asm
 \begin_inset LatexCommand \index{\_asm}
@@ -13465,12 +14142,16 @@ For an 8051 target, the generated simpleInterrupt looks like:
 
 \family typewriter 
 Note, this is an 
-\series bold 
+\emph on 
 outdated
-\series default 
+\emph default 
  example, recent versions of SDCC generate
 \newline 
-the same code for simpleInterrupt() and nakedInterrupt()!
+the 
+\emph on 
+same
+\emph default 
+ code for simpleInterrupt() and nakedInterrupt()!
 \newline 
 
 \newline 
@@ -14313,7 +14994,7 @@ pop  _bp
 \SpecialChar ~
 ret
 \layout Standard
-
+\added_space_bottom bigskip 
 The compiling and linking procedure remains the same, however note the extra
  entry & exit linkage required for the assembler code, _bp is the stack
  frame pointer and is used to compute the offset into the stack for parameters
@@ -14629,9 +15310,9 @@ Floating Point Support
 
 \layout Standard
 
-SDCC supports IEEE (single precision 4 bytes) floating point numbers.The
- floating point support routines are derived from gcc's floatlib.c and consist
- of the following routines:
+SDCC supports IEEE (single precision 4 bytes) floating point numbers.
+ The floating point support routines are derived from gcc's floatlib.c and
consist of the following routines:
 \newline 
 
 \layout Standard
@@ -15264,7 +15945,7 @@ convert long to floating point number
 \newline 
 
 \layout Standard
-
+\added_space_bottom bigskip 
 These support routines are developed in ANSI-C so there is room for space
  and speed improvement
 \begin_inset Foot
@@ -15465,6 +16146,48 @@ and
 not
 \emph default 
  support long variables and field widths).
+\layout Subsubsection
+
+<malloc.h>
+\begin_inset LatexCommand \index{malloc.h}
+
+\end_inset 
+
+
+\layout Standard
+
+As of SDCC 2.6.2 you no longer need to call an initialization routine before
+ using dynamic memory allocation
+\begin_inset LatexCommand \index{dynamic memory allocation (malloc)}
+
+\end_inset 
+
+ and a default heap
+\begin_inset LatexCommand \index{heap (malloc)}
+
+\end_inset 
+
+ space of 1024 bytes is provided for malloc to allocate memory from.
+ If you need a different heap size you need to recompile _heap.c with the
+ required size defined in HEAP_SIZE.
+ It is recommended to make a copy of this file into your project directory
+ and compile it there with:
+\layout Verse
+
+
+\family typewriter 
+sdcc -c _heap.c -D HEAD_SIZE=2048
+\newline 
+
+\family default 
+And then link it with:
+\layout Verse
+
+
+\family typewriter 
+sdcc main.rel _heap.rel
+\newline 
+
 \layout Subsection
 
 Math functions (sinf, powf, sqrtf etc.)
@@ -15521,7 +16244,9 @@ C, CAN, Ethernet, Profibus, Modbus, USB, SPI, JTAG ...), Media (IDE, Memory
 
 \SpecialChar ~
 would certainly like to hear about it.
- Programmers coding for embedded systems are not especially famous for being
+\layout Standard
+\added_space_bottom bigskip 
+Programmers coding for embedded systems are not especially famous for being
  enthusiastic, so don't expect a big hurray but as the mailing list is searchabl
 e these references are very valuable.
  Let's help to create a climate where information is shared.
@@ -15778,6 +16503,11 @@ status Collapsed
 \layout Section
 
 Pragmas
+\begin_inset LatexCommand \label{sec:Pragmas}
+
+\end_inset 
+
+
 \begin_inset LatexCommand \index{Pragmas}
 
 \end_inset 
@@ -15788,17 +16518,25 @@ Pragmas
 SDCC supports the following #pragma directives:
 \layout Itemize
 
+
+\series bold 
 save
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma save}
 
 \end_inset 
 
- - this will save all current options to the save/restore stack.
+ - this will save most current options to the save/restore stack.
  See #pragma\SpecialChar ~
 restore.
 \layout Itemize
 
+
+\series bold 
 restore
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma restore}
 
 \end_inset 
@@ -15813,7 +16551,11 @@ save.
 
 \layout Itemize
 
+
+\series bold 
 callee_saves
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma callee\_saves}
 
 \end_inset 
@@ -15859,7 +16601,11 @@ callee_saves
  is appended to the list of functions specified in the command line.
 \layout Itemize
 
+
+\series bold 
 exclude
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma exclude}
 
 \end_inset 
@@ -15911,8 +16657,12 @@ none
 .
 \layout Itemize
 
-less_pedantic
-\begin_inset LatexCommand \index{\#pragma less\_pedantic}
+
+\series bold 
+less_pedantic
+\series default 
+
+\begin_inset LatexCommand \index{\#pragma less\_pedantic}
 
 \end_inset 
 
@@ -15920,7 +16670,11 @@ less_pedantic
  your own now ;-(
 \layout Itemize
 
-disable_warning <nnnn>
+
+\series bold 
+disable_warning
+\series default 
+ <nnnn>
 \begin_inset LatexCommand \index{\#pragma disable\_warning}
 
 \end_inset 
@@ -15928,7 +16682,11 @@ disable_warning <nnnn>
  - the compiler will not warn you anymore about warning number <nnnn>.
 \layout Itemize
 
+
+\series bold 
 nogcse
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma nogcse}
 
 \end_inset 
@@ -15936,7 +16694,11 @@ nogcse
  - will stop global common subexpression elimination.
 \layout Itemize
 
+
+\series bold 
 noinduction
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma noinduction}
 
 \end_inset 
@@ -15944,7 +16706,11 @@ noinduction
  - will stop loop induction optimizations.
 \layout Itemize
 
+
+\series bold 
 noinvariant
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma noinvariant}
 
 \end_inset 
@@ -15958,7 +16724,11 @@ noinvariant
 .
 \layout Itemize
 
+
+\series bold 
 noiv
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma noiv}
 
 \end_inset 
@@ -15968,7 +16738,12 @@ noiv
 
 \end_inset 
 
- vector table entries for all ISR functions defined after the pragma.
+ vector table
+\begin_inset LatexCommand \index{interrupt vector table}
+
+\end_inset 
+
+ entries for all ISR functions defined after the pragma.
  This is useful in cases where the interrupt vector table must be defined
  manually, or when there is a secondary, manually defined interrupt vector
  table (e.g.
@@ -15983,7 +16758,11 @@ noiv
 about interrupts.
 \layout Itemize
 
+
+\series bold 
 nojtbound
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma nojtbound}
 
 \end_inset 
@@ -15998,7 +16777,11 @@ nojtbound
 .
 \layout Itemize
 
+
+\series bold 
 noloopreverse
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma noloopreverse}
 
 \end_inset 
@@ -16006,7 +16789,11 @@ noloopreverse
  - Will not do loop reversal optimization
 \layout Itemize
 
+
+\series bold 
 nooverlay
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma nooverlay}
 
 \end_inset 
@@ -16015,7 +16802,11 @@ nooverlay
  function.
 \layout Itemize
 
+
+\series bold 
 stackauto
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma stackauto}
 
 \end_inset 
@@ -16043,25 +16834,39 @@ status Collapsed
  Parameters and Local Variables.
 \layout Itemize
 
-opt_code_speed 
+
+\series bold 
+opt_code_speed
+\series default 
 \begin_inset LatexCommand \index{\#pragma opt\_code\_speed}
 
 \end_inset 
 
 - The compiler will optimize code generation towards fast code, possibly
  at the expense of code size.
+ Currently this has little effect.
 \layout Itemize
 
-opt_code_size 
+
+\series bold 
+opt_code_size
+\series default 
 \begin_inset LatexCommand \index{\#pragma opt\_code\_size}
 
 \end_inset 
 
 - The compiler will optimize code generation towards compact code, possibly
  at the expense of code speed.
+ Currently this has little effect.
 \layout Itemize
 
-opt_code_balanced 
+
+\series bold 
+opt_code_balanced
+\series default 
 \begin_inset LatexCommand \index{\#pragma opt\_code\_balanced}
 
 \end_inset 
@@ -16072,7 +16877,11 @@ opt_code_balanced
  
 \layout Itemize
 
-std_sdcc89 
+
+\series bold 
+std_sdcc89
+\series default 
 \begin_inset LatexCommand \index{\#pragma std\_sdcc89}
 
 \end_inset 
@@ -16081,7 +16890,11 @@ std_sdcc89
  with the standard (default).
 \layout Itemize
 
-std_c89 
+
+\series bold 
+std_c89
+\series default 
 \begin_inset LatexCommand \index{\#pragma std\_c89}
 
 \end_inset 
@@ -16090,7 +16903,11 @@ std_c89
  standard.
 \layout Itemize
 
-std_sdcc99 
+
+\series bold 
+std_sdcc99
+\series default 
 \begin_inset LatexCommand \index{\#pragma std\_sdcc99}
 
 \end_inset 
@@ -16099,7 +16916,11 @@ std_sdcc99
  with the standard (incomplete support).
 \layout Itemize
 
-std_c99 
+
+\series bold 
+std_c99
+\series default 
 \begin_inset LatexCommand \index{\#pragma std\_c99}
 
 \end_inset 
@@ -16108,7 +16929,11 @@ std_c99
  standard (incomplete support).
 \layout Itemize
 
-codeseg <name>
+
+\series bold 
+codeseg
+\series default 
+ <name>
 \begin_inset LatexCommand \index{\#pragma codeseg}
 
 \end_inset 
@@ -16128,7 +16953,11 @@ status Collapsed
 -codeseg.
 \layout Itemize
 
-constseg <name>
+
+\series bold 
+constseg
+\series default 
+ <name>
 \begin_inset LatexCommand \index{\#pragma constseg}
 
 \end_inset 
@@ -16148,16 +16977,213 @@ status Collapsed
 -constseg.
 \layout Standard
 
-SDCPP supports the following #pragma directives:
+The preprocessor SDCPP
+\begin_inset LatexCommand \index{sdcpp (preprocessor)}
+
+\end_inset 
+
+ supports the following #pragma directives:
+\layout Itemize
+
+
+\series bold 
+pedantic_parse_number
+\series default 
+
+\begin_inset LatexCommand \index{\#pragma pedantic\_parse\_number}
+
+\end_inset 
+
+ (+ | -) - Pedantic parse numbers so that situations like 0xfe-LO_B(3) are
+ parsed properly and the macro LO_B(3) gets expanded.
+ Default is off.
+ Below is an example on how to use this pragma.
+
+\emph on 
+ Note: this functionality is not in conformance with standard!
+\layout Verse
+
+
+\family typewriter 
+#pragma pedantic_parse_number +
+\begin_inset LatexCommand \index{\#pragma pedantic\_parse\_number}
+
+\end_inset 
+
+
+\newline 
+
+\newline 
+#define LO_B(x) ((x) & 0xff)
+\newline 
+
+\newline 
+unsigned char foo(void)
+\newline 
+{
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+unsigned char c=0xfe-LO_B(3);
+\newline 
+
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+return c;
+\newline 
+}
+\newline 
+
 \layout Itemize
 
+
+\series bold 
 preproc_asm
+\series default 
+
 \begin_inset LatexCommand \index{\#pragma preproc\_asm}
 
 \end_inset 
 
  (+ | -) - switch _asm _endasm block preprocessing on / off.
  Default is on.
+ You use this prama to define multilines of assembly code.
+ This will prevent the preprocessor from changing the formating required
+ by assembly code.
+ Below is an example on how to use this pragma.
+\layout Verse
+
+
+\family typewriter 
+#pragma preproc_asm -
+\begin_inset LatexCommand \index{\#pragma preproc\_asm}
+
+\end_inset 
+
+
+\newline 
+#define MYDELAY _asm
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+nop ;my assembly comment...
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+nop
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+nop
+\newline 
+_endasm
+\newline 
+#pragma preproc_asm +
+\newline 
+
+\newline 
+void foo (void) 
+\newline 
+{ 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ ...
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ MYDELAY;
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ ...
+\newline 
+} 
+\newline 
+
+\layout Itemize
+
+
+\series bold 
+sdcc_hash
+\series default 
+
+\begin_inset LatexCommand \index{\#pragma sdcc\_hash}
+
+\end_inset 
+
+ (+ | -) - Allow "naked" hash in macro definition, for example:
+\newline 
+
+\family typewriter 
+#define DIR_LO(x) #(x & 0xff)
+\family default 
+
+\newline 
+Default is off.
+ Below is an example on how to use this pragma.
+\layout Verse
+
+
+\family typewriter 
+#pragma preproc_asm +
+\newline 
+#pragma sdcc_hash +
+\begin_inset LatexCommand \index{\#pragma sdcc\_hash}
+
+\end_inset 
+
+
+\newline 
+
+\newline 
+#define ROMCALL(x) 
+\backslash 
+
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+mov R6_B3, #(x & 0xff) 
+\backslash 
+
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+mov R7_B3, #((x >> 8) & 0xff) 
+\backslash 
+
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+lcall __romcall
+\newline 
+
+\newline 
+...
+\newline 
+_asm
+\newline 
+ROMCALL(72)
+\newline 
+_endasm;
+\newline 
+...
+\newline 
+
 \layout Standard
 
 The pragma's are intended to be used to turn-on or off certain optimizations
@@ -16236,6 +17262,12 @@ int foo ()
 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
  changing options for a function.
+\newline 
+
+\newline 
+
+\newline 
+
 \layout Section
 
 Defines Created by the Compiler
@@ -16260,8 +17292,8 @@ The compiler creates the following #defines
 \begin_inset  Tabular
 <lyxtabular version="3" rows="11" columns="2">
 <features>
-<column alignment="left" valignment="top" leftline="true" width="0">
-<column alignment="left" valignment="top" leftline="true" rightline="true" width="0">
+<column alignment="left" valignment="top" leftline="true" width="3in">
+<column alignment="left" valignment="top" leftline="true" rightline="true" width="3in">
 <row topline="true" bottomline="true">
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 \begin_inset Text
@@ -16330,7 +17362,7 @@ SDCC_mcs51
 
 \end_inset 
 
-, etc
+, etc.
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -16338,7 +17370,7 @@ SDCC_mcs51
 
 \layout Standard
 
-depending on the model used (e.g.: -mds390
+depending on the model used (e.g.: -mds390)
 \end_inset 
 </cell>
 </row>
@@ -16694,17 +17726,17 @@ sfr
 
 
 \family typewriter 
-sfr at 0x92 _XPAGE; /* Cypress EZ-USB family */
+__sfr __at (0x92) _XPAGE; /* Cypress EZ-USB family */
 \layout Verse
 
 
 \family typewriter 
-sfr at 0xaf _XPAGE; /* some Silicon Labs (Cygnal) chips */
+__sfr __at (0xaf) _XPAGE; /* some Silicon Labs (Cygnal) chips */
 \layout Verse
 
 
 \family typewriter 
-sfr at 0xaa _XPAGE; /* some Silicon Labs (Cygnal) chips */
+__sfr __at (0xaa) _XPAGE; /* some Silicon Labs (Cygnal) chips */
 \layout Standard
 
 For more exotic implementations further customizations may be needed.
@@ -16718,7 +17750,7 @@ For more exotic implementations further customizations may be needed.
 
 Other Features available by SFR
 \layout Standard
-
+\added_space_bottom bigskip 
 Some MCS51 variants offer features like Double DPTR
 \begin_inset LatexCommand \index{DPTR}
 
@@ -16732,8 +17764,18 @@ Some MCS51 variants offer features like Double DPTR
 
 DS400 port
 \layout Standard
+\added_space_bottom bigskip 
+The DS80C400
+\begin_inset LatexCommand \index{DS80C400}
+
+\end_inset 
 
-The DS80C400 microcontroller has a rich set of peripherals.
+
+\begin_inset LatexCommand \index{DS400}
+
+\end_inset 
+
+ microcontroller has a rich set of peripherals.
  In its built-in ROM library it includes functions to access some of the
  features, among them is a TCP stack with IP4 and IP6 support.
  Library headers (currently in beta status) and other files are provided
@@ -16751,7 +17793,7 @@ The DS80C400 microcontroller has a rich set of peripherals.
 The Z80 and gbz80 port
 \layout Standard
 
-SDCC can target both the Zilog 
+SDCC can target both the Zilog Z80
 \begin_inset LatexCommand \index{Z80}
 
 \end_inset 
@@ -16771,15 +17813,20 @@ regressions tests
 
 
 \emph default 
- as the MCS51 and DS390 ports, so floating point support, support for long
+ (see section 
+\begin_inset LatexCommand \ref{sec:Quality-control}
+
+\end_inset 
+
+) as the MCS51 and DS390 ports, so floating point support, support for long
  variables and bitfield support is fine.
  See mailing lists and forums about interrupt routines.
 \layout Standard
-
+\added_space_bottom bigskip 
 As always, the code is the authoritative reference - see z80/ralloc.c and
  z80/gen.c.
  The stack
-\begin_inset LatexCommand \index{stack}
+\begin_inset LatexCommand \index{Z80!stack}
 
 \end_inset 
 
@@ -16787,7 +17834,7 @@ As always, the code is the authoritative reference - see z80/ralloc.c and
  IX is used as the base pointer, HL and IY are used as a temporary registers,
  and BC and DE are available for holding variables.
  Return values
-\begin_inset LatexCommand \index{return value}
+\begin_inset LatexCommand \index{Z80!return value}
 
 \end_inset 
 
@@ -16801,7 +17848,7 @@ As always, the code is the authoritative reference - see z80/ralloc.c and
 The HC08 port
 \layout Standard
 
-The port to the Motorola HC08
+The port to the Freescale/Motorola HC08
 \begin_inset LatexCommand \index{HC08}
 
 \end_inset 
@@ -16812,12 +17859,16 @@ The port to the Motorola HC08
  unoptimized.
  Some of the SDCC's standard C library functions have embedded non-HC08
  inline assembly and so are not yet usable.
-\newline 
+\layout Standard
+\added_space_bottom bigskip 
+The HC08 port passes the regression test suite (see section 
+\begin_inset LatexCommand \ref{sec:Quality-control}
 
-\newline 
+\end_inset 
 
+).
 \layout Section
-
+\pagebreak_top 
 The PIC14 port
 \layout Standard
 
@@ -16827,7 +17878,17 @@ The 14bit PIC
 \end_inset 
 
  port still requires a major effort from the development community.
- However it can work for very simple code.
+ However it can work for simple code.
+ It passes its (smaller set of) regression tests
+\begin_inset LatexCommand \index{Regression test (PIC14)}
+
+\end_inset 
+
+ in the directory 
+\shape italic 
+sdcc/src/regression
+\shape default 
+.
 \layout Subsection
 
 C code and 14bit PIC code page
@@ -16851,19 +17912,13 @@ The linker organizes allocation for the code page and RAM banks.
  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 treats all local variables of a single C file as being in
- the same RAM bank unless it is an extern.
 \newline 
 
 \newline 
 To get the best follow these guide lines:
 \layout Enumerate
 
-make local functions static, as non static functions require code page selection
- overhead.
-\layout Enumerate
-
-Make local variables static as extern variables require RAM bank selection
+Make local functions static, as non static functions require code page selection
  overhead.
 \layout Enumerate
 
@@ -16872,24 +17927,29 @@ For devices that have multiple code pages it is more efficient to use the
  for the 16F877 use 4 separate files and i.e.
  for the 16F874 use 2 separate files.
  This way the linker can put the code for each file into different code
- pages and the compiler can allocate reusable variables more efficiently
- and there's less page selection overhead.
+ pages and there's less page selection overhead.
+\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'.
+ instruction set), use 'unsigned char' whereever possible instead of 'int'.
 \layout Subsection
 
 Creating a device include file 
 \layout Standard
 
-For generating a device include file use the support perl script inc2h.pl
- kept in directory support/script.
+For generating a device include file
+\begin_inset LatexCommand \index{PIC14!Header files}
+
+\end_inset 
+
+ use the support perl script inc2h.pl kept in directory support/script.
 \layout Subsection
 
 Interrupt code
 \layout Standard
 
-For the interrupt function, use the keyword 'interrupt'
-\begin_inset LatexCommand \index{interrupt}
+For the interrupt function, use the keyword '__interrupt'
+\begin_inset LatexCommand \index{PIC14!interrupt}
 
 \end_inset 
 
@@ -16900,7 +17960,7 @@ For the interrupt function, use the keyword 'interrupt'
 
 
 \family typewriter 
-void Intr(void) interrupt 0
+void Intr(void) __interrupt 0
 \newline 
 {
 \newline 
@@ -17059,7 +18119,51 @@ status Collapsed
 /
 \end_inset 
 
--debug-extra emit debug info in assembly output
+-debug-extra
+\begin_inset LatexCommand \index{PIC14!Options!-\/-debug-extra}
+
+\end_inset 
+
+ emit debug info in assembly output
+\layout List
+\labelwidthstring 00.00.0000
+
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-no-pcode-opt
+\begin_inset LatexCommand \index{PIC14!Options!-\/-no-pcode-opt}
+
+\end_inset 
+
+ disable (slightly faulty) optimization on pCode
+\layout List
+\labelwidthstring 00.00.0000
+
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-stack-loc
+\begin_inset LatexCommand \index{PIC14!Options!-\/-stack-loc}
+
+\end_inset 
+
+ sets the lowest address of the argument passing stack (defaults to a suitably
+ large shared databank to reduce BANKSEL overhead)
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -17073,7 +18177,12 @@ status Collapsed
 /
 \end_inset 
 
--no-pcode-opt disable (slightly faulty) optimization on pCode
+-stack-size
+\begin_inset LatexCommand \index{PIC14!Options!-\/-stack-size}
+
+\end_inset 
+
+ sets the size if the argument passing stack (default: 16, minimum: 4)
 \layout Subsection
 
 The library
@@ -17120,7 +18229,12 @@ XXX
 \layout Standard
 
 This warning can usually be ignored due to the very good compatibility amongst
- 14 bit PIC devices.
+ 14 bit PIC
+\begin_inset LatexCommand \index{PIC14}
+
+\end_inset 
+
+ devices.
 \layout Standard
 
 You might also consider recompiling the library for your specific device
@@ -17154,8 +18268,23 @@ main()
 not
 \series default 
  be initialized.
-\layout Section
+\family typewriter 
+\size footnotesize 
+
+\begin_inset Marginal
+collapsed true
+
+\layout Standard
+
 
+\series bold 
+\SpecialChar ~
+!
+\end_inset 
+
+
+\layout Section
+\pagebreak_top 
 The PIC16
 \begin_inset LatexCommand \index{PIC16}
 
@@ -17413,7 +18542,12 @@ status Collapsed
 /
 \end_inset 
 
--callee-saves See -
+-callee-saves
+\begin_inset LatexCommand \index{PIC16!Options!-\/-callee-saves}
+
+\end_inset 
+
+ See -
 \begin_inset ERT
 status Collapsed
 
@@ -17437,7 +18571,12 @@ status Collapsed
 /
 \end_inset 
 
--all-callee-saves All function arguments are passed on stack by default.
+-all-callee-saves
+\begin_inset LatexCommand \index{PIC16!Options!-\/-all-callee-saves}
+
+\end_inset 
+
+ All function arguments are passed on stack by default.
  
 \emph on 
 There is no need to specify this in the command line.
@@ -17454,8 +18593,12 @@ status Collapsed
 /
 \end_inset 
 
--fommit-frame-pointer Frame pointer will be omitted when the function uses
- no local variables.
+-fommit-frame-pointer
+\begin_inset LatexCommand \index{PIC16!Options!-\/-fommit-frame-pointer}
+
+\end_inset 
+
+ Frame pointer will be omitted when the function uses no local variables.
 \layout Subsection
 
 Port Specific Options
@@ -17487,7 +18630,7 @@ status Collapsed
 /
 \end_inset 
 
--stack-model=[model] Used in conjuction with the command above.
+-pstack-model=[model] Used in conjuction with the command above.
  Defines the stack model to be used, valid stack models are : 
 \begin_deeper 
 \layout List
@@ -17583,7 +18726,12 @@ status Collapsed
 /
 \end_inset 
 
--mplab-comp MPLAB compatibility option.
+-mplab-comp MPLAB
+\begin_inset LatexCommand \index{PIC16!MPLAB}
+
+\end_inset 
+
+ compatibility option.
  Currently only suppresses special gpasm directives.
 \layout Subsubsection
 
@@ -17858,8 +19006,12 @@ NO_REG_OPT do not perform pCode registers optimization.
 Preprocessor Macros
 \layout Standard
 
-PIC16 port defines the following preprocessor macros while translating a
- source.
+PIC16
+\begin_inset LatexCommand \index{PIC16}
+
+\end_inset 
+
+ port defines the following preprocessor macros while translating a source.
 \layout Standard
 \align center 
 
@@ -18240,12 +19392,27 @@ Pragmas
 
 \layout Standard
 
-PIC16 port currently supports the following pragmas:
+PIC16
+\begin_inset LatexCommand \index{PIC16}
+
+\end_inset 
+
+ port currently supports the following pragmas:
 \layout List
 \labelwidthstring 00.00.0000
 
-stack pragma stack forces the code generator to initialize the stack & frame
- pointers at a specific address.
+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
  in the linker script or gplink is not instructed to create a stack section.
 \newline 
@@ -18298,18 +19465,12 @@ If the stack_size field is omitted then a stack is created with the default
 \layout List
 \labelwidthstring 00.00.0000
 
-wparam 
-\emph on 
-This pragma is deprecated.
- Its use will cause a warning message to be issued.
-\emph default 
-
-\newline 
+code
+\begin_inset LatexCommand \index{PIC16!Pragmas!\#pragma code}
 
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset 
 
-code place a function symbol at static FLASH address
+ place a function symbol at static FLASH address
 \layout LyX-Code
 
 Example:
@@ -18667,8 +19828,17 @@ Header Files
 
 \layout Standard
 
-There is one main header file that can be included to the source files using
- the pic16 port.
+There is one main header file
+\begin_inset LatexCommand \index{PIC16!Header files}
+
+\end_inset 
+
+ that can be included to the source files using the pic16
+\begin_inset LatexCommand \index{PIC16}
+
+\end_inset 
+
+ port.
  That file is the 
 \series bold 
 pic18fregs.h
@@ -18690,7 +19860,12 @@ The specific microcontroller is selected within the pic18fregs.h automatically,
 Libraries
 \layout Standard
 
-The libraries that PIC16
+The libraries
+\begin_inset LatexCommand \index{PIC16!Libraries}
+
+\end_inset 
+
+ that PIC16
 \begin_inset LatexCommand \index{PIC16}
 
 \end_inset 
@@ -18907,8 +20082,13 @@ The standard device libraries (see
 Stack
 \layout Standard
 
-The stack implementation for the PIC16 port uses two indirect registers,
- FSR1 and FSR2.
+The stack
+\begin_inset LatexCommand \index{PIC16!stack}
+
+\end_inset 
+
+ implementation for the PIC16 port uses two indirect registers, FSR1 and
+ FSR2.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -19071,12 +20251,21 @@ These limitations are caused by the fact that only FSRxL is modified when
 Functions
 \layout Standard
 
-In addition to the standard SDCC function keywords, PIC16 port makes available
- two more:
+In addition to the standard SDCC function keywords, PIC16
+\begin_inset LatexCommand \index{PIC16}
+
+\end_inset 
+
+ port makes available two more:
 \layout List
 \labelwidthstring 00.00.0000
 
-wparam Use the WREG to pass one byte of the first function argument.
+wparam
+\begin_inset LatexCommand \index{PIC16!wparam}
+
+\end_inset 
+
+ Use the WREG to pass one byte of the first function argument.
  This improves speed but you may not use this for functions with arguments
  that are called via function pointers, otherwise the first byte of the
  first parameter will get lost.
@@ -19100,15 +20289,17 @@ void func_wparam(int a) wparam
 \layout LyX-Code
 
 }
-\layout Standard
-
-This keyword replaces the deprecated wparam pragma.
 \layout List
 \labelwidthstring 00.00.0000
 
-shadowregs When entering/exiting an ISR, it is possible to take advantage
- of the PIC18F hardware shadow registers which hold the values of WREG,
- STATUS and BSR registers.
+shadowregs
+\begin_inset LatexCommand \index{PIC16!shadowregs}
+
+\end_inset 
+
+ When entering/exiting an ISR, it is possible to take advantage of the PIC18F
+ hardware shadow registers which hold the values of WREG, STATUS and BSR
+ registers.
  This can be done by adding the keyword 
 \emph on 
 shadowregs
@@ -19272,7 +20463,12 @@ on stack, FSR0 points to the beginning
 Interrupts
 \layout Standard
 
-An interrupt servive routine (ISR) is declared using the 
+An interrupt
+\begin_inset LatexCommand \index{PIC16!interrupt}
+
+\end_inset 
+
+ service routine (ISR) is declared using the 
 \emph on 
 interrupt
 \emph default 
@@ -19589,7 +20785,7 @@ rest of the pointer
 
 \layout Standard
 
-descrption
+description
 \end_inset 
 </cell>
 </row>
@@ -20203,7 +21399,7 @@ void main(void)
 {
 \layout LyX-Code
 
-    stdout = STREAM_USER;    /* this is not necessery, since stdout points
+    stdout = STREAM_USER;    /* this is not necessary, since stdout points
 \layout LyX-Code
 
                               * by default to STREAM_USER */
@@ -20797,7 +21993,12 @@ Here you can find some general tips for compiling programs with SDCC/pic16.
 Stack size
 \layout Standard
 
-The default stack size (that is 64 bytes) probably is enough for many programs.
+The default stack
+\begin_inset LatexCommand \index{PIC16!stack}
+
+\end_inset 
+
+ size (that is 64 bytes) probably is enough for many programs.
  One must take care that when there are many levels of function nesting,
  or there is excessive usage of stack, its size should be extended.
  An example of such a case is the printf/sprintf family of functions.
@@ -20825,6 +22026,34 @@ status Collapsed
 -fommit-frame-pointer might reduce stack usage by not creating unnecessery
  stack frames.
  Other ways to reduce stack usage may exist.
+\layout Subsection
+
+Known bugs
+\layout Standard
+
+The PIC16 Port currently does not pass SDCC's regression test
+\begin_inset LatexCommand \index{Regression test (PIC16)}
+
+\end_inset 
+
+ suite (see section 
+\begin_inset LatexCommand \ref{sec:Quality-control}
+
+\end_inset 
+
+) and thus the nightly regression tests for the PIC16 target are currently
+ disabled for all hosts except for 
+\emph on 
+Linux on Opteron.
+
+\emph default 
+ This means you can see the result of the PIC16 regression tests f.e.
+ by checking the log files in 
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/regression_test_results/amd64-unknown-linux2.3/}
+
+\end_inset 
+
+ (pick the most up to date file there, scroll down, lend a hand).
 \layout Chapter
 
 Debugging
@@ -20957,7 +22186,7 @@ e.
 digital oscilloscope
 \emph default 
 
-\begin_inset LatexCommand \index{oscilloscope}
+\begin_inset LatexCommand \index{Oscilloscope}
 
 \end_inset 
 
@@ -21089,7 +22318,7 @@ Debugging with SDCDB
 \end_inset 
 
 
-\begin_inset LatexCommand \index{sdcdb (debugger)}
+\begin_inset LatexCommand \index{SDCDB (debugger)}
 
 \end_inset 
 
@@ -21114,7 +22343,6 @@ on, which also builds and installs the debugger in the target directory
  specified during configuration.
  The debugger allows you debug BOTH at the C source and at the ASM source
  level.
- Sdcdb is currently not available on Win32 platforms.
 \layout Subsection
 
 Compiling for Debugging
@@ -21176,7 +22404,7 @@ status Collapsed
  execution is controlled by the debugger.
  When a command is issued for the debugger, it translates it into appropriate
  commands for the simulator.
- (Currently sdcdb only connects to the simulator but 
+ (Currently SDCDM only connects to the simulator but 
 \emph on 
 newcdb
 \emph default 
@@ -21457,13 +22685,26 @@ bmeps -c -e8f -p3 ddd_example.png >ddd_example.eps
 \layout Comment
 
 The screenshot was included in sdccman.lyx cvs version 1.120 but later removed
- as this broke the build system on Sourceforge (pdf-file was broken).
+ as this broke the build system on Sourceforge (pdf-file was broken.
+ pdflatex does not accept eps files).
 \layout Standard
 
-The .eps File 
+The 
+\emph on 
+p
+\emph default 
+ortable 
+\emph on 
+n
+\emph default 
+etwork 
+\emph on 
+g
+\emph default 
+raphics File 
 \size footnotesize 
 
-\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewcvs.cgi/*checkout*/sdcc/trunk/sdcc/doc/figures/ddd_example.eps}
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewcvs.cgi/*checkout*/sdcc/trunk/sdcc/doc/figures/ddd_example.png}
 
 \end_inset 
 
@@ -22387,6 +23628,18 @@ Use the smallest data type to represent your data-value.
  promoted to 'signed int'
 \begin_inset LatexCommand \index{promotion to signed int}
 
+\end_inset 
+
+
+\begin_inset Marginal
+collapsed true
+
+\layout Standard
+
+
+\series bold 
+\SpecialChar ~
+!
 \end_inset 
 
  before doing any operation.
@@ -22475,6 +23728,8 @@ comp.lang.c FAQ
 :
 \layout Quote
 
+
+\emph on 
 If well-defined overflow characteristics are important and negative values
  are not, or if you want to steer clear of sign-extension problems when
  manipulating bits or bytes, use one of the corresponding unsigned types.
@@ -22503,70 +23758,6 @@ Declare the variables to be local
  whenever possible, especially loop control variables (induction).
 \layout Itemize
 
-Since the compiler does not always do implicit integral promotion, the programme
-r should do an explicit cast when integral promotion is required.
-\layout Itemize
-
-Reducing the size of division, multiplication & modulus operations can reduce
- code size substantially.
- Take the following code for example.
-\begin_deeper 
-\layout Verse
-
-
-\family typewriter 
-foobar(unsigned int p1, unsigned char ch)
-\newline 
-{
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-unsigned char ch1 = p1 % ch ;
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-....
-\newline 
-}
-\layout Standard
-
-For the modulus operation the variable ch will be promoted to unsigned int
- first then the modulus operation will be performed (this will lead to a
- call to support routine _moduint()), and the result will be casted to a
- char.
- If the code is changed to 
-\layout Verse
-
-
-\family typewriter 
-foobar(unsigned int p1, unsigned char ch)
-\newline 
-{
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-unsigned char ch1 = (unsigned char)p1 % ch ;
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-....
-\newline 
-}
-\layout Standard
-
-It would substantially reduce the code generated (future versions of the
- compiler will be smart enough to detect such optimization opportunities).
-\end_deeper 
-\layout Itemize
-
 Have a look at the assembly listing to get a 
 \begin_inset Quotes sld
 \end_inset 
@@ -22579,18 +23770,45 @@ feeling
 \layout Section
 
 Porting code from or to other compilers
+\begin_inset LatexCommand \label{sec:Porting-code-to-other-compilers}
+
+\end_inset 
+
+
 \layout Itemize
 
 check whether endianness of the compilers differs and adapt where needed.
 \layout Itemize
 
-check the device specific header files for compiler specific syntax.
- Eventually include the file <compiler.h
-\begin_inset LatexCommand \index{compiler.h (include file)}
+check the device specific header files
+\begin_inset LatexCommand \index{Header files}
 
 \end_inset 
 
-> to allow using common header files.
+
+\begin_inset LatexCommand \index{Include files}
+
+\end_inset 
+
+ for compiler specific syntax.
+ Eventually include the file <compiler.h
+\begin_inset LatexCommand \index{compiler.h (include file)}
+
+\end_inset 
+
+> 
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/sdcc/trunk/sdcc/device/include/mcs51/compiler.h?view=markup}
+
+\end_inset 
+
+ to allow using common header files.
+ (see f.e.
+ cc2510fx.h 
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/sdcc/trunk/sdcc/device/include/mcs51/cc2510fx.h?view=markup}
+
+\end_inset 
+
+).
 \layout Itemize
 
 check whether the startup code contains the correct initialization (watchdog,
@@ -22626,6 +23844,12 @@ volatile
  The compilers might differ in their optimization characteristics (as different
  versions of the same compiler might also use more clever optimizations
  this is good idea anyway).
+ See section 
+\begin_inset LatexCommand \ref{sub:Common-interrupt-pitfall-volatile}
+
+\end_inset 
+
+.
 \layout Itemize
 
 check that the compilers are not told to supress warnings.
@@ -22635,10 +23859,48 @@ check and convert compiler specific extensions (interrupts, memory areas,
  pragmas etc.).
 \layout Itemize
 
-check for differences in type promotion (especially check for math operations
- on char variables and for the use of the ~\SpecialChar ~
-operator on bit variables.
- See 
+check for differences in type promotion.
+ Especially check for math operations on 
+\family typewriter 
+char
+\family default 
+ or 
+\family typewriter 
+unsigned char
+\family default 
+ variables.
+ For the sake of C99 compatibility SDCC will probably promote these to 
+\family typewriter 
+int
+\family default 
+ more often than other compilers.
+ Eventually insert explicit casts to 
+\family typewriter 
+(char) 
+\family default 
+or
+\family typewriter 
+ (unsigned char)
+\family default 
+.
+ Also check that the ~\SpecialChar ~
+operator
+\begin_inset LatexCommand \index{\~\/ Operator}
+
+\end_inset 
+
+ is not used on 
+\family typewriter 
+bit
+\begin_inset LatexCommand \index{bit}
+
+\end_inset 
+
+
+\family default 
+ variables, use the !\SpecialChar ~
+operator instead.
+ See sections 
 \begin_inset LatexCommand \ref{type promotion}
 
 \end_inset 
@@ -22648,7 +23910,7 @@ operator on bit variables.
 
 \end_inset 
 
-).
+.
 \layout Itemize
 
 check the assembly code generated for interrupt routines (f.e.
@@ -22660,14 +23922,36 @@ check whether timing loops result in proper timing (or preferably consider
 \layout Itemize
 
 check for differences in printf parameters (some compilers push (va_arg
-\begin_inset LatexCommand \index{va\_arg}
+\begin_inset LatexCommand \index{vararg, va\_arg}
+
+\end_inset 
+
+) char variables as 
+\family typewriter 
+int
+\family default 
+ others push them as 
+\family typewriter 
+char
+\family default 
+.
+ See section 
+\begin_inset LatexCommand \ref{sec:Compatibility-with-previous}
 
 \end_inset 
 
-) char variables as integers others as char).
+).
 \layout Itemize
 
-check the resulting memory layout.
+check the resulting memory map
+\begin_inset LatexCommand \index{Memory map}
+
+\end_inset 
+
+.
+ Usage of different memory spaces: code, stack, data (for mcs51/ds390 additional
+ly idata, pdata, xdata).
+ Eventually check if unexpected library functions are included.
 \layout Section
 
 Tools
@@ -22677,7 +23961,7 @@ Tools
 
  included in the distribution
 \layout Standard
-\align center 
+\align left 
 
 \begin_inset  Tabular
 <lyxtabular version="3" rows="12" columns="3">
@@ -22691,6 +23975,8 @@ Tools
 
 \layout Standard
 
+
+\series bold 
 Name
 \end_inset 
 </cell>
@@ -22699,6 +23985,8 @@ Name
 
 \layout Standard
 
+
+\series bold 
 Purpose
 \end_inset 
 </cell>
@@ -22707,6 +23995,8 @@ Purpose
 
 \layout Standard
 
+
+\series bold 
 Directory
 \end_inset 
 </cell>
@@ -22717,7 +24007,7 @@ Directory
 
 \layout Standard
 
-uCsim
+ucSsim
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -22751,7 +24041,17 @@ keil2sdcc.pl
 
 \layout Standard
 
-header file conversion
+header file
+\begin_inset LatexCommand \index{Header files}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Include files}
+
+\end_inset 
+
+ conversion
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -22900,7 +24200,7 @@ sdcc/bin
 
 \layout Standard
 
-sdcdb
+SDCDB
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -23048,7 +24348,12 @@ packihx
 
 \layout Standard
 
-ihx packer
+Intel Hex packer 
+\begin_inset LatexCommand \index{packihx (tool)}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -23085,19 +24390,21 @@ Documentation
 
  included in the distribution
 \layout Standard
-\align center 
+\align left 
 
 \begin_inset  Tabular
 <lyxtabular version="3" rows="10" columns="2">
 <features>
-<column alignment="left" valignment="top" leftline="true" width="0">
-<column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt">
-<row topline="true" bottomline="true">
+<column alignment="block" valignment="top" leftline="true" width="40col%">
+<column alignment="block" valignment="top" leftline="true" rightline="true" width="60col%">
+<row topline="true" bottomline="true" endhead="true">
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 \begin_inset Text
 
 \layout Standard
 
+
+\series bold 
 Subject / Title
 \end_inset 
 </cell>
@@ -23106,7 +24413,9 @@ Subject / Title
 
 \layout Standard
 
-Where to get / filename
+
+\series bold 
+Filename / Where to get
 \end_inset 
 </cell>
 </row>
@@ -23125,6 +24434,22 @@ SDCC Compiler User Guide
 \layout Standard
 
 You're reading it right now
+\emph on 
+ \SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at:
+\emph default 
+
+\newline 
+
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/doc/sdccman.pdf}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23143,6 +24468,22 @@ Changelog of SDCC
 \layout Standard
 
 sdcc/Changelog
+\emph on 
+ \SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at:
+\emph default 
+
+\newline 
+
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/ChangeLog}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23162,7 +24503,9 @@ ASXXXX
 
 \end_inset 
 
- Assemblers and ASLINK
+ Assemblers and
+\newline 
+ASLINK
 \begin_inset LatexCommand \index{aslink}
 
 \end_inset 
@@ -23180,7 +24523,23 @@ ASXXXX
 
 \layout Standard
 
-sdcc/as/doc/asxhtm.html
+sdcc/as/doc/asxhtm.html 
+\emph on 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at:
+\emph default 
+
+\newline 
+
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/as/doc/asxhtm.html}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23203,7 +24562,23 @@ SDCC regression test
 
 \layout Standard
 
-sdcc/doc/test_suite_spec.pdf
+sdcc/doc/test_suite_spec.pdf 
+\emph on 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at:
+\emph default 
+
+\newline 
+
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/doc/test_suite_spec.pdf}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23221,7 +24596,23 @@ Various notes
 
 \layout Standard
 
-sdcc/doc/*
+sdcc/doc/* 
+\emph on 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at:
+\emph default 
+
+\newline 
+
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/sdcc/trunk/sdcc/doc/}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23231,8 +24622,8 @@ sdcc/doc/*
 
 \layout Standard
 
-Notes on debugging with sdcdb
-\begin_inset LatexCommand \index{sdcdb (debugger)}
+Notes on debugging with SDCDB
+\begin_inset LatexCommand \index{SDCDB (debugger)}
 
 \end_inset 
 
@@ -23244,7 +24635,23 @@ Notes on debugging with sdcdb
 
 \layout Standard
 
-sdcc/debugger/README
+sdcc/debugger/README 
+\emph on 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at
+\emph default 
+:
+\newline 
+
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/debugger/README}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23280,7 +24687,23 @@ sdcc/sim/ucsim/doc
 \bar default 
 \noun default 
 \color default
-/index.html
+/index.html 
+\emph on 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at:
+\emph default 
+
+\newline 
+
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/sim/ucsim/doc/index.html}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23303,7 +24726,23 @@ Temporary notes on the pic16
 
 \layout Standard
 
-sdcc/src/pic16/NOTES
+sdcc/src/pic16/NOTES 
+\emph on 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at:
+\newline 
+
+\emph default 
+
+\begin_inset LatexCommand \url{http://svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/src/pic16/NOTES}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23340,6 +24779,22 @@ cdbfileformat.pd
 \noun default 
 \color default
 f
+\emph on 
+ \SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+
+\hfill 
+online at:
+\emph default 
+
+\newline 
+
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/doc/cdbfileformat.pdf}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 </row>
@@ -23364,7 +24819,7 @@ Related open source tools
 
 
 \layout Standard
-\align center 
+\align left 
 
 \begin_inset  Tabular
 <lyxtabular version="3" rows="14" columns="3">
@@ -23378,6 +24833,8 @@ Related open source tools
 
 \layout Standard
 
+
+\series bold 
 Name
 \end_inset 
 </cell>
@@ -23386,6 +24843,8 @@ Name
 
 \layout Standard
 
+
+\series bold 
 Purpose
 \end_inset 
 </cell>
@@ -23394,6 +24853,8 @@ Purpose
 
 \layout Standard
 
+
+\series bold 
 Where to get
 \end_inset 
 </cell>
@@ -23515,7 +24976,7 @@ ec2drv/newcdb
 
 \layout Standard
 
-Tools for Silicon Laboratories JTAG debug adapter, partly based on sdcdb
+Tools for Silicon Laboratories JTAG debug adapter, partly based on SDCDB
  (Unix only)
 \end_inset 
 </cell>
@@ -23717,7 +25178,7 @@ kdevelop
 
 \layout Standard
 
-IDE (has anyone tried integrating SDCC & sdcdb? Unix only)
+IDE (has anyone tried integrating SDCC & SDCDB? Unix only)
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -23813,7 +25274,7 @@ Statically checks c sources (see
 \layout Standard
 
 ddd
-\begin_inset LatexCommand \index{ddd (debugger)}
+\begin_inset LatexCommand \index{DDD (debugger)}
 
 \end_inset 
 
@@ -23825,8 +25286,8 @@ ddd
 
 \layout Standard
 
-Debugger, serves nicely as GUI to sdcdb
-\begin_inset LatexCommand \index{sdcdb (debugger)}
+Debugger, serves nicely as GUI to SDCDB
+\begin_inset LatexCommand \index{SDCDB (debugger)}
 
 \end_inset 
 
@@ -23858,13 +25319,13 @@ Debugger, serves nicely as GUI to sdcdb
 
 Related documentation / recommended reading
 \layout Standard
-\align center 
+\align left 
 
 \begin_inset  Tabular
-<lyxtabular version="3" rows="8" columns="3">
+<lyxtabular version="3" rows="7" 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" width="0">
 <column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt">
 <row topline="true" bottomline="true">
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
@@ -23872,6 +25333,8 @@ Related documentation / recommended reading
 
 \layout Standard
 
+
+\series bold 
 Name
 \end_inset 
 </cell>
@@ -23880,6 +25343,8 @@ Name
 
 \layout Standard
 
+
+\series bold 
 Subject / Title
 \end_inset 
 </cell>
@@ -23888,6 +25353,8 @@ Subject / Title
 
 \layout Standard
 
+
+\series bold 
 Where to get
 \end_inset 
 </cell>
@@ -23951,7 +25418,12 @@ c-faq
 
 \layout Standard
 
-C-FAQ-list
+C-FAQ
+\begin_inset LatexCommand \index{C FAQ}
+
+\end_inset 
+
+
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -23960,7 +25432,7 @@ C-FAQ-list
 \layout Standard
 
 
-\begin_inset LatexCommand \url{http://www.eskimo.com/~scs/C-faq/top.html}
+\begin_inset LatexCommand \url{http://www.c-faq.com}
 
 \end_inset 
 
@@ -24063,7 +25535,7 @@ Extensions for Embedded C
 
 \layout Standard
 
-Latest datasheet of the target CPU
+Latest datasheet of target CPU
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -24075,7 +25547,7 @@ vendor
 \end_inset 
 </cell>
 </row>
-<row topline="true">
+<row topline="true" bottomline="true">
 <cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
 \begin_inset Text
 
@@ -24100,23 +25572,57 @@ vendor
 \end_inset 
 </cell>
 </row>
-<row topline="true" bottomline="true">
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
+</lyxtabular>
+
+\end_inset 
+
+
+\newline 
+
+\layout Section
 
+Application notes specifically for SDCC
 \layout Standard
 
-S.
- S.
- Muchnick
+SDCC makes no claims about the completeness of this list and about up-to-datenes
+s or correctness of the application notes
+\begin_inset LatexCommand \index{Application notes}
+
 \end_inset 
-</cell>
-<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
-\begin_inset Text
 
+.
 \layout Standard
+\align left 
 
-Advanced Compiler Design and Implementation
+\size footnotesize 
+
+\begin_inset  Tabular
+<lyxtabular version="3" rows="7" columns="3">
+<features>
+<column alignment="block" valignment="top" leftline="true" width="17col%">
+<column alignment="block" valignment="top" leftline="true" width="27col%">
+<column alignment="block" valignment="top" leftline="true" rightline="true" width="57col%">
+<row topline="true" bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\series bold 
+\size footnotesize 
+Vendor
+\end_inset 
+</cell>
+<cell alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\series bold 
+\size footnotesize 
+Subject / Title
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -24124,16 +25630,254 @@ Advanced Compiler Design and Implementation
 
 \layout Standard
 
-bookstore (very dedicated, probably read other books first)
+
+\series bold 
+\size footnotesize 
+Where to get
 \end_inset 
 </cell>
 </row>
-</lyxtabular>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
 
+\size footnotesize 
+Maxim / Dallas
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
+\layout Standard
+
+
+\size footnotesize 
+Using the SDCC Compiler for the DS80C400
+\begin_inset LatexCommand \index{DS80C400}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+
+\begin_inset LatexCommand \url{http://pdfserv.maxim-ic.com/en/an/AN3346.pdf}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Maxim / Dallas
+\end_inset 
+</cell>
+<cell multicolumn="1" alignment="left" valignment="top" topline="true" leftline="true" usebox="none" width="30line%">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Using the Free SDCC C Compiler to Develop Firmware for the DS89C420/430/440/450
+\begin_inset LatexCommand \index{DS89C4x0}
+
+\end_inset 
+
+ Family of Microcontrollers
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+
+\begin_inset LatexCommand \url{http://pdfserv.maxim-ic.com/en/an/AN3477.pdf}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Silicon Laboratories / Cygnal
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Integrating SDCC 8051 Tools Into The Silicon Labs IDE
+\begin_inset LatexCommand \index{IDE}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+
+\begin_inset LatexCommand \url{http://www.silabs.com/public/documents/tpub_doc/anote/Microcontrollers/en/an198.pdf}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Ramtron / Goal Semiconductor
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Interfacing SDCC to Syn and Textpad
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+
+\begin_inset LatexCommand \url{http://www.ramtron.com/doc/Products/Microcontroller/Support_Tools.asp}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Ramtron / Goal Semiconductor
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Installing and Configuring SDCC and Crimson Editor 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+
+\begin_inset LatexCommand \url{http://www.ramtron.com/doc/Products/Microcontroller/Support_Tools.asp}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+</row>
+<row topline="true" bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Texas Instruments
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+MSC12xx Programming with SDCC
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+
+\begin_inset LatexCommand \url{http://focus.ti.com/general/docs/lit/getliterature.tsp?literatureNumber=sbaa109&fileType=pdf}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset 
 
-\newline 
 
 \layout Section
 
@@ -24207,7 +25951,7 @@ Support
 
 SDCC has grown to be a large project.
  The compiler alone (without the preprocessor, assembler and linker) is
- well over 100,000 lines of code (blank stripped).
+ well over 150,000 lines of code (blank stripped).
  The open source nature of this project is a key to its continued growth
  and support.
  You gain the benefit and support of many active software developers and
@@ -24290,7 +26034,7 @@ status Collapsed
 \end_inset 
 
  option can sometimes be useful in locating optimization problems.
- When reporting a bug please maker sure you:
+ When reporting a bug please make sure you:
 \layout Enumerate
 
 Attach the code you are compiling with SDCC.
@@ -24335,21 +26079,44 @@ Please have a short check that you are using a recent version of SDCC and
 \end_inset 
 
 .
-\layout Section
-
-Requesting Features
-\begin_inset LatexCommand \label{sub:Requesting-Features}
+ With SDCC on average having more than 200 downloads
+\begin_inset LatexCommand \index{download}
 
 \end_inset 
 
+ on sourceforge per day
+\begin_inset Foot
+collapsed false
 
-\begin_inset LatexCommand \index{Feature request}
+\layout Standard
 
+220 daily downloads on average Jan-Sept 2006 and about 150 daily downloads
+ between 2002 and 2005.
+ This does not include other methods of distribution.
 \end_inset 
 
-
-\begin_inset LatexCommand \index{Requesting features}
-
+ there must be some users.
+ So it's not exactly easy to find a new bug.
+ If you find one we need it: 
+\emph on 
+reporting bugs is good
+\emph default 
+.
+\layout Section
+
+Requesting Features
+\begin_inset LatexCommand \label{sub:Requesting-Features}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Feature request}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Requesting features}
+
 \end_inset 
 
 
@@ -24490,7 +26257,7 @@ sdcc --version
 \series default 
  or the filenames of the snapshot versions of SDCC include date and its
  Subversion
-\begin_inset LatexCommand \index{Subversion}
+\begin_inset LatexCommand \index{Subversion code repository}
 
 \end_inset 
 
@@ -24505,8 +26272,13 @@ sdcc --version
  An on-line source code browser and detailled instructions are also available
  there.
  SDCC versions starting from 1999 up to now are available (currently the
- versions prior to the conversion from cvs to Subversion (April 2006) are
- either by accessible by Subversion or by cvs).
+ versions prior to the conversion from cvs
+\begin_inset LatexCommand \index{cvs|see{Subversion}}
+
+\end_inset 
+
+ to Subversion (April 2006) are either by accessible by Subversion or by
+ cvs).
 \layout Section
 
 Release policy
@@ -24535,6 +26307,22 @@ Historically there often were long delays between official releases and
 \end_inset 
 
 .
+ A release wiki
+\begin_inset LatexCommand \index{wiki}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Release wiki}
+
+\end_inset 
+
+ at 
+\begin_inset LatexCommand \url{http://sdcc.sf.net/release_wiki/}
+
+\end_inset 
+
+ also holds some information about past and future releases.
 \layout Section
 
 Examples
@@ -24580,6 +26368,11 @@ Maybe we should include some links to real world applications.
 \layout Section
 
 Quality control
+\begin_inset LatexCommand \label{sec:Quality-control}
+
+\end_inset 
+
+
 \begin_inset LatexCommand \index{Quality control}
 
 \end_inset 
@@ -24597,19 +26390,36 @@ regression tests
 
 \end_inset 
 
- check that SDCC itself compiles flawlessly on several platforms and checks
- the quality of the code generated by SDCC by running the code through simulator
-s.
- There is a separate document 
+ 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.
+ 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
+ (click on the red or green symbols on the right side of 
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
+
+\end_inset 
+
+).
+\layout Standard
+
+There is a separate document 
 \shape italic 
-test_suite.pdf
+test_suite.pdf 
 \begin_inset LatexCommand \index{Test suite}
 
 \end_inset 
 
 
 \shape default 
- about this.
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/doc/test_suite_spec.pdf}
+
+\end_inset 
+
+ about the regression test suite.
 \layout Standard
 
 You'll find the test code in the directory 
@@ -24650,8 +26460,12 @@ make test-mcs51
 .
 \layout Standard
 
-The pic port uses a different set of regression tests, you'll find them
- in the directory 
+The 14bit pic port uses a different set of regression tests 
+\begin_inset LatexCommand \index{Regression test (PIC14)}
+
+\end_inset 
+
+, you'll find them in the directory 
 \shape italic 
 sdcc/src/regression
 \shape default 
@@ -24748,7 +26562,7 @@ their
 \emph default 
  choice (among them Alpha, i386, i386_64, MacOs, Mips, Sparc, Windows and
  eventually 
-\begin_inset LatexCommand \url[OLPC]{http://wiki.laptop.org/wiki/One_Laptop_per_Child}
+\begin_inset LatexCommand \url[OLPC]{http://www.laptop.org}
 
 \end_inset 
 
@@ -27774,9 +29588,23 @@ status Collapsed
  command line option is specified.
 \layout Itemize
 
-structures and unions cannot be assigned values directly, cannot be passed
- as function parameters or assigned to each other and cannot be a return
- value from a function, e.g.:
+structures
+\begin_inset LatexCommand \index{struct}
+
+\end_inset 
+
+ and unions
+\begin_inset LatexCommand \index{union}
+
+\end_inset 
+
+ cannot be assigned values directly, cannot be passed as function parameters
+ or assigned to each other and cannot be a return value
+\begin_inset LatexCommand \index{return value}
+
+\end_inset 
+
+ from a function, e.g.:
 \begin_deeper 
 \layout Verse
 
@@ -27813,8 +29641,15 @@ s1 = s2 ; /* is invalid in SDCC although allowed in ANSI */
 \newline 
 }
 \newline 
-struct s foo1 (struct s parms) /* invalid in SDCC although allowed in ANSI
- */
+
+\series bold 
+struct
+\series default 
+ s foo1 (
+\series bold 
+struct
+\series default 
+ s parms) /* invalid in SDCC although allowed in ANSI */
 \newline 
 { 
 \newline 
@@ -27835,7 +29670,7 @@ struct s rets;
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-return rets;/* is invalid in SDCC although allowed in ANSI */ 
+return rets; /* is invalid in SDCC although allowed in ANSI */ 
 \newline 
 }
 \end_deeper 
@@ -27847,7 +29682,12 @@ initialization of structure arrays must be fully braced.
 
 
 \family typewriter 
-struct s { char x } a[] = {1, 2}; /* invalid in SDCC */
+struct s { char x } a[] = {1, 2};\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+/* invalid in SDCC */
 \newline 
 struct s { char x } a[] = {{1}, {2}}; /* OK */
 \end_deeper 
@@ -27915,9 +29755,21 @@ Most enhancements in C99 are not supported, f.e.:
 \family typewriter 
 \series bold 
 inline
+\begin_inset LatexCommand \index{inline (not supported)}
+
+\end_inset 
+
+
 \series default 
  int increment (int a) { return a+1; } /* is invalid in SDCC although allowed
- in C99 */
+ in C99.
+ An empty define 
+\emph on 
+#define inline
+\emph default 
+ can be used as a work around */
+\newline 
+
 \newline 
 for (
 \series bold 
@@ -28076,211 +29928,1909 @@ If loop optimizations caused any changes then do 'global subexpression eliminati
 on' and 'dead code elimination' again.
 \layout Itemize
 
-This phase determines the live-ranges; by live range I mean those iTemp
- variables defined by the compiler that still survive after all the optimization
-s.
- Live range analysis
-\begin_inset LatexCommand \index{Live range analysis}
+This phase determines the live-ranges; by live range I mean those iTemp
+ variables defined by the compiler that still survive after all the optimization
+s.
+ Live range analysis
+\begin_inset LatexCommand \index{Live range analysis}
+
+\end_inset 
+
+ is essential for register allocation, since these computation determines
+ which of these iTemps will be assigned to registers, and for how long.
+\layout Itemize
+
+Phase five is register allocation.
+ There are two parts to this process.
+\newline 
+
+\newline 
+The first part I call 'register packing' (for lack of a better term).
+ In this case several MCU specific expression folding is done to reduce
+ register pressure.
+\newline 
+
+\newline 
+The second part is more MCU independent and deals with allocating registers
+ to the remaining live ranges.
+ A lot of MCU specific code does creep into this phase because of the limited
+ number of index registers available in the 8051.
+\layout Itemize
+
+The Code generation phase is (unhappily), entirely MCU dependent and very
+ little (if any at all) of this code can be reused for other MCU.
+ However the scheme for allocating a homogenized assembler operand for each
+ iCode operand may be reused.
+\layout Itemize
+
+As mentioned in the optimization section the peep-hole optimizer is rule
+ based system, which can reprogrammed for other MCUs.
+\layout Standard
+
+More information is available in a 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}
+
+\end_inset 
+
+) and in the thread 
+\begin_inset LatexCommand \url{http://sf.net/mailarchive/message.php?msg_id=13954144}
+
+\end_inset 
+
+ .
+\layout Chapter
+
+Compiler internals
+\begin_inset LatexCommand \index{Compiler internals}
+
+\end_inset 
+
+
+\layout Section
+
+The anatomy of the compiler
+\begin_inset LatexCommand \label{sub:The-anatomy-of}
+
+\end_inset 
+
+
+\layout Standard
+
+
+\shape italic 
+This is an excerpt from an article published in Circuit Cellar Magazine
+ in 
+\series bold 
+August 2000
+\series default 
+.
+ It's a little outdated (the compiler is much more efficient now and user/develo
+per friendly), but pretty well exposes the guts of it all.
+\shape default 
+
+\newline 
+
+\newline 
+The current version of SDCC can generate code for Intel 8051 and Z80 MCU.
+ It is fairly easy to retarget for other 8-bit MCU.
+ Here we take a look at some of the internals of the compiler.
+\layout Paragraph*
+
+Parsing
+\begin_inset LatexCommand \index{Parsing}
+
+\end_inset 
+
+\layout Standard
+
+Parsing the input source file and creating an AST (Annotated Syntax Tree
+\begin_inset LatexCommand \index{Annotated syntax tree}
+
+\end_inset 
+
+).
+ This phase also involves propagating types (annotating each node of the
+ parse tree with type information) and semantic analysis.
+ There are some MCU specific parsing rules.
+ For example the storage classes, the extended storage classes are MCU specific
+ while there may be a xdata storage class for 8051 there is no such storage
+ class for z80 or Atmel AVR.
+ SDCC allows MCU specific storage class extensions, i.e.
+ xdata will be treated as a storage class specifier when parsing 8051 C
+ code but will be treated as a C identifier when parsing z80 or ATMEL AVR
+ C code.
+\layout Paragraph*
+
+Generating iCode
+\begin_inset LatexCommand \index{iCode}
+
+\end_inset 
+
+
+\layout Standard
+
+Intermediate code generation.
+ In this phase the AST is broken down into three-operand form (iCode).
+ These three operand forms are represented as doubly linked lists.
+ ICode is the term given to the intermediate form generated by the compiler.
+ ICode example section shows some examples of iCode generated for some simple
+ C source functions.
+\layout Paragraph*
+
+Optimizations
+\begin_inset LatexCommand \index{Optimizations}
+
+\end_inset 
+
+.
+\layout Standard
+
+Bulk of the target independent optimizations is performed in this phase.
+ The optimizations include constant propagation, common sub-expression eliminati
+on, loop invariant code movement, strength reduction of loop induction variables
+ and dead-code elimination.
+\layout Paragraph*
+
+Live range analysis
+\begin_inset LatexCommand \index{Live range analysis}
+
+\end_inset 
+
+
+\layout Standard
+
+During intermediate code generation phase, the compiler assumes the target
+ machine has infinite number of registers and generates a lot of temporary
+ variables.
+ The live range computation determines the lifetime of each of these compiler-ge
+nerated temporaries.
+ A picture speaks a thousand words.
+ ICode example sections show the live range annotations for each of the
+ operand.
+ It is important to note here, each iCode is assigned a number in the order
+ of its execution in the function.
+ The live ranges are computed in terms of these numbers.
+ The from number is the number of the iCode which first defines the operand
+ and the to number signifies the iCode which uses this operand last.
+\layout Paragraph*
+
+Register Allocation
+\begin_inset LatexCommand \index{Register allocation}
+
+\end_inset 
+
+
+\layout Standard
+
+The register allocation determines the type and number of registers needed
+ by each operand.
+ In most MCUs only a few registers can be used for indirect addressing.
+ In case of 8051 for example the registers R0 & R1 can be used to indirectly
+ address the internal ram and DPTR to indirectly address the external ram.
+ The compiler will try to allocate the appropriate register to pointer variables
+ if it can.
+ ICode example section shows the operands annotated with the registers assigned
+ to them.
+ The compiler will try to keep operands in registers as much as possible;
+ there are several schemes the compiler uses to do achieve this.
+ When the compiler runs out of registers the compiler will check to see
+ if there are any live operands which is not used or defined in the current
+ basic block being processed, if there are any found then it will push that
+ operand and use the registers in this block, the operand will then be popped
+ at the end of the basic block.
+\layout Standard
+
+There are other MCU specific considerations in this phase.
+ Some MCUs have an accumulator; very short-lived operands could be assigned
+ to the accumulator instead of a general-purpose register.
+\layout Paragraph*
+
+Code generation
+\layout Standard
+
+Figure II gives a table of iCode
+\begin_inset LatexCommand \index{iCode}
+
+\end_inset 
+
+ operations supported by the compiler.
+ The code generation involves translating these operations into corresponding
+ assembly code for the processor.
+ This sounds overly simple but that is the essence of code generation.
+ Some of the iCode operations are generated on a MCU specific manner for
+ example, the z80 port does not use registers to pass parameters so the
+ SEND and RECV iCode operations will not be generated, and it also does
+ not support JUMPTABLES.
+\newline 
+
+\layout Standard
+
+
+\size footnotesize 
+Figure II 
+\begin_inset  Tabular
+<lyxtabular version="3" rows="39" columns="4">
+<features islongtable="true" headBottomDL="true">
+<column alignment="block" valignment="top" leftline="true" width="13col%">
+<column alignment="left" valignment="top" leftline="true" width="13col%">
+<column alignment="block" valignment="top" leftline="true" width="22col%">
+<column alignment="block" valignment="top" leftline="true" rightline="true" width="40col%">
+<row topline="true" bottomline="true" endhead="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\series bold 
+iCode
+\series default 
+
+\begin_inset LatexCommand \index{iCode}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\series bold 
+Operands
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\series bold 
+Description
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\series bold 
+C Equivalent
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'!'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+NOT operation 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = ! IC_LEFT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'~'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Bitwise complement of 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = ~IC_LEFT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+RRC
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Rotate right with carry
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = (IC_LEFT << 1) | (IC_LEFT >> (sizeof(IC_LEFT)*8-1));
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+RLC
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Rotate left with carry
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = (IC_LEFT << (sizeof(LC_LEFT)*8-1) ) | (IC_LEFT >> 1);
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+GETHBIT
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Get the highest order bit of IC_LEFT
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = (IC_LEFT >> (sizeof(IC_LEFT)*8 -1));
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+UNARYMINUS
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Unary minus
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = - IC_LEFT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IPUSH
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Push the operand into stack
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+NONE
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IPOP
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Pop the operand from the stack 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+NONE
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+CALL
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Call the function represented by IC_LEFT 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT();
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+PCALL
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Call via function pointer
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = (*IC_LEFT)();
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+RETURN
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Return the value in operand IC_LEFT 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+return IC_LEFT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+LABEL
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LABEL() 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Label
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LABEL:
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+GOTO
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LABEL() 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Goto label
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+goto IC_LABEL();
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'+'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Addition
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT + IC_RIGHT
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'-'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Subtraction
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT - IC_RIGHT 
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'*'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Multiplication 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT * IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'/'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Division
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT / IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'%'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Modulus
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT % IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'<'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Less than
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT < IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'>'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Greater than 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT > IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+EQ_OP
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Equal to 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT == IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+AND_OP
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT() 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Logical and operation
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT && IC_RIGHT; 
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+OR_OP
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT() 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Logical or operation 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT || IC_RIGHT; 
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'^'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT() 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Exclusive OR
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT ^ IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'|'
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT() 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Bitwise OR 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT | IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+BITWISEAND
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Bitwise AND 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT & IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+LEFT_OP
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Left shift 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT << IC_RIGHT 
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+RIGHT_OP
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Right shift
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_LEFT >> IC_RIGHT 
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+GET_VALUE_
+\newline 
+AT_ ADDRESS
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Indirect fetch 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = (*IC_LEFT);
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+POINTER_SET
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RIGHT() IC_RESULT() 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Indirect set
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+(*IC_RESULT) = IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+'='
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RIGHT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Assignment
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IFX
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_COND IC_TRUE IC_LABEL
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Conditional jump.
+ If true label is present then jump to true label if condition is true else
+ jump to false label if condition is false 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+if (IC_COND) goto IC_TRUE; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+Or 
+\newline 
+If (!IC_COND) goto IC_FALSE;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+ADDRESS_OF
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_LEFT() IC_RESULT()
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Address of 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_RESULT = &IC_LEFT();
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+JUMPTABLE
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+IC_JTCOND IC_JTLABELS
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Jump to list of labels depending on the value of JTCOND
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+Switch statement
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+
+\size footnotesize 
+CAST
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
 
+\size footnotesize 
+IC_RIGHT() IC_LEFT() IC_RESULT()
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
- is essential for register allocation, since these computation determines
- which of these iTemps will be assigned to registers, and for how long.
-\layout Itemize
+\layout Standard
 
-Phase five is register allocation.
- There are two parts to this process.
-\newline 
 
-\newline 
-The first part I call 'register packing' (for lack of a better term).
- In this case several MCU specific expression folding is done to reduce
- register pressure.
-\newline 
+\size footnotesize 
+Cast types 
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-\newline 
-The second part is more MCU independent and deals with allocating registers
- to the remaining live ranges.
- A lot of MCU specific code does creep into this phase because of the limited
- number of index registers available in the 8051.
-\layout Itemize
+\layout Standard
 
-The Code generation phase is (unhappily), entirely MCU dependent and very
- little (if any at all) of this code can be reused for other MCU.
- However the scheme for allocating a homogenized assembler operand for each
- iCode operand may be reused.
-\layout Itemize
 
-As mentioned in the optimization section the peep-hole optimizer is rule
- based system, which can reprogrammed for other MCUs.
-\layout Chapter
+\size footnotesize 
+IC_RESULT = (typeof IC_LEFT) IC_RIGHT;
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-Compiler internals
-\begin_inset LatexCommand \index{Compiler internals}
+\layout Standard
 
-\end_inset 
 
+\size footnotesize 
+SEND
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-\layout Section
+\layout Standard
 
-The anatomy of the compiler
-\begin_inset LatexCommand \label{sub:The-anatomy-of}
 
+\size footnotesize 
+IC_LEFT()
 \end_inset 
-
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
 \layout Standard
 
 
-\shape italic 
-This is an excerpt from an article published in Circuit Cellar Magazine
- in 
-\series bold 
-August 2000
-\series default 
-.
- It's a little outdated (the compiler is much more efficient now and user/develo
-per friendly), but pretty well exposes the guts of it all.
-\shape default 
-
+\size footnotesize 
+This is used for passing parameters in registers; 
 \newline 
+move IC_LEFT to the next available parameter register.
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-\newline 
-The current version of SDCC can generate code for Intel 8051 and Z80 MCU.
- It is fairly easy to retarget for other 8-bit MCU.
- Here we take a look at some of the internals of the compiler.
-\layout Paragraph*
+\layout Standard
 
-Parsing
-\begin_inset LatexCommand \index{Parsing}
 
+\size footnotesize 
+None
 \end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
 \layout Standard
 
-Parsing the input source file and creating an AST (Annotated Syntax Tree
-\begin_inset LatexCommand \index{Annotated syntax tree}
 
+\size footnotesize 
+RECV
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
-).
- This phase also involves propagating types (annotating each node of the
- parse tree with type information) and semantic analysis.
- There are some MCU specific parsing rules.
- For example the storage classes, the extended storage classes are MCU specific
- while there may be a xdata storage class for 8051 there is no such storage
- class for z80 or Atmel AVR.
- SDCC allows MCU specific storage class extensions, i.e.
- xdata will be treated as a storage class specifier when parsing 8051 C
- code but will be treated as a C identifier when parsing z80 or ATMEL AVR
- C code.
-\layout Paragraph*
+\layout Standard
 
-Generating iCode
-\begin_inset LatexCommand \index{iCode}
 
+\size footnotesize 
+IC_RESULT()
 \end_inset 
-
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
 \layout Standard
 
-Intermediate code generation.
- In this phase the AST is broken down into three-operand form (iCode).
- These three operand forms are represented as doubly linked lists.
- ICode is the term given to the intermediate form generated by the compiler.
- ICode example section shows some examples of iCode generated for some simple
- C source functions.
-\layout Paragraph*
-
-Optimizations
-\begin_inset LatexCommand \index{Optimizations}
 
+\size footnotesize 
+This is used for receiving parameters passed in registers;
+\newline 
+Move the values in the next parameter register to IC_RESULT 
 \end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-.
 \layout Standard
 
-Bulk of the target independent optimizations is performed in this phase.
- The optimizations include constant propagation, common sub-expression eliminati
-on, loop invariant code movement, strength reduction of loop induction variables
- and dead-code elimination.
-\layout Paragraph*
-
-Live range analysis
-\begin_inset LatexCommand \index{Live range analysis}
 
+\size footnotesize 
+None
 \end_inset 
-
+</cell>
+</row>
+<row topline="true" bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
 \layout Standard
 
-During intermediate code generation phase, the compiler assumes the target
- machine has infinite number of registers and generates a lot of temporary
- variables.
- The live range computation determines the lifetime of each of these compiler-ge
-nerated temporaries.
- A picture speaks a thousand words.
- ICode example sections show the live range annotations for each of the
- operand.
- It is important to note here, each iCode is assigned a number in the order
- of its execution in the function.
- The live ranges are computed in terms of these numbers.
- The from number is the number of the iCode which first defines the operand
- and the to number signifies the iCode which uses this operand last.
-\layout Paragraph*
-
-Register Allocation
-\begin_inset LatexCommand \index{Register allocation}
 
+\shape slanted 
+\size footnotesize 
+(some more have been added)
 \end_inset 
-
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
 
 \layout Standard
 
-The register allocation determines the type and number of registers needed
- by each operand.
- In most MCUs only a few registers can be used for indirect addressing.
- In case of 8051 for example the registers R0 & R1 can be used to indirectly
- address the internal ram and DPTR to indirectly address the external ram.
- The compiler will try to allocate the appropriate register to pointer variables
- if it can.
- ICode example section shows the operands annotated with the registers assigned
- to them.
- The compiler will try to keep operands in registers as much as possible;
- there are several schemes the compiler uses to do achieve this.
- When the compiler runs out of registers the compiler will check to see
- if there are any live operands which is not used or defined in the current
- basic block being processed, if there are any found then it will push that
- operand and use the registers in this block, the operand will then be popped
- at the end of the basic block.
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
 \layout Standard
 
-There are other MCU specific considerations in this phase.
- Some MCUs have an accumulator; very short-lived operands could be assigned
- to the accumulator instead of a general-purpose register.
-\layout Paragraph*
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
 
-Code generation
 \layout Standard
 
-Figure II gives a table of iCode operations supported by the compiler.
- The code generation involves translating these operations into corresponding
- assembly code for the processor.
- This sounds overly simple but that is the essence of code generation.
- Some of the iCode operations are generated on a MCU specific manner for
- example, the z80 port does not use registers to pass parameters so the
- SEND and RECV iCode operations will not be generated, and it also does
- not support JUMPTABLES.
+
+\shape slanted 
+\size footnotesize 
+see f.e.
  
-\newline 
+\family typewriter 
+gen51Code()
+\family default 
+ in 
+\family typewriter 
+src/mcs51/gen.c
+\end_inset 
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset 
+
 
-\series bold 
-\shape italic 
-\color red
-<Where is Figure II?>
 \layout Comment
 
 In the original article Figure II was announced to be downloadable on 
@@ -28288,8 +31838,7 @@ In the original article Figure II was announced to be downloadable on
 Circuit Cellar
 \shape default 
 's web site.
- Unfortunately it never seemed to have shown up there, so: where is Figure
- II?
+ ftp://ftp.circuitcellar.com/pub/Circuit_Cellar/2000/121/dutta.ZIP
 \layout Paragraph*
 
 ICode Example
@@ -29556,6 +33105,38 @@ Thanks to all the other volunteer developers who have helped with coding,
 
 \newline 
 
+\newline 
+
+\emph on 
+Also 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
+
+\layout Standard
+$10^{13}$
+\end_inset 
+
+CPU cycles per day.
+\newline 
+\begin_inset Note
+collapsed false
+
+\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_inset 
+
+
 \layout Standard
 
 This document was initially written by Sandeep Dutta