git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4106 4a8a32a2...
[fw/sdcc] / doc / sdccman.lyx
index 679cb0a17d946f55a10dd41d9d2aad70f92ddbe7..84c8c85a08a2223862584c4cf1fbf49d0ae69973 100644 (file)
@@ -2,14 +2,13 @@
 \lyxformat 221
 \textclass book
 \begin_preamble
-
-
+\pdfoptionpdfminorversion=3
 \usepackage[
   pdftitle={SDCC Compiler User Guide},
   pdfauthor={SDCC development team},
   pdfsubject={installation, user manual},
-  pdfkeywords={8032, 8051, ansi, c, compiler, CPU, DS390, 
-               embedded, GPL, HC08, manual, mcs51, PIC, Z80},
+  pdfkeywords={8032 8051 ansi c compiler CPU DS390
+               embedded GPL HC08 manual mcs51 microcontroller PIC Z80},
   colorlinks=true,
   linkcolor=blue] {hyperref}
 %
@@ -83,7 +82,7 @@ SDCC Compiler User Guide
 
 
 \size normal 
-SDCC 2.5.0
+SDCC 2.5.5
 \size footnotesize 
 
 \newline 
@@ -92,7 +91,7 @@ $Date$
 $Revision$
 \layout Comment
 
-The above strings enclosed in $ are automatically updated by cvs
+The above strings enclosed in $ are automatically updated by Subversion
 \layout Standard
 
 
@@ -246,6 +245,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.
  
 \newline 
 
@@ -350,6 +350,11 @@ italic.
 \layout Section
 
 Compatibility with previous versions
+\begin_inset LatexCommand \index{Compatibility with previous versions}
+
+\end_inset 
+
+
 \layout Standard
 
 This version has numerous bug fixes compared with the previous version.
@@ -438,10 +443,40 @@ status Collapsed
 -stack-after-data has been removed.
 \layout Itemize
 
-bit and sbit types now consistently behave like the C99 _Bool type with
- respect to type conversion.
+bit
+\begin_inset LatexCommand \index{bit}
+
+\end_inset 
+
+ and sbit
+\begin_inset LatexCommand \index{sbit}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_sbit}
+
+\end_inset 
+
+ types now consistently behave like the C99 _Bool type with respect to type
+ conversion
+\begin_inset LatexCommand \index{type conversion}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{type promotion}
+
+\end_inset 
+
+.
  The most common incompatibility resulting from this change is related to
- bit toggling idioms, e.g.:
+ bit toggling
+\begin_inset LatexCommand \index{Bit toggling}
+
+\end_inset 
+
+ idioms, e.g.:
 \newline 
 
 \family typewriter 
@@ -502,7 +537,8 @@ The SDCC home page at
  Some of the other tools (simulator and assembler) included with SDCC contain
  their own documentation and can be found in the source distribution.
  If you want the latest unreleased software, the complete source package
- is available directly by anonymous CVS on cvs.sdcc.sourceforge.net.
+ is available directly from Subversion on https://svn.sourceforge.net/svnroot/sdcc
+/trunk/sdcc.
 \layout Section
 
 Wishes for the future
@@ -523,8 +559,8 @@ char KernelFunction3(char p) at 0x340;
 
 
 \family typewriter 
-code banking
-\begin_inset LatexCommand \index{code banking (not supported)}
+better code banking
+\begin_inset LatexCommand \index{code banking (limited support)}
 
 \end_inset 
 
@@ -2889,7 +2925,7 @@ Building SDCC on Linux
 \series medium 
 Download the source package
 \series default 
- either from the SDCC CVS repository or from the nightly snapshots
+ either from the SDCC Subversion repository or from the nightly snapshots
 \series medium 
 , it will be named something like sdcc
 \series default 
@@ -3093,7 +3129,7 @@ less ; not really needed for building SDCC, but you'll miss it sooner or
  later
 \layout Itemize
 
-cvs ; only if you use CVS access
+svn ; only if you use Subversion access
 \layout Standard
 
 If you want to develop something you'll need:
@@ -3201,7 +3237,7 @@ Building SDCC Using Microsoft Visual C++ 6.0/NET (MSVC)
 \series medium 
 Download the source package
 \series default 
- either from the SDCC CVS repository or from the 
+ either from the SDCC Subversion repository or from the 
 \begin_inset LatexCommand \url[nightly snapshots]{http://sdcc.sourceforge.net/snap.php}
 
 \end_inset 
@@ -3234,8 +3270,10 @@ bin before running SDCC.
 \newline 
 WARNING: Visual studio is very picky with line terminations; it expects
  the 0x0d, 0x0a DOS style line endings, not the 0x0a Unix style line endings.
- If you are getting a message such as "This makefile was not generated by
- Developer Studio etc.
+ When using the Subversion repository it's easiest to configure the svn
+ client to convert automatically for you.
+ If however you are getting a message such as "This makefile was not generated
+ by Developer Studio etc.
  etc.
 \begin_inset Quotes srd
 \end_inset 
@@ -3456,16 +3494,11 @@ del /s *.obj *.lib *.rul
  from the sdcc directory.
 \layout Subsection
 
-Windows Install Using a Binary Package
-\begin_inset LatexCommand \label{sub:Windows-Install}
-
-\end_inset 
-
-
+Windows Install Using a ZIP Package
 \layout Enumerate
 
-Download the binary package from 
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
+Download the binary zip package from 
+\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
 
 \end_inset 
 
@@ -3489,6 +3522,38 @@ lib for the include and libraries.
 
 Adjust your environment variable PATH to include the location of the bin
  directory or start sdcc using the full path.
+\layout Subsection
+
+Windows Install Using the Setup Program
+\begin_inset LatexCommand \label{sub:Windows-Install}
+
+\end_inset 
+
+
+\layout Standard
+
+Download the setup program 
+\emph on 
+sdcc-x.y.z-setup.exe
+\emph default 
+ for an official release from 
+\newline 
+
+\begin_inset LatexCommand \url{http://sf.net/project/showfiles.php?group_id=599}
+
+\end_inset 
+
+ or a setup program for one of the snapshots 
+\emph on 
+sdcc_yyyymmdd_setup.exe
+\emph default 
+ from 
+\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
+
+\end_inset 
+
+ and execute it.
+ A windows typical installer will guide you through the installation process.
 \layout Section
 
 Building the Documentation
@@ -3513,13 +3578,13 @@ make
  You're invited to make changes and additions to this manual (sdcc/doc/sdccman.ly
 x).
  Using LyX 
-\begin_inset LatexCommand \url{www.lyx.org}
+\begin_inset LatexCommand \url{http://www.lyx.org}
 
 \end_inset 
 
  as editor this is straightforward.
  Prebuilt documentation in html and pdf format is available from 
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
+\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
 
 \end_inset 
 
@@ -3541,8 +3606,28 @@ If you should know why please drop us a note
 \end_inset 
 
 .
- You'll find the pdf version at 
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/doc/sdccman.pdf}
+\newline 
+You'll find the pdf version
+\begin_inset LatexCommand \index{PDF version of this document}
+
+\end_inset 
+
+ at 
+\begin_inset LatexCommand \url{http://sdcc.sf.net/doc/sdccman.pdf}
+
+\end_inset 
+
+.
+\newline 
+A html version
+\begin_inset LatexCommand \index{HTML version of this document}
+
+\end_inset 
+
+ should be online at 
+\begin_inset LatexCommand \url{http://sdcc.sf.net/doc/sdccman.html/index.html}
 
 \end_inset 
 
@@ -3568,7 +3653,7 @@ There are many references pointing away from this documentation.
  Don't let this distract you.
  If there f.e.
  was a reference like 
-\begin_inset LatexCommand \url{www.opencores.org}
+\begin_inset LatexCommand \url{http://www.opencores.org}
 
 \end_inset 
 
@@ -3593,11 +3678,30 @@ ate
 a
 \emph default 
 rray
-\begin_inset LatexCommand \index{fpga (field programmable gate array)}
+\begin_inset LatexCommand \index{FPGA (field programmable gate array)}
+
+\end_inset 
+
+
+\begin_inset Quotes srd
+\end_inset 
+
+ or 
+\begin_inset LatexCommand \url{http://sf.net/projects/fpgac}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{FpgaC ((subset of) C to FPGA compiler)}
 
 \end_inset 
 
+\begin_inset Quotes sld
+\end_inset 
 
+have you ever heard of an open source compiler that compiles a subset of
+ C for an FPGA?
 \begin_inset Quotes srd
 \end_inset 
 
@@ -4037,9 +4141,11 @@ 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.
@@ -4113,12 +4219,7 @@ S51
 
 \end_inset 
 
- is a freeware, opensource simulator developed by Daniel Drotos (
-\begin_inset LatexCommand \url{mailto:drdani@mazsola.iit.uni-miskolc.hu}
-
-\end_inset 
-
-).
+ is a freeware, opensource simulator developed by Daniel Drotos.
  The simulator is built as part of the build process.
  For more information visit Daniel's web site at: 
 \begin_inset LatexCommand \url{http://mazsola.iit.uni-miskolc.hu/~drdani/embedded/s51}
@@ -4128,6 +4229,7 @@ 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
@@ -4151,7 +4253,7 @@ Sdcdb
 \end_inset 
 
 , but can be easily changed to use other simulators.
+ Sdcdb is currently not available on Win32 platfors.
 \layout Chapter
 
 Using SDCC
@@ -4315,13 +4417,13 @@ objdump
 \family default 
 \shape default 
 
-\begin_inset LatexCommand \index{srecord (tool)}
+\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
 
 \end_inset 
 
 ).
  Both formats are documented in the documentation of srecord
-\begin_inset LatexCommand \index{srecord (tool)}
+\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
 
 \end_inset 
 
@@ -4368,7 +4470,7 @@ status Collapsed
 \end_inset 
 
 -debug) containing debug information.
- The format is documented in cdbfileformat.pdf.
+ The format is documented in cdbfileformat.pdf
 \layout Itemize
 
 sourcefile.
@@ -5079,13 +5181,13 @@ Processor Selection Options
 \end_inset 
 
  processor (In development, not complete).
- AVR users should probably have a look at avr-gcc 
-\begin_inset LatexCommand \url{ http://savannah.nongnu.org/download/avr-libc/snapshots/}
+ AVR users should probably have a look at winavr 
+\begin_inset LatexCommand \url{http://sourceforge.net/projects/winavr}
 
 \end_inset 
 
- or winavr 
-\begin_inset LatexCommand \url{http://winavr.sourceforge.net}
+ or 
+\begin_inset LatexCommand \url{http://www.avrfreaks.net/index.php?name=PNphpBB2&file=index}
 
 \end_inset 
 
@@ -5634,8 +5736,7 @@ status Collapsed
 \end_inset 
 
  option (which is now a default setting) will override this setting, so
- you should also specify the .
+ you should also specify the 
 \series bold 
 -
 \begin_inset ERT
@@ -5660,6 +5761,61 @@ status Collapsed
 \labelwidthstring 00.00.0000
 
 
+\series bold 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-xstack-loc
+\series default 
+
+\begin_inset LatexCommand \index{-\/-xstack-loc <Value>}
+
+\end_inset 
+
+\SpecialChar ~
+<Value> By default the external stack
+\begin_inset LatexCommand \index{xstack}
+
+\end_inset 
+
+ is placed after the pdata 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.
+ -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-xstack-loc 0x8000 or -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-stack-loc 32768.
+ The provided value should not overlap any other memory areas such as the
+ pdata or xdata segment and with enough space for the current application.
+\layout List
+\labelwidthstring 00.00.0000
+
+
 \series bold 
 -
 \begin_inset ERT
@@ -5836,7 +5992,7 @@ The linker output (final object code) is in Intel Hex format.
 
  This is the default option.
  The format itself is documented in the documentation of srecord
-\begin_inset LatexCommand \index{srecord (tool)}
+\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
 
 \end_inset 
 
@@ -5968,6 +6124,33 @@ Generate code for Small Model programs, see section Memory Models for more
 \labelwidthstring 00.00.0000
 
 
+\series bold 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-model-medium
+\begin_inset LatexCommand \index{-\/-model-medium}
+
+\end_inset 
+
+
+\series default 
+ Generate code for Medium model programs, see section Memory Models for
+ more details.
+ If this option is used all source files in the project have to be compiled
+ with this option.
+ It must also be used when invoking the linker.
+\layout List
+\labelwidthstring 00.00.0000
+
+
 \series bold 
 -
 \begin_inset ERT
@@ -5990,6 +6173,7 @@ status Collapsed
  details.
  If this option is used all source files in the project have to be compiled
  with this option.
+ It must also be used when invoking the linker.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -6514,7 +6698,20 @@ status Collapsed
 \series default 
  Will not do global subexpression elimination, this option may be used when
  the compiler creates undesirably large stack/data spaces to store compiler
- temporaries.
+ temporaries (
+\emph on 
+s
+\emph default 
+pill 
+\emph on 
+loc
+\emph default 
+ations, sloc
+\begin_inset LatexCommand \index{sloc (spill location)}
+
+\end_inset 
+
+).
  A warning message will be generated when this happens and the compiler
  will indicate the number of extra bytes it allocated.
  It is recommended that this option NOT be used, #pragma\SpecialChar ~
@@ -6723,7 +6920,12 @@ status Collapsed
 
 \series default 
  Will not memcpy initialized data from code space into xdata space.
- This saves a few bytes in code space if you don't have initialized data.
+ This saves a few bytes in code space if you don't have initialized data
+\begin_inset LatexCommand \index{Variable initialization}
+
+\end_inset 
+
+.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -7483,13 +7685,6 @@ status Collapsed
 \end_inset 
 
  (jwk burps: please be more specific here, please!).
- If you want rather more than less warnings you should consider using a
- separate tool dedicated to syntax checking like splint 
-\begin_inset LatexCommand \url{www.splint.org}
-
-\end_inset 
-
-.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -7609,7 +7804,7 @@ asmOption[,asmOption]
 \end_inset 
 
 .
- See file sdcc/as/doc/asxhtm.html for assembler options.
+ See file sdcc/as/doc/asxhtm.html for assembler options.cd
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -7706,49 +7901,6 @@ status Collapsed
 \series default 
  Follow the C99 standard and disable SDCC features that conflict with the
  standard (incomplete support).
-\layout Subsection
-
-Intermediate Dump Options
-\begin_inset LatexCommand \label{sub:Intermediate-Dump-Options}
-
-\end_inset 
-
-
-\begin_inset LatexCommand \index{Options intermediate dump}
-
-\end_inset 
-
-
-\begin_inset LatexCommand \index{Intermediate dump options}
-
-\end_inset 
-
-
-\layout Standard
-
-The following options are provided for the purpose of retargetting and debugging
- the compiler.
- These provided a means to dump the intermediate code (iCode
-\begin_inset LatexCommand \index{iCode}
-
-\end_inset 
-
-) generated by the compiler in human readable form at various stages of
- the compilation process.
- More on iCodes see chapter 
-\begin_inset LatexCommand \ref{sub:The-anatomy-of}
-
-\end_inset 
-
-\begin_inset Quotes srd
-\end_inset 
-
-The anatomy of the compiler
-\begin_inset Quotes srd
-\end_inset 
-
-.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -7764,27 +7916,25 @@ status Collapsed
 /
 \end_inset 
 
--dumpraw
-\begin_inset LatexCommand \index{-\/-dumpraw}
+-codeseg
+\series default 
 
-\end_inset 
+\begin_inset LatexCommand \index{-\/-codeseg <Value>}
 
+\end_inset 
 
-\series default 
- This option will cause the compiler to dump the intermediate code into
- a file of named 
-\emph on 
-<source filename>.dumpraw
-\emph default 
- just after the intermediate code has been generated for a function, i.e.
- before any optimizations are done.
- The basic blocks
-\begin_inset LatexCommand \index{Basic blocks}
+\SpecialChar ~
+<Name> The name to be used for the code
+\begin_inset LatexCommand \index{code}
 
 \end_inset 
 
- at this stage ordered in the depth first number, so they may not be in
- sequence of execution.
+ segment, default CSEG.
+ This is useful if you need to tell the compiler to put the code in a special
+ segment so you can later on tell the linker to put this segment in a special
+ place in memory.
+ Can be used for instance when using bank switching to put the code in a
+ bank.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -7800,21 +7950,231 @@ status Collapsed
 /
 \end_inset 
 
--dumpgcse
-\begin_inset LatexCommand \index{-\/-dumpgcse}
+-constseg
+\series default 
 
-\end_inset 
+\begin_inset LatexCommand \index{-\/-constseg <Value>}
 
+\end_inset 
 
-\series default 
- Will create a dump of iCode's, after global subexpression elimination
-\begin_inset LatexCommand \index{Global subexpression elimination}
+\SpecialChar ~
+<Name> The name to be used for the const
+\begin_inset LatexCommand \index{code}
 
 \end_inset 
 
-, into a file named 
-\emph on 
-<source filename>.dumpgcse.
+ segment, default CONST.
+ This is useful if you need to tell the compiler to put the const data in
+ a special segment so you can later on tell the linker to put this segment
+ in a special place in memory.
+ Can be used for instance when using bank switching to put the const data
+ in a bank.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold 
+more-pedantic
+\series default 
+ Actually this is 
+\series bold 
+\emph on 
+not
+\series default 
+\emph default 
+ a SDCC compiler option but if you want 
+\emph on 
+more
+\emph default 
+ warnings you can use a separate tool dedicated to syntax checking like
+ splint
+\begin_inset LatexCommand \label{lyx:more-pedantic-SPLINT}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{lint (syntax checking tool)}
+
+\end_inset 
+
+\begin_inset LatexCommand \url{http://www.splint.org}
+
+\end_inset 
+
+.
+ To make your source files parseable by splint you will have to include
+\family sans 
+lint.h
+\family default 
+
+\begin_inset LatexCommand \index{splint (syntax checking tool)}
+
+\end_inset 
+
+ in your source file and add brackets around extended keywords (like 
+\family sans 
+
+\begin_inset Quotes sld
+\end_inset 
+
+__at\SpecialChar ~
+
+\series bold 
+(
+\series default 
+0xab
+\series bold 
+)
+\series default 
+
+\begin_inset Quotes srd
+\end_inset 
+
+
+\family default 
+ and 
+\family sans 
+
+\begin_inset Quotes sld
+\end_inset 
+
+__interrupt\SpecialChar ~
+(2)
+\begin_inset Quotes srd
+\end_inset 
+
+
+\family default 
+).
+\newline 
+Splint has an excellent on line manual at 
+\begin_inset LatexCommand \url{http://www.splint.org/manual/}
+
+\end_inset 
+
+ and it's capabilities go beyond pure syntax checking.
+ You'll need to tell splint the location of SDCC's include files so a typical
+ command line could look like this: 
+\newline 
+
+\family sans 
+splint\SpecialChar ~
+-I\SpecialChar ~
+/usr/local/share/sdcc/include/mcs51/\SpecialChar ~
+\SpecialChar ~
+myprogram.c
+\layout Subsection
+
+Intermediate Dump Options
+\begin_inset LatexCommand \label{sub:Intermediate-Dump-Options}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Options intermediate dump}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Intermediate dump options}
+
+\end_inset 
+
+
+\layout Standard
+
+The following options are provided for the purpose of retargetting and debugging
+ the compiler.
+ They provide a means to dump the intermediate code (iCode
+\begin_inset LatexCommand \index{iCode}
+
+\end_inset 
+
+) generated by the compiler in human readable form at various stages of
+ the compilation process.
+ More on iCodes see chapter 
+\begin_inset LatexCommand \ref{sub:The-anatomy-of}
+
+\end_inset 
+
+\begin_inset Quotes srd
+\end_inset 
+
+The anatomy of the compiler
+\begin_inset Quotes srd
+\end_inset 
+
+.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-dumpraw
+\begin_inset LatexCommand \index{-\/-dumpraw}
+
+\end_inset 
+
+
+\series default 
+ This option will cause the compiler to dump the intermediate code into
+ a file of named 
+\emph on 
+<source filename>.dumpraw
+\emph default 
+ just after the intermediate code has been generated for a function, i.e.
+ before any optimizations are done.
+ The basic blocks
+\begin_inset LatexCommand \index{Basic blocks}
+
+\end_inset 
+
+ at this stage ordered in the depth first number, so they may not be in
+ sequence of execution.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-dumpgcse
+\begin_inset LatexCommand \index{-\/-dumpgcse}
+
+\end_inset 
+
+
+\series default 
+ Will create a dump of iCode's, after global subexpression elimination
+\begin_inset LatexCommand \index{Global subexpression elimination}
+
+\end_inset 
+
+, into a file named 
+\emph on 
+<source filename>.dumpgcse.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -8294,6 +8654,11 @@ In addition to the ANSI storage classes SDCC allows the following MCS51
 data
 \begin_inset LatexCommand \index{data (mcs51, ds390 storage class)}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_data (mcs51, ds390 storage class)}
+
 \end_inset 
 
  / near
@@ -8302,6 +8667,11 @@ data
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_near (storage class)}
+
+\end_inset 
+
+
 \layout Standard
 
 This is the 
@@ -8342,6 +8712,11 @@ _test_data,#0x01
 xdata
 \begin_inset LatexCommand \index{xdata (mcs51, ds390 storage class)}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_xdata (mcs51, ds390 storage class)}
+
 \end_inset 
 
  / far
@@ -8350,6 +8725,11 @@ xdata
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_far (storage class)}
+
+\end_inset 
+
+
 \layout Standard
 
 Variables declared with this storage class will be placed in the external
@@ -8408,6 +8788,11 @@ idata
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_idata (mcs51, ds390 storage class)}
+
+\end_inset 
+
+
 \layout Standard
 
 Variables declared with this storage class will be allocated into the indirectly
@@ -8466,13 +8851,18 @@ pdata
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_pdata (mcs51, ds390 storage class)}
+
+\end_inset 
+
+
 \layout Standard
 
 Paged xdata access is just as straightforward as using the other addressing
  modes of a 8051.
  It is typically located at the start of xdata and has a maximum size of
  256 bytes.
- The following example writes 0x01 to the address pointed to.
+ The following example writes 0x01 to the pdata variable.
  Please note, pdata access physically accesses xdata memory.
  The high byte of the address is determined by port P2 
 \begin_inset LatexCommand \index{P2 (mcs51 sfr)}
@@ -8486,52 +8876,30 @@ Paged xdata access is just as straightforward as using the other addressing
 \end_inset 
 
 ).
+ This is the 
+\series bold 
+default
+\series default 
+ storage class for the Medium Memory model, e.g.:
 \layout Verse
 
 
 \family typewriter 
-pdata unsigned char *test_pdata_ptr;
-\newline 
-
-\newline 
-void main() 
-\newline 
-{ 
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-test_pdata_ptr = (pdata *)0xfe; 
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-*test_pdata_ptr = 1; 
-\newline 
-} 
+pdata unsigned char test_pdata;
 \layout Standard
 
-Generates the assembly code:
+Writing 0x01 to this variable generates the assembly code:
 \layout Verse
 
 
 \family typewriter 
-75*01 FE\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-mov\SpecialChar ~
- _test_pdata_ptr,#0xFE
-\newline 
-78 FE\SpecialChar ~
+78r00\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-mov\SpecialChar ~
- r0,#0xFE 
+mov r0,#_test_pdata
 \newline 
 74 01\SpecialChar ~
 \SpecialChar ~
@@ -8539,8 +8907,7 @@ mov\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-mov\SpecialChar ~
- a,#0x01
+mov a,#0x01 
 \newline 
 F2\SpecialChar ~
 \SpecialChar ~
@@ -8551,7 +8918,7 @@ F2\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-movx @r0,a 
+movx @r0,a
 \layout Standard
 
 If the -
@@ -8579,6 +8946,11 @@ code
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_code}
+
+\end_inset 
+
+
 \layout Standard
 
 'Variables' declared with this storage class will be placed in the code
@@ -8678,6 +9050,11 @@ bit
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_bit}
+
+\end_inset 
+
+
 \layout Standard
 
 This is a data-type and a storage class specifier.
@@ -8736,26 +9113,51 @@ sfr
 
 \end_inset 
 
- / sbit
-\begin_inset LatexCommand \index{sbit}
+
+\begin_inset LatexCommand \index{\_\_sfr}
 
 \end_inset 
 
+ / sfr16
+\begin_inset LatexCommand \index{sfr16}
 
-\layout Standard
+\end_inset 
 
-Like the bit keyword, 
-\emph on 
-sfr / sbit 
-\emph default 
-signifies both a data-type and storage class, they are used to describe
- the 
-\emph on 
-s
-\emph default 
-pecial 
-\emph on 
-f
+
+\begin_inset LatexCommand \index{\_\_sfr16}
+
+\end_inset 
+
+ / sfr32
+\begin_inset LatexCommand \index{sfr32}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_sfr32}
+
+\end_inset 
+
+ / sbit
+\begin_inset LatexCommand \index{\_\_sbit}
+
+\end_inset 
+
+
+\layout Standard
+
+Like the bit keyword, 
+\emph on 
+sfr / sfr16 / sfr32 / sbit 
+\emph default 
+signify both a data-type and storage class, they are used to describe the
+\emph on 
+s
+\emph default 
+pecial 
+\emph on 
+f
 \emph default 
 unction 
 \emph on 
@@ -8777,11 +9179,33 @@ bit
 sfr at
 \begin_inset LatexCommand \index{at}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_at}
+
 \end_inset 
 
  0x80 P0;\SpecialChar ~
  /* special function register P0 at location 0x80 */
 \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
+ */
+\newline 
+sfr16 at
+\begin_inset LatexCommand \index{at}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_at}
+
+\end_inset 
+
+ 0x8C8A TMR0;
+\newline 
 sbit at 0xd7 CY; /* CY (Carry Flag
 \begin_inset LatexCommand \index{Flags}
 
@@ -8801,6 +9225,19 @@ Special function registers which are located on an address dividable by
  sbit
 \emph default 
  addresses a specific bit within these sfr.
+\newline 
+16 Bit and 32 bit special function register combinations which require a
+ certain access order are better not declared using 
+\emph on 
+sfr16
+\emph default 
+ or 
+\emph on 
+sfr32.
+
+\emph default 
+ Allthough SDCC usually accesses them Least Significant Byte (LSB) first,
+ this is not guaranteed.
 \layout Subsubsection
 
 Pointers
@@ -8858,6 +9295,13 @@ code unsigned char * code p;
  */
 \newline 
 char * xdata p;
+\newline 
+
+\newline 
+/* the following is a function pointer physically located in data space
+ */
+\newline 
+char (* data fp)(void);
 \layout Standard
 
 Well you get the idea.
@@ -8937,6 +9381,11 @@ idata
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_idata (mcs51, ds390 storage class)}
+
+\end_inset 
+
 ).
  Furthermore, some chips may have some built in external memory (
 \emph on 
@@ -8947,6 +9396,11 @@ xdata
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_xdata (mcs51, ds390 storage class)}
+
+\end_inset 
+
 ) which should not be confused with the internal, directly addressable RAM
  memory (
 \emph on 
@@ -8957,6 +9411,11 @@ data
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_data (mcs51, ds390 storage class)}
+
+\end_inset 
+
 ).
  Sometimes this built in 
 \emph on 
@@ -8979,9 +9438,32 @@ Normally SDCC will only use the first bank
 \end_inset 
 
  of registers (register bank 0), but it is possible to specify that other
- banks of registers should be used in interrupt
+ banks of registers (keyword 
+\emph on 
+using
+\emph default 
+\emph on 
+
+\begin_inset LatexCommand \index{using (mcs51, ds390 register bank)}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_using (mcs51, ds390 register bank)}
+
+\end_inset 
+
+
+\emph default 
+) should be used in interrupt
 \begin_inset LatexCommand \index{interrupt}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_interrupt}
+
 \end_inset 
 
  routines.
@@ -9021,7 +9503,7 @@ status Collapsed
 \end_inset 
 
 -data-loc
-\begin_inset LatexCommand \index{-\/-data-loc<Value>}
+\begin_inset LatexCommand \index{-\/-data-loc <Value>}
 
 \end_inset 
 
@@ -9039,7 +9521,12 @@ status Collapsed
 /
 \end_inset 
 
--iram-size to specify the size of the total internal RAM (
+-iram-size
+\begin_inset LatexCommand \index{-\/-iram-size <Value>}
+
+\end_inset 
+
+ to specify the size of the total internal RAM (
 \emph on 
 data
 \emph default 
@@ -9064,7 +9551,7 @@ status Collapsed
 \end_inset 
 
 -stack-loc
-\begin_inset LatexCommand \index{-\/-stack-loc<Value>}
+\begin_inset LatexCommand \index{-\/-stack-loc <Value>}
 
 \end_inset 
 
@@ -9106,7 +9593,7 @@ status Collapsed
 \end_inset 
 
 -xram-size
-\begin_inset LatexCommand \index{-\/-data-loc}
+\begin_inset LatexCommand \index{-\/-xram-size <Value>}
 
 \end_inset 
 
@@ -9122,7 +9609,7 @@ status Collapsed
 \end_inset 
 
 -code-loc
-\begin_inset LatexCommand \index{-\/-data-loc}
+\begin_inset LatexCommand \index{-\/-code-loc <Value>}
 
 \end_inset 
 
@@ -9137,7 +9624,7 @@ status Collapsed
 \end_inset 
 
 -code-size
-\begin_inset LatexCommand \index{-\/-data-loc}
+\begin_inset LatexCommand \index{-\/-code-size <Value>}
 
 \end_inset 
 
@@ -9178,6 +9665,11 @@ Z80/Z180 Storage Class
 sfr
 \begin_inset LatexCommand \index{sfr}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_sfr}
+
 \end_inset 
 
  (in/out to 8-bit addresses)
@@ -9238,6 +9730,11 @@ out (_IoPort),a
 banked sfr
 \begin_inset LatexCommand \index{sfr}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_sfr}
+
 \end_inset 
 
  (in/out to 16-bit addresses)
@@ -9255,6 +9752,11 @@ banked
 sfr banked at
 \begin_inset LatexCommand \index{at}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_at}
+
 \end_inset 
 
  0x123 IoPort; 
@@ -9290,6 +9792,11 @@ out (c),a
 sfr
 \begin_inset LatexCommand \index{sfr}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_sfr}
+
 \end_inset 
 
  (in0/out0 to 8 bit addresses on Z180
@@ -9347,6 +9854,11 @@ data
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_data (hc08 storage class)}
+
+\end_inset 
+
  
 \layout Standard
 
@@ -9361,6 +9873,11 @@ xdata
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_xdata (hc08 storage class)}
+
+\end_inset 
+
  
 \layout Standard
 
@@ -9383,6 +9900,11 @@ Data items can be assigned an absolute address with the
 at
 \begin_inset LatexCommand \index{at}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_at}
+
 \end_inset 
 
  <address>
@@ -9395,11 +9917,21 @@ at
 xdata
 \begin_inset LatexCommand \index{xdata (mcs51, ds390 storage class)}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_xdata (mcs51, ds390 storage class)}
+
 \end_inset 
 
  at
 \begin_inset LatexCommand \index{at}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_at}
+
 \end_inset 
 
  0x7ffe unsigned int chksum;
@@ -9525,7 +10057,12 @@ le space.
 
 
 \family typewriter 
-extern volatile bit MOSI;\SpecialChar ~
+extern volatile
+\begin_inset LatexCommand \index{volatile}
+
+\end_inset 
+
+ bit MOSI;\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -9673,7 +10210,17 @@ Then, someplace in the code for the first hardware you would use
 
 
 \family typewriter 
-bit at 0x80 MOSI;\SpecialChar ~
+bit at
+\begin_inset LatexCommand \index{at}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_at}
+
+\end_inset 
+
+ 0x80 MOSI;\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -9966,6 +10513,13 @@ Parameters
 
 , (storage classes for parameters will be ignored), their allocation is
  governed by the memory model in use, and the reentrancy options.
+\layout Standard
+
+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.
 \layout Section
 
 Overlaying
@@ -10173,6 +10727,11 @@ interrupt
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_interrupt}
+
+\end_inset 
+
+
 \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
@@ -10184,9 +10743,19 @@ interrupt
 main
 \emph default 
 .
- The 
+ The optional 
 \emph on 
 using
+\begin_inset LatexCommand \index{using (mcs51, ds390 register bank)}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_using (mcs51, ds390 register bank)}
+
+\end_inset 
+
+
 \emph default 
  keyword can be used to tell the compiler to use the specified register
  bank (8051 specific) when generating code for this function.
@@ -10393,7 +10962,13 @@ nooverlay
  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
+\emph on 
+ critical
+\emph default 
+ if all parameters are passed in registers.
 \newline 
 
 \newline 
@@ -10629,6 +11204,11 @@ using
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_using (mcs51, ds390 register bank)}
+
+\end_inset 
+
+
 \emph default 
  a register bank or with register bank 0 (
 \emph on 
@@ -10739,6 +11319,11 @@ int foo () critical
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_critical}
+
+\end_inset 
+
  
 \newline 
 { 
@@ -11081,7 +11666,12 @@ SDCC generates this instruction if the source follows this pattern:
 
 
 \family typewriter 
-volatile bit resource_is_free; 
+volatile
+\begin_inset LatexCommand \index{volatile}
+
+\end_inset 
+
+ bit resource_is_free; 
 \newline 
 
 \newline 
@@ -11146,6 +11736,11 @@ using
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_using (mcs51, ds390 register bank)}
+
+\end_inset 
+
+
 \emph default 
  attribute (which tells the compiler to use a register bank
 \begin_inset LatexCommand \index{register bank (mcs51, ds390)}
@@ -11204,6 +11799,11 @@ interrupt
  function using a non-zero bank will assume that it can trash that register
  bank, and will not save it.
  Since high-priority interrupts
+\begin_inset LatexCommand \index{interrupts}
+
+\end_inset 
+
+
 \begin_inset LatexCommand \index{interrupt priority}
 
 \end_inset 
@@ -11285,10 +11885,19 @@ _sdcc_external_startup()
 \emph default 
  routine to your program to override the default if you need to setup hardware
  or perform some other critical operation prior to static & global variable
- initialization.
- On some mcs51 variants xdata 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.
+ initialization
+\begin_inset LatexCommand \index{Variable initialization}
+
+\end_inset 
+
+.
+ On some mcs51 variants xdata
+\begin_inset LatexCommand \index{xdata (mcs51, ds390 storage class)}
+
+\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.
  The startup code clears all internal data memory, 256 bytes by default,
  but from 0 to n-1 if 
 \emph on 
@@ -11303,7 +11912,7 @@ status Collapsed
 \end_inset 
 
 -iram-size
-\begin_inset LatexCommand \index{-\/-iram-size}
+\begin_inset LatexCommand \index{-\/-iram-size <Value>}
 
 \end_inset 
 
@@ -11414,11 +12023,21 @@ Starting from a small snippet of c-code this example shows for the MCS51
 unsigned char far
 \begin_inset LatexCommand \index{far (storage class)}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_far (storage class)}
+
 \end_inset 
 
  at
 \begin_inset LatexCommand \index{at}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_at}
+
 \end_inset 
 
  0x7f00 buf[0x100];
@@ -11510,6 +12129,11 @@ _asm
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_asm}
+
+\end_inset 
+
+
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -11632,7 +12256,17 @@ ret
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-_endasm;
+_endasm
+\begin_inset LatexCommand \index{\_endasm}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_endasm}
+
+\end_inset 
+
+;
 \newline 
 } 
 \layout Standard
@@ -11706,6 +12340,11 @@ _asm
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_asm}
+
+\end_inset 
+
+
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -11888,7 +12527,17 @@ t_b_end$:
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-_endasm;
+_endasm
+\begin_inset LatexCommand \index{\_endasm}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_endasm}
+
+\end_inset 
+
+;
 \newline 
 }
 \newline 
@@ -11904,6 +12553,16 @@ collapsed false
 
 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)}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Assembler documentation}
+
+\end_inset 
+
+
 \end_inset 
 
 .
@@ -11914,19 +12573,38 @@ _asm
 
 \end_inset 
 
- ...
- _endasm;
-\family default 
- keyword pair.
- Specifically it will not know which registers are used and thus register
- pushing/popping
-\begin_inset LatexCommand \index{push/pop}
 
-\end_inset 
+\begin_inset LatexCommand \index{\_\_asm}
 
- has to be done manually.
-\layout Standard
+\end_inset 
+
+ ...
+ _endasm
+\size footnotesize 
+
+\begin_inset LatexCommand \index{\_endasm}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_endasm}
+
+\end_inset 
+
+
+\size default 
+;
+\family default 
+ keyword pair.
+ Specifically it will not know which registers are used and thus register
+ pushing/popping
+\begin_inset LatexCommand \index{push/pop}
+
+\end_inset 
+
+ has to be done manually.
+\layout Standard
 
 It is recommended that each assembly instruction (including labels) be placed
  in a separate line (as the example shows).
@@ -11985,6 +12663,11 @@ _naked
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_naked}
+
+\end_inset 
+
 .
  
 \emph default 
@@ -12031,6 +12714,11 @@ volatile
 void simpleInterrupt(void) interrupt
 \begin_inset LatexCommand \index{interrupt}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_interrupt}
+
 \end_inset 
 
  1
@@ -12061,6 +12749,11 @@ _asm
 \end_inset 
 
 
+\begin_inset LatexCommand \index{\_\_asm}
+
+\end_inset 
+
+
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -12096,6 +12789,11 @@ _endasm
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_endasm}
+
+\end_inset 
+
 ;
 \newline 
 }
@@ -12332,6 +13030,11 @@ _asm
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_asm}
+
+\end_inset 
+
  
 \newline 
 \SpecialChar ~
@@ -12360,6 +13063,11 @@ b,00001$
 _endasm
 \begin_inset LatexCommand \index{\_endasm}
 
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_endasm}
+
 \end_inset 
 
  ;
@@ -12438,7 +13146,17 @@ $0003: ;label (can be referenced by inline assembler only)
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-_endasm ; 
+_endasm
+\begin_inset LatexCommand \index{\_endasm}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{\_\_endasm}
+
+\end_inset 
+
+ ; 
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -13878,11 +14596,19 @@ convert long to floating point number
 \layout Standard
 
 These support routines are developed in ANSI-C so there is room for space
- and speed improvement.
+ and speed improvement
+\begin_inset Foot
+collapsed false
+
+\layout Standard
+
+The floating point routines for the mcs51 are implemented in assembler
+\end_inset 
+
+.
  Note if all these routines are used simultaneously the data space might
  overflow.
- For serious floating point usage it is recommended that the large model
- be used.
+ For serious floating point usage the large model might be needed.
  Also notice that you don't have to call this routines directly.
  The compiler will use them automatically every time a floating point operation
  is required.
@@ -14002,6 +14728,11 @@ status Collapsed
 If you're short on memory you might want to use 
 \family typewriter 
 printf_small()
+\begin_inset LatexCommand \index{printf\_small()}
+
+\end_inset 
+
+
 \family default 
  
 \emph on 
@@ -14012,12 +14743,35 @@ instead
  printf().
 
 \family default 
- For the mcs51 there is an assembly version 
+ For the mcs51 there additionally are assembly versions 
+\family typewriter 
+printf_tiny()
+\begin_inset LatexCommand \index{printf\_tiny() (mcs51)}
+
+\end_inset 
+
+
+\family default 
+ and 
 \family typewriter 
 printf_fast()
+\begin_inset LatexCommand \index{printf\_fast() (mcs51)}
+
+\end_inset 
+
+\family default 
+and
+\family typewriter 
+ printf_fast_f()
+\begin_inset LatexCommand \index{printf\_fast\_f() (mcs51)}
+
+\end_inset 
+
+
 \family default 
- which should fit the requirements of many embedded systems (by unsetting
#defines it can be customized to 
+ which should fit the requirements of many embedded systems (printf_fast()
can be customized by unsetting #defines to 
 \emph on 
 not
 \emph default 
@@ -14094,12 +14848,12 @@ MCS51 Memory Models
 
 \layout Subsubsection
 
-Small and Large
+Small, Medium and Large
 \layout Standard
 
-SDCC allows two memory models for MCS51 code, 
+SDCC allows three memory models for MCS51 code, 
 \shape slanted 
-small
+small, medium
 \shape default 
  and 
 \shape slanted 
@@ -14111,16 +14865,15 @@ large
 never
 \emph default 
  be combined together or the results would be unpredictable.
- The library routines supplied with the compiler are compiled as both small
- and large.
- The compiled library modules are contained in separate directories as small
- and large so that you can link to either set.
+ The library routines supplied with the compiler are compiled as small,
+ medium and large.
+ The compiled library modules are contained in separate directories as small,
+ medium and large so that you can link to the appropriate set.
 \layout Standard
 
-When the large model is used all variables declared without a storage class
- will be allocated into the external ram, this includes all parameters and
- local variables (for non-reentrant
+When the medium or large model is used all variables declared without a
+ storage class will be allocated into the external ram, this includes all
parameters and local variables (for non-reentrant
 \begin_inset LatexCommand \index{reentrant}
 
 \end_inset 
@@ -14455,6 +15208,11 @@ none
 
 \end_inset 
 
+
+\begin_inset LatexCommand \index{\_\_naked}
+
+\end_inset 
+
 .
 \layout Itemize
 
@@ -14653,6 +15411,24 @@ std_c99
 
 - Follow the C99 standard and disable SDCC features that conflict with the
  standard (incomplete support).
+\layout Itemize
+
+codeseg <name>
+\begin_inset LatexCommand \index{\#pragma codeseg}
+
+\end_inset 
+
+- Use this name (max.
+ 8 characters) for the code segment.
+\layout Itemize
+
+constseg <name>
+\begin_inset LatexCommand \index{\#pragma constseg}
+
+\end_inset 
+
+- Use this name (max.
+ 8 characters) for the const segment.
 \layout Standard
 
 SDCPP supports the following #pragma directives:
@@ -14765,7 +15541,7 @@ The compiler creates the following #defines
 
 
 \begin_inset  Tabular
-<lyxtabular version="3" rows="10" columns="2">
+<lyxtabular version="3" rows="11" columns="2">
 <features>
 <column alignment="center" valignment="top" leftline="true" width="0">
 <column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
@@ -14966,6 +15742,43 @@ status Collapsed
 
 \layout Standard
 
+SDCC_MODEL_MEDIUM
+\begin_inset LatexCommand \index{SDCC\_MODEL\_MEDIUM}
+
+\end_inset 
+
+
+\end_inset 
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
+when 
+\emph on 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-model-medium
+\emph default 
+ is used
+\end_inset 
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\layout Standard
+
 SDCC_MODEL_LARGE
 \begin_inset LatexCommand \index{SDCC\_MODEL\_LARGE}
 
@@ -15389,7 +16202,7 @@ For assembling you can use either GPUTILS'
 
  gpasm.exe or MPLAB's mpasmwin.exe.
  GPUTILS is available from 
-\begin_inset LatexCommand \url{http://gputils.sourceforge.net/}
+\begin_inset LatexCommand \url{http://sourceforge.net/projects/gputils}
 
 \end_inset 
 
@@ -15443,7 +16256,7 @@ $(PRJ).hex: $(OBJS)
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-gplink -m -s $(PRJ).lkr -o $(PRJ).hex $(OBJS)
+gplink -m -s $(PRJ).lkr -o $(PRJ).hex $(OBJS) libsdcc.lib
 \layout Standard
 
 Here is a 
@@ -15489,7 +16302,7 @@ $(PRJ).hex: $(OBJS)
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-mplink /v $(PRJ).lkr /m $(PRJ).map /o $(PRJ).hex $(OBJS)
+mplink /v $(PRJ).lkr /m $(PRJ).map /o $(PRJ).hex $(OBJS) libsdcc.lib
 \layout Standard
 
 Please note that indentations within a
@@ -15497,6 +16310,131 @@ Please note that indentations within a
  Makefile
 \family default 
  have to be done with a tabulator character.
+\layout Subsection
+
+Command-line options
+\layout Standard
+
+Besides the switches common to all SDCC backends, the PIC14 port accepts
+ the following options (for an updated list see sdcc -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-help):
+\layout List
+\labelwidthstring 00.00.0000
+
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-debug-extra 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 disable (slightly faulty) optimization on pCode
+\layout Subsection
+
+The library
+\layout Subsubsection
+
+error: missing definition for symbol 
+\begin_inset Quotes sld
+\end_inset 
+
+__gptrget1
+\begin_inset Quotes srd
+\end_inset 
+
+
+\layout Standard
+
+The PIC14 port uses library routines to provide more complex operations
+ like multiplication, division/modulus and (generic) pointer dereferencing.
+ In order to add these routines to your project, you must link with PIC14's
+\family typewriter 
+libsdcc.lib
+\family default 
+.
+ For single source file projects this is done automatically, more complex
+ projects must add 
+\family typewriter 
+libsdcc.lib
+\family default 
+ to the linker's arguments.
+ Make sure you also add an include path for the library (using the -I switch
+ to the linker)!
+\layout Subsubsection
+
+Processor mismatch in file 
+\begin_inset Quotes sld
+\end_inset 
+
+XXX
+\begin_inset Quotes srd
+\end_inset 
+
+.
+\layout Standard
+
+This warning can usually be ignored due to the very good compatibility amongst
+ 14 bit PIC devices.
+\layout Standard
+
+You might also consider recompiling the library for your specific device
+ by changing the ARCH=p16f877 (default target) entry in 
+\family typewriter 
+device/lib/pic/Makefile.in
+\family default 
+ and 
+\family typewriter 
+device/lib/pic/Makefile
+\family default 
+ to reflect your device.
+ This might even improve performance for smaller devices as unneccesary
+ BANKSELs migth be removed.
+\layout Subsection
+
+Known bugs
+\layout Subsubsection
+
+initialized data
+\layout Standard
+
+Currently, data can only be initialized if it resides in the source file
+ together with 
+\emph on 
+main()
+\emph default 
+.
+ Data in other source files will silently 
+\series bold 
+not
+\series default 
+ be initialized.
 \layout Section
 
 The PIC16
@@ -15972,6 +16910,20 @@ status Collapsed
 /
 \end_inset 
 
+-optimize-df Analyze the dataflow of the generated code and improve it.
+\layout List
+\labelwidthstring 00.00.0000
+
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
 -obanksel=nn Set optimization level for inserting BANKSELs.
 \newline 
 
@@ -17036,7 +17988,7 @@ xxxx
 \layout Standard
 
 Libraries are created with gplib which is part of the gputils package 
-\begin_inset LatexCommand \url{http://gputils.sourceforge.net}
+\begin_inset LatexCommand \url{http://sourceforge.net/projects/gputils}
 
 \end_inset 
 
@@ -19187,7 +20139,7 @@ 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 available on Unix platforms only.
+ Sdcdb is currently not available on Win32 platforms.
 \layout Section
 
 Compiling for Debugging
@@ -19286,7 +20238,7 @@ foo.ihx - the Intel hex format
  object file.
 \layout Section
 
-Command Line Options.
+Command Line Options
 \layout Itemize
 
 -
@@ -19353,15 +20305,15 @@ status Collapsed
 -k <port number> passed to simulator see the simulator docs for details.
 \layout Section
 
-Debugger Commands.
+Debugger Commands
 \layout Standard
 
 As mentioned earlier the command interface for the debugger has been deliberatel
 y kept as close the GNU debugger gdb, as possible.
  This will help the integration with existing graphical user interfaces
  (like ddd, xxgdb or xemacs) existing for the GNU debugger.
- If you use a graphical user interface for the debugger you can skip the
next sections.
+ If you use a graphical user interface for the debugger you can skip this
section.
 \layout Subsubsection*
 
 break [line | file:line | function | file:function]
@@ -19504,17 +20456,102 @@ quit
  My name is Bobby Brown"
 \layout Section
 
-Interfacing with XEmacs
-\begin_inset LatexCommand \index{XEmacs}
+Interfacing with DDD
+\layout Comment
 
+The screenshot was converted from png to eps with: 
+\begin_inset Quotes sld
 \end_inset 
 
+bmeps -c -e8f -p3 ddd_example.png >ddd_example.eps
+\begin_inset Quotes srd
+\end_inset 
 
-\begin_inset LatexCommand \index{Emacs}
+ which produces a pretty compact eps file which is free from compression
+ artifacts.
+\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).
+\layout Standard
+
+The .eps File 
+\size footnotesize 
+
+\begin_inset LatexCommand \url{http://cvs.sourceforge.net/viewcvs.py/*checkout*/sdcc/sdcc/doc/figures/ddd_example.eps}
+
+\end_inset 
+
+
+\size default 
+ shows a screenshot of a debugging session with DDD
+\begin_inset LatexCommand \index{DDD (debugger)}
+
+\end_inset 
+
+ (Unix only) on a simulated 8032.
+ The debugging session might not run as smoothly as the screenshot suggests.
+ The debugger allows setting of breakpoints, displaying and changing variables,
+ single stepping through C and assembler code.
+\newline 
+The source was compiled with 
+\family sans 
+\series bold 
+
+\newline 
+
+\newline 
+sdcc -
+\family default 
+\series default 
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+
+\family sans 
+\series bold 
+-debug ddd_example.c
+\family default 
+\series default 
+\family sans 
+\series bold 
+
+\newline 
+
+\family default 
+\series default 
+
+\newline 
+and DDD was invoked with 
+\family sans 
+\series bold 
+
+\newline 
+
+\newline 
+ddd -debugger 'sdcdb -cpu 8032 ddd_example'
+\layout Section
+
+Interfacing with XEmacs
+\begin_inset LatexCommand \index{XEmacs}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Emacs}
+
+\end_inset 
 
-\end_inset 
 
-.
 \layout Standard
 
 Two files (in emacs lisp) are provided for the interfacing with XEmacs,
@@ -20363,7 +21400,12 @@ Use the smallest data type to represent your data-value.
  use an 'unsigned char' instead of a 'short' or 'int'.
  Please note, that ANSI C requires both signed and unsigned chars to be
  promoted to 'signed int' before doing any operation.
- This promotion can be omitted, if the result is the same.
+ This promotion
+\begin_inset LatexCommand \index{type promotion}
+
+\end_inset 
+
+ can be omitted, if the result is the same.
  The effect of the promotion rules together with the sign-extension is often
  surprising:
 \begin_deeper 
@@ -20555,7 +21597,7 @@ Tools
 <features>
 <column alignment="center" valignment="top" leftline="true" width="0pt">
 <column alignment="center" valignment="top" leftline="true" width="0pt">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
+<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">
 \begin_inset Text
@@ -21237,7 +22279,7 @@ Related open source tools
 <features>
 <column alignment="center" valignment="top" leftline="true" width="0pt">
 <column alignment="block" valignment="top" leftline="true" width="30line%">
-<column alignment="center" valignment="top" leftline="true" rightline="true" width="0pt">
+<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">
 \begin_inset Text
@@ -21328,7 +22370,7 @@ GNU PIC utilities
 \layout Standard
 
 
-\begin_inset LatexCommand \url{http://gputils.sourceforge.net/}
+\begin_inset LatexCommand \url{http://sourceforge.net/projects/gputils}
 
 \end_inset 
 
@@ -21359,7 +22401,7 @@ PIC programmer
 \layout Standard
 
 
-\begin_inset LatexCommand \url{http://digilander.libero.it/fbradasc/FLP5.html}
+\begin_inset LatexCommand \url{http://freshmeat.net/projects/flp5/}
 
 \end_inset 
 
@@ -21395,7 +22437,7 @@ Formats C source - Master of the white spaces
 \layout Standard
 
 
-\begin_inset LatexCommand \url{http://home.hccnet.nl/d.ingamells/beautify.html}
+\begin_inset LatexCommand \url{http://directory.fsf.org/GNU/indent.html}
 
 \end_inset 
 
@@ -21410,7 +22452,7 @@ Formats C source - Master of the white spaces
 \layout Standard
 
 srecord
-\begin_inset LatexCommand \index{srecord (tool)}
+\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
 
 \end_inset 
 
@@ -21431,7 +22473,7 @@ Object file conversion, checksumming, ...
 \layout Standard
 
 
-\begin_inset LatexCommand \url{http://srecord.sourceforge.net/}
+\begin_inset LatexCommand \url{http://sourceforge.net/projects/srecord}
 
 \end_inset 
 
@@ -21556,7 +22598,12 @@ splint
 
 \layout Standard
 
-Statically checks c sources (has anyone adapted splint for SDCC?)
+Statically checks c sources (see 
+\begin_inset LatexCommand \ref{lyx:more-pedantic-SPLINT}
+
+\end_inset 
+
+)
 \end_inset 
 </cell>
 <cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
@@ -21696,7 +22743,7 @@ C Reference Card
 \layout Standard
 
 
-\begin_inset LatexCommand \url{http://www.refcards.com/about/c.html}
+\begin_inset LatexCommand \url{http://refcards.com/refcards/c/index.html}
 
 \end_inset 
 
@@ -21926,7 +22973,7 @@ The SDCC project is hosted on the SDCC sourceforge site at
 
 \end_inset 
 
- area and cvs code repository
+ area and Subversion code repository
 \begin_inset LatexCommand \index{cvs code repository}
 
 \end_inset 
@@ -22144,7 +23191,7 @@ Traffic on sdcc-devel and sdcc-user is about 100 mails/month each not counting
 ChangeLog
 \layout Standard
 
-You can follow the status of the cvs version
+You can follow the status of the Subversion version
 \begin_inset LatexCommand \index{version}
 
 \end_inset 
@@ -22159,7 +23206,7 @@ You can follow the status of the cvs version
 
 \size footnotesize 
 
-\begin_inset LatexCommand \htmlurl{http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/*checkout*/sdcc/sdcc/ChangeLog?rev=HEAD&content-type=text/plain}
+\begin_inset LatexCommand \htmlurl{http://svn.sourceforge.net/viewcvs.cgi/*checkout*/sdcc/trunk/sdcc/ChangeLog}
 
 \end_inset 
 
@@ -22210,7 +23257,7 @@ sdcc/device/examples/.
 More examples and libraries are available at
 \emph on 
  The SDCC Open Knowledge Resource 
-\begin_inset LatexCommand \url{http://www.qsl.net/dl9sec/SDCC_OKR.html}
+\begin_inset LatexCommand \url{http://sdccokr.dl9sec.de/}
 
 \end_inset 
 
@@ -22313,6 +23360,132 @@ The pic port uses a different set of regression tests, you'll find them
 sdcc/src/regression
 \shape default 
 .
+\layout Section
+
+Use of SDCC in Education
+\layout Standard
+
+In short: 
+\emph on 
+highly
+\emph default 
+ encouraged
+\begin_inset Foot
+collapsed false
+
+\layout Standard
+
+the phrase "use in education" might evoke the association "
+\emph on 
+only
+\emph default 
+ fit for use in education".
+ This connotation is not intended but nevertheless risked as the licensing
+ of SDCC makes it difficult to offer educational discounts
+\end_inset 
+
+.
+ If your rationales are to:
+\layout Enumerate
+
+give students a chance to understand the 
+\emph on 
+complete
+\emph default 
+ steps of code generation
+\layout Enumerate
+
+have a curriculum that can be extended for years.
+ Then you could use an fpga board as target and your curriculum will seamlessly
+ extend from logic synthesis (
+\begin_inset LatexCommand \url[http://www.opencores.org]{opencores.org}
+
+\end_inset 
+
+, 
+\begin_inset LatexCommand \url[Oregano]{http://www.oregano.at/ip/ip01.htm}
+
+\end_inset 
+
+), over assembly programming, to C to FPGA compilers (
+\begin_inset LatexCommand \url[FPGAC]{http://sf.net/projects/fpgac}
+
+\end_inset 
+
+) and to C.
+\layout Enumerate
+
+be able to insert excursions about skills like using a revision control
+ system, submitting/applying patches, using a type-setting (as opposed to
+ word-processing) engine LyX/LaTeX, using 
+\begin_inset LatexCommand \url[SourceForge]{http://www.sf.net}
+
+\end_inset 
+
+, following some 
+\begin_inset LatexCommand \url[netiquette]{http://en.wikipedia.org/wiki/Netiquette}
+
+\end_inset 
+
+, understanding BSD/LGPL/GPL/Proprietary licensing, growth models of Open
+ Source Software, CPU simulation, compiler regression tests
+\begin_inset LatexCommand \index{Regression test}
+
+\end_inset 
+
+.
+\newline 
+And if there should be a shortage of ideas then you can always point students
+ to the ever-growing feature request list 
+\begin_inset LatexCommand \htmlurl{http://sourceforge.net/tracker/?group_id=599&atid=350599}
+
+\end_inset 
+
+.
+\layout Enumerate
+
+not tie students to a specific host platform and instead allow them to use
+ a host platform of 
+\emph on 
+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}
+
+\end_inset 
+
+)
+\layout Enumerate
+
+not encourage students to use illegal copies of educational software
+\layout Enumerate
+
+be immune to licensing/availability/price changes of the chosen tool chain
+\layout Enumerate
+
+be able to change to a new target platform without having to adopt a new
+ tool chain
+\layout Enumerate
+
+have complete control over and insight into the tool chain
+\layout Enumerate
+
+make your students aware about the pros and cons of open source software
+ development
+\layout Enumerate
+
+give back to the public as you are probably at least partially publically
+ funded
+\layout Enumerate
+
+give students a chance to publically prove their skills and to possibly
+ see a world wide impact
+\layout Standard
+
+then SDCC is probably among the first choices.
+ Well, probably SDCC might be the only choice.
 \layout Chapter
 \pagebreak_top 
 SDCC Technical Data
@@ -23426,8 +24599,13 @@ bound
 \emph default 
 aries.
  It has no effect if a default label is supplied.
- Use of this pragma is dangerous: if the switch argument is not matched
- by a case statement the processor will happily jump into Nirvana.
+ Use of this pragma is dangerous: if the switch
+\begin_inset LatexCommand \index{switch statement}
+
+\end_inset 
+
+ argument is not matched by a case statement the processor will happily
+ jump into Nirvana.
 \layout Subsection
 
 Bit-shifting Operations
@@ -23668,63 +24846,897 @@ collapsed false
 
 \layout Standard
 
-Usually 8-bit processors don't care much about endianness.
- This is not the case for the standard 8051 which only has an instruction
- to increment its 
-\emph on 
-dptr
-\emph default 
-
-\begin_inset LatexCommand \index{DPTR}
-
-\end_inset 
-
--datapointer
+Usually 8-bit processors don't care much about endianness.
+ This is not the case for the standard 8051 which only has an instruction
+ to increment its 
+\emph on 
+dptr
+\emph default 
+
+\begin_inset LatexCommand \index{DPTR}
+
+\end_inset 
+
+-datapointer
+\emph on 
+\emph default 
+so little-endian is the more efficient byte order.
+\end_inset 
+
+
+\begin_inset LatexCommand \index{little-endian}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Endianness}
+
+\end_inset 
+
+ format (i.e.
+ lowest order first).
+\layout Subsection
+
+Highest Order Bit
+\begin_inset LatexCommand \index{Highest Order Bit}
+
+\end_inset 
+
+ / Any Order Bit
+\begin_inset LatexCommand \index{Any Order Bit}
+
+\end_inset 
+
+
+\layout Standard
+
+It is frequently required to obtain the highest order bit of an integral
+ type (long, int, short or char types).
+ Also obtaining any other order bit is not uncommon.
+ SDCC recognizes the following expressions to yield the highest order bit
+ and generates optimized code for it, e.g.:
+\layout Verse
+
+
+\family typewriter 
+unsigned int gint; 
+\newline 
+
+\newline 
+foo () { 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+unsigned char hob1, aob1; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+bit hob2, hob3, aob2, aob3; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+...
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+hob1 = (gint >> 15) & 1; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+hob2 = (gint >> 15) & 1; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+hob3 = gint & 0x8000; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+aob1 = (gint >> 9) & 1; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+aob2 = (gint >> 8) & 1; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+aob3 = gint & 0x0800; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+..
+\newline 
+}
+\layout Standard
+
+will generate the following code:
+\layout Verse
+
+
+\family typewriter 
+\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 ~
+ 61 ;\SpecialChar ~
+ hob.c 7 
+\newline 
+000A E5*01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 62\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ a,(_gint + 1) 
+\newline 
+000C 23\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 63\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ rl\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ a 
+\newline 
+000D 54 01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 64\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ anl\SpecialChar ~
+\SpecialChar ~
+ a,#0x01 
+\newline 
+000F F5*02\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 65\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ _foo_hob1_1_1,a 
+\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 ~
+ 66 ;\SpecialChar ~
+ hob.c 8 
+\newline 
+0011 E5*01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 67\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ a,(_gint + 1) 
+\newline 
+0013 33\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 68\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ rlc\SpecialChar ~
+\SpecialChar ~
+ a 
+\newline 
+0014 92*00\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 69\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ _foo_hob2_1_1,c 
+\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 ~
+ 66 ;\SpecialChar ~
+ hob.c 9 
+\newline 
+0016 E5*01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 67\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ a,(_gint + 1) 
+\newline 
+0018 33\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 68\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ rlc\SpecialChar ~
+\SpecialChar ~
+ a 
+\newline 
+0019 92*01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 69\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ _foo_hob3_1_1,c 
+\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 ~
+ 70 ;\SpecialChar ~
+ hob.c 10 
+\newline 
+001B E5*01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 71\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ a,(_gint + 1) 
+\newline 
+001D 03\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 72\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ rr\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ a 
+\newline 
+001E 54 01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 73\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ anl\SpecialChar ~
+\SpecialChar ~
+ a,#0x01 
+\newline 
+0020 F5*03\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 74\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ _foo_aob1_1_1,a 
+\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 ~
+ 75 ;\SpecialChar ~
+ hob.c 11 
+\newline 
+0022 E5*01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 76\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ a,(_gint + 1) 
+\newline 
+0024 13\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 77\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ rrc\SpecialChar ~
+\SpecialChar ~
+ a 
+\newline 
+0025 92*02\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 78\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ _foo_aob2_1_1,c 
+\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 ~
+ 79 ;\SpecialChar ~
+ hob.c 12 
+\newline 
+0027 E5*01\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 80\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ a,(_gint + 1) 
+\newline 
+0029 A2 E3\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 81\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ c,acc[3] 
+\newline 
+002B 92*03\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 82\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ _foo_aob3_1_1,c 
+\layout Standard
+
+Other variations of these cases however will 
 \emph on 
+not
 \emph default 
-so little-endian is the more efficient byte order.
-\end_inset 
-
+ be recognized.
+ They are standard C expressions, so I heartily recommend these be the only
+ way to get the highest order bit, (it is portable).
+ Of course it will be recognized even if it is embedded in other expressions,
+ e.g.:
+\layout Verse
 
-\begin_inset LatexCommand \index{little-endian}
 
-\end_inset 
+\family typewriter 
+xyz = gint + ((gint >> 15) & 1);
+\layout Standard
 
+will still be recognized.
+\layout Subsection
 
-\begin_inset LatexCommand \index{Endianness}
+Higher Order Byte
+\begin_inset LatexCommand \index{Higher Order Byte}
 
 \end_inset 
 
- format (i.e.
- lowest order first).
-\layout Subsection
-
-Highest Order Bit
-\begin_inset LatexCommand \index{Highest Order Bit}
+ / Higher Order Word
+\begin_inset LatexCommand \index{Higher Order Word}
 
 \end_inset 
 
 
 \layout Standard
 
-It is frequently required to obtain the highest order bit of an integral
type (long, int, short or char types).
- SDCC recognizes the following expression to yield the highest order bit
- and generates optimized code for it, e.g.:
+It is also frequently required to obtain a higher order byte or word of
a larger integral type (long, int or short types).
+ SDCC recognizes the following expressions to yield the higher order byte
or word and generates optimized code for it, e.g.:
 \layout Verse
 
 
 \family typewriter 
 unsigned int gint; 
 \newline 
+unsigned long int glong; 
+\newline 
 
 \newline 
 foo () { 
 \newline 
 \SpecialChar ~
 \SpecialChar ~
-unsigned char hob; 
+unsigned char hob1, hob2; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+unsigned int how1, how2; 
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -23733,7 +25745,19 @@ unsigned char hob;
 \newline 
 \SpecialChar ~
 \SpecialChar ~
-hob = (gint >> 15) & 1; 
+hob1 = (gint >> 8) & 0xFF; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+hob2 = glong >> 24; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+how1 = (glong >> 16) & 0xFFFF; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+how2 = glong >> 8; 
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -23773,10 +25797,10 @@ will generate the following code:
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
61 ;\SpecialChar ~
- hob.c 7 
91 ;\SpecialChar ~
+ hob.c 15 
 \newline 
-000A E5*01\SpecialChar ~
+0037 85*01*06\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -23787,23 +25811,48 @@ will generate the following code:
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
+\SpecialChar ~
+ 92\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
- 62\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
+ mov\SpecialChar ~
 \SpecialChar ~
+ _foo_hob1_1_1,(_gint + 1) 
+\newline 
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
- mov\SpecialChar ~
 \SpecialChar ~
- a,(_gint + 1) 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 93 ;\SpecialChar ~
+ hob.c 16 
 \newline 
-000C 23\SpecialChar ~
+003A 85*05*07\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -23815,26 +25864,47 @@ will generate the following code:
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
+ 94\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
- 63\SpecialChar ~
 \SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ _foo_hob2_1_1,(_glong + 3) 
+\newline 
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
- rl\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
- a 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 95 ;\SpecialChar ~
+ hob.c 17 
 \newline 
-000D 54 01\SpecialChar ~
+003D 85*04*08\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -23845,23 +25915,44 @@ will generate the following code:
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
+\SpecialChar ~
+ 96\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
- 64\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
+ mov\SpecialChar ~
 \SpecialChar ~
+ _foo_how1_1_1,(_glong + 2) 
+\newline 
+0040 85*05*09\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
- anl\SpecialChar ~
 \SpecialChar ~
- a,#0x01 
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 97\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ (_foo_how1_1_1 + 1),(_glong + 3) 
 \newline 
-000F F5*02\SpecialChar ~
+0043 85*03*0A\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -23872,11 +25963,32 @@ will generate the following code:
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
+\SpecialChar ~
+ 98\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ mov\SpecialChar ~
+\SpecialChar ~
+ _foo_how2_1_1,(_glong + 1) 
+\newline 
+0046 85*04*0B\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
- 65\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ 99\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -23886,23 +25998,23 @@ will generate the following code:
 \SpecialChar ~
  mov\SpecialChar ~
 \SpecialChar ~
- _foo_hob_1_1,a
+ (_foo_how2_1_1 + 1),(_glong + 2) 
 \layout Standard
 
-Variations of this case however will 
+Again, variations of these cases may 
 \emph on 
 not
 \emph default 
  be recognized.
It is a standard C expression, so I heartily recommend this be the only
- way to get the highest order bit, (it is portable).
They are standard C expressions, so I heartily recommend these be the only
+ way to get the higher order byte/word, (it is portable).
  Of course it will be recognized even if it is embedded in other expressions,
  e.g.:
 \layout Verse
 
 
 \family typewriter 
-xyz = gint + ((gint >> 15) & 1);
+xyz = gint + ((gint >> 8) & 0xFF);
 \layout Standard
 
 will still be recognized.
@@ -23928,7 +26040,9 @@ The compiler uses a rule based, pattern matching and re-writing mechanism
 copt
 \emph default 
  a peep-hole optimizer by Christopher W.
- Fraser (cwfraser@microsoft.com).
+ Fraser (cwfraser\SpecialChar ~
+@\SpecialChar ~
+microsoft.com).
  A default set of rules are compiled into the compiler, additional rules
  may be added with the 
 \emph on 
@@ -24417,6 +26531,18 @@ return rets;/* is invalid in SDCC although allowed in ANSI */
 \end_deeper 
 \layout Itemize
 
+initialization of structure arrays must be fully braced.
+\begin_deeper 
+\layout Verse
+
+
+\family typewriter 
+struct s { char x } a[] = {1, 2}; /* invalid in SDCC */
+\newline 
+struct s { char x } a[] = {{1}, {2}}; /* OK */
+\end_deeper 
+\layout Itemize
+
 'long long
 \begin_inset LatexCommand \index{long long (not supported)}
 
@@ -24443,57 +26569,6 @@ return rets;/* is invalid in SDCC although allowed in ANSI */
 not supported.
 \layout Itemize
 
-No support for setjmp
-\begin_inset LatexCommand \index{setjmp (not supported)}
-
-\end_inset 
-
- and longjmp
-\begin_inset LatexCommand \index{longjmp (not supported)}
-
-\end_inset 
-
- (for now).
-\layout Itemize
-
-Certain words that are valid identifiers in the standard may be reserved
- words in SDCC unless the 
-\series bold 
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash 
-/
-\end_inset 
-
--std-c89
-\begin_inset LatexCommand \index{-\/-std-c89}
-
-\end_inset 
-
- or -
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash 
-/
-\end_inset 
-
--std-c99
-\begin_inset LatexCommand \index{-\/-std-c99}
-
-\end_inset 
-
-
-\series default 
- command line options are used.
-\layout Itemize
-
 Old K&R style
 \begin_inset LatexCommand \index{K\&R style}
 
@@ -24522,6 +26597,26 @@ int i,j; /* are valid in ANSI but not valid in SDCC */
 \end_deeper 
 \layout Itemize
 
+Most enhancements in C99 are not supported, f.e.:
+\begin_deeper 
+\layout Verse
+
+
+\family typewriter 
+\series bold 
+inline
+\series default 
+ int increment (int a) { return a+1; } /* is invalid in SDCC although allowed
+ in C99 */
+\newline 
+for (
+\series bold 
+int
+\series default 
+ i=0; i<10; i++) /* is invalid in SDCC although allowed in C99 */
+\end_deeper 
+\layout Itemize
+
 Certain words that are valid identifiers in the standard may be reserved
  words in SDCC unless the 
 \series bold 
@@ -24564,7 +26659,12 @@ t', 'near', 'nonbanked', 'pdata', 'reentrant', 'sbit', 'sfr', 'shadowregs',
  'sram', 'using', 'wparam', 'xdata', '_overlay', '_asm', '_endasm', and
  '_naked'.
  Compliant equivalents of these keywords are always available in a form
- that begin with two underscores, f.e.
+ that begin with two underscores
+\begin_inset LatexCommand \index{\_\_ (prefix for extended keywords)}
+
+\end_inset 
+
+, f.e.
  '__data' instead of 'data'.
 \layout Section
 
@@ -24724,7 +26824,11 @@ The anatomy of the compiler
 
 \shape italic 
 This is an excerpt from an article published in Circuit Cellar Magazine
- in august 2000.
+ 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