Added option --vc
[fw/sdcc] / doc / sdccman.lyx
index 8b06017f7b3a4e88d63fa36fd18fc577373f58a8..553a0227ec3043217fbfcebb958a533f625443a7 100644 (file)
@@ -134,7 +134,7 @@ copy propagation,
 dead code elimination 
 \layout Itemize
 
-jumptables for 
+jump tables for 
 \emph on 
 switch
 \emph default 
@@ -321,7 +321,7 @@ short is now equivalent to int (16 bits), it used to be equivalent to char
  (8 bits) which is not ANSI compliant
 \layout Itemize
 
-the default directory for gcc-builds where include, library and documention
+the default directory for gcc-builds where include, library and documentation
  files are stored is now in /usr/local/share
 \layout Itemize
 
@@ -486,7 +486,7 @@ Configure Options
 
 The install paths, search paths and other options are defined when running
  'configure'.
- The defaults can be overriden by:
+ The defaults can be overridden by:
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -500,7 +500,7 @@ status Collapsed
 /
 \end_inset 
 
--prefix see tabel below
+-prefix see table below
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -514,7 +514,7 @@ status Collapsed
 /
 \end_inset 
 
--exec_prefix see tabel below
+-exec_prefix see table below
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -528,7 +528,7 @@ status Collapsed
 /
 \end_inset 
 
--bindir see tabel below
+-bindir see table below
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -542,19 +542,19 @@ status Collapsed
 /
 \end_inset 
 
--datadir see tabel below
+-datadir see table below
 \layout List
 \labelwidthstring 00.00.0000
 
-docdir environment variable, see tabel below
+docdir environment variable, see table below
 \layout List
 \labelwidthstring 00.00.0000
 
-include_dir_suffix environment variable, see tabel below
+include_dir_suffix environment variable, see table below
 \layout List
 \labelwidthstring 00.00.0000
 
-lib_dir_suffix environment variable, see tabel below
+lib_dir_suffix environment variable, see table below
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -1197,9 +1197,18 @@ Examples:
 \layout LyX-Code
 
 ./configure
-\layout LyX-Code
+\newline 
+./configure -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
 
-./configure --prefix=
+-prefix=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1207,7 +1216,17 @@ Examples:
 \begin_inset Quotes srd
 \end_inset 
 
- --datadir=
+ -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-datadir=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1216,21 +1235,39 @@ Examples:
 \end_inset 
 
 
-\layout LyX-Code
+\newline 
+./configure -
+\begin_inset ERT
+status Collapsed
 
-./configure --disable-avr-port --disable-xa51-port
 \layout Standard
 
-To crosscompile on linux for Mingw32 (see also 'sdcc/support/scripts/sdcc_mingw3
-2'):
-\layout LyX-Code
+\backslash 
+/
+\end_inset 
+
+-disable-avr-port -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
 
-./configure 
 \backslash 
+/
+\end_inset 
 
+-disable-xa51-port
+\layout Standard
+
+To cross compile on linux for Mingw32 (see also 'sdcc/support/scripts/sdcc_mingw
+32'):
 \layout LyX-Code
 
-  CC=
+./configure 
+\backslash 
+
+\newline 
+CC=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1248,10 +1285,9 @@ i586-mingw32msvc-g++
 
  
 \backslash 
-
-\layout LyX-Code
-
-  RANLIB=
+\newline 
+RANLIB=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1262,9 +1298,8 @@ i586-mingw32msvc-ranlib
  
 \backslash 
 
-\layout LyX-Code
-
-  STRIP=
+\newline 
+STRIP=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1275,9 +1310,18 @@ i586-mingw32msvc-strip
  
 \backslash 
 
-\layout LyX-Code
+\newline 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
 
-  --prefix=
+-prefix=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1288,9 +1332,18 @@ i586-mingw32msvc-strip
  
 \backslash 
 
-\layout LyX-Code
+\newline 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
 
-  --datadir=
+-datadir=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1301,9 +1354,8 @@ i586-mingw32msvc-strip
  
 \backslash 
 
-\layout LyX-Code
-
-  docdir=
+\newline 
+docdir=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1314,9 +1366,8 @@ i586-mingw32msvc-strip
  
 \backslash 
 
-\layout LyX-Code
-
-  include_dir_suffix=
+\newline 
+include_dir_suffix=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1327,9 +1378,8 @@ include
  
 \backslash 
 
-\layout LyX-Code
-
-  lib_dir_suffix=
+\newline 
+lib_dir_suffix=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1340,9 +1390,8 @@ lib
  
 \backslash 
 
-\layout LyX-Code
-
-  sdccconf_h_dir_separator=
+\newline 
+sdccconf_h_dir_separator=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1361,19 +1410,56 @@ lib
  
 \backslash 
 
-\layout LyX-Code
+\newline 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
 
-  --disable-device-lib-build
+-disable-device-lib-build
 \backslash 
 
-\layout LyX-Code
+\newline 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
 
-  --disable-ucsim
+-disable-ucsim
 \backslash 
 
-\layout LyX-Code
+\newline 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-host=i586-mingw32msvc -
+\begin_inset ERT
+status Collapsed
 
-  --host=i586-mingw32msvc --build=unknown-unknown-linux-gnu
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-build=unknown-unknown-linux-gnu
 \layout Standard
 
 To 
@@ -1391,9 +1477,8 @@ compile on Cygwin for Mingw32(see also sdcc/support/scripts/sdcc_cygwin_mingw32)
 ./configure -C 
 \backslash 
 
-\layout LyX-Code
-
-  CFLAGS=
+\newline 
+CFLAGS=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1404,9 +1489,8 @@ compile on Cygwin for Mingw32(see also sdcc/support/scripts/sdcc_cygwin_mingw32)
  
 \backslash 
 
-\layout LyX-Code
-
-  LDFLAGS=
+\newline 
+LDFLAGS=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1417,9 +1501,18 @@ compile on Cygwin for Mingw32(see also sdcc/support/scripts/sdcc_cygwin_mingw32)
  
 \backslash 
 
-\layout LyX-Code
+\newline 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
 
-  --prefix=
+-prefix=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1430,9 +1523,18 @@ compile on Cygwin for Mingw32(see also sdcc/support/scripts/sdcc_cygwin_mingw32)
  
 \backslash 
 
-\layout LyX-Code
+\newline 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
 
-  --datadir=
+-datadir=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1443,9 +1545,8 @@ compile on Cygwin for Mingw32(see also sdcc/support/scripts/sdcc_cygwin_mingw32)
  
 \backslash 
 
-\layout LyX-Code
-
-  docdir=
+\newline 
+docdir=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1455,10 +1556,9 @@ compile on Cygwin for Mingw32(see also sdcc/support/scripts/sdcc_cygwin_mingw32)
 
  
 \backslash 
-
-\layout LyX-Code
-
-  include_dir_suffix=
+\newline 
+include_dir_suffix=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1469,9 +1569,8 @@ include
  
 \backslash 
 
-\layout LyX-Code
-
-  lib_dir_suffix=
+\newline 
+lib_dir_suffix=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1482,9 +1581,8 @@ lib
  
 \backslash 
 
-\layout LyX-Code
-
-  sdccconf_h_dir_separator=
+\newline 
+sdccconf_h_dir_separator=
 \begin_inset Quotes srd
 \end_inset 
 
@@ -1503,9 +1601,18 @@ lib
  
 \backslash 
 
-\layout LyX-Code
+\newline 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
 
-  --disable-ucsim
+-disable-ucsim
 \layout Standard
 
 'configure' is quite slow on Cygwin (at least on windows before Win2000/XP).
@@ -2813,10 +2920,10 @@ On OSX 2.x it was reported, that the default gcc (version 3.1 20020420 (prerelea
 ./configure CC=gcc2 CXX=g++2
 \layout Subsubsection
 
-Crosscompiling SDCC on Linux for Windows
+Cross compiling SDCC on Linux for Windows
 \layout Standard
 
-With the Mingw32 gcc crosscompiler it's easy to compile SDCC for Win32.
+With the Mingw32 gcc cross compiler it's easy to compile SDCC for Win32.
  See section 'Configure Options'.
 \layout Subsubsection
 
@@ -2961,7 +3068,17 @@ rxvt is a nice console with history.
  Replace in your cygwin.bat the line
 \layout LyX-Code
 
-bash --login -i 
+bash -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-login -i 
 \layout Standard
 
 with (one line):
@@ -2970,7 +3087,17 @@ with (one line):
 rxvt -sl 1000 -fn "Lucida Console-12" -sr -cr red
 \layout LyX-Code
 
-     -bg black -fg white -geometry 100x65 -e bash --login
+     -bg black -fg white -geometry 100x65 -e bash -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-login
 \layout Standard
 
 Text selected with the mouse is automatically copied to the clipboard, pasting
@@ -3035,7 +3162,7 @@ bin_vc.
 \backslash 
 bin_vc to sdcc
 \backslash 
-bin before runing SDCC.
+bin before running SDCC.
  
 \newline 
 
@@ -3189,10 +3316,10 @@ From the sdcc directory, run the command "make -f Makefile.bcc".
  sdcdb.exe (which currently doesn't build under Borland C++).
 \layout Enumerate
 
-If you modify any source files and need to rebuild, be aware that the dependanci
+If you modify any source files and need to rebuild, be aware that the dependenci
 es may not be correctly calculated.
  The safest option is to delete all .obj files and run the build again.
- From a Cygwin BASH prompt, this can easily be done with the commmand:
+ From a Cygwin BASH prompt, this can easily be done with the command:
 \newline 
 
 \newline 
@@ -3213,7 +3340,7 @@ find .
 \newline 
 
 \newline 
-or on Windows NT/2000/XP from the command prompt with the commmand:
+or on Windows NT/2000/XP from the command prompt with the command:
 \newline 
 
 \family sans 
@@ -3291,16 +3418,13 @@ Install and search paths
 Make sure the compiler works on a very simple example.
  Type in the following test.c program using your favorite 
 \series default 
-ascii 
+ASCII 
 \series medium 
 editor:
-\series default 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-
-\newline 
 char test;
 \newline 
 
@@ -3314,16 +3438,10 @@ void main(void) {
 test=0;
 \newline 
 }
-\family default 
-
-\newline 
-
-\emph on 
+\layout Standard
 
-\newline 
 
 \series medium 
-\emph default 
 Compile this using the following command: 
 \family sans 
 \series bold 
@@ -3383,11 +3501,8 @@ standard
 \series medium 
  header files and libraries.
  Edit test.c and change it to the following:
-\series default 
-
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 #include <string.h>
@@ -3405,11 +3520,9 @@ void main(void) {
 strcpy(str1, "testing");
 \newline 
 }
-\newline 
+\layout Standard
 
-\newline 
 
-\family default 
 \series medium 
 Compile this by typing 
 \family sans 
@@ -3426,6 +3539,21 @@ Compile this by typing
  
 \series medium 
 (see the Install trouble-shooting section for suggestions).
+
+\series default 
+ To find exactly where SDCC is looking for the include files try compiling
+ using 
+\family sans 
+\series bold 
+-
+\family default 
+\series default 
+V
+\begin_inset LatexCommand \index{-V}
+
+\end_inset 
+
+.
 \layout Subsection
 
 Install Trouble-shooting
@@ -3537,7 +3665,7 @@ Install and Search PATHS
 
 .
 \newline 
-On most systems you will need super-user privilages to do this.
+On most systems you will need super-user privileges to do this.
 \layout Subsection
 
 Components of SDCC
@@ -3664,13 +3792,13 @@ S51 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 website at: 
+ For more information visit Daniel's web site at: 
 \begin_inset LatexCommand \url{http://mazsola.iit.uni-miskolc.hu/~drdani/embedded/s51}
 
 \end_inset 
 
 .
- It currently support the core mcs51, the Dallas DS80C390 and the Philips
+ It currently support the core mcs51, the Dallas DS80C390 and the Phillips
  XA51 family.
 \layout Subsubsection
 
@@ -4048,6 +4176,14 @@ first
 \noun default 
  file specified in the command line, since the linkage editor processes
  file in the order they are presented to it.
+ The linker is invoked from sdcc using a script file with extension .lnk
+\begin_inset LatexCommand \index{.lnk}
+
+\end_inset 
+
+.
+ You can view this file to troubleshoot linking problems such as those arising
+ from missing libraries.
 \layout Subsubsection
 
 Projects with Additional Libraries
@@ -4107,9 +4243,14 @@ Note here that
 \newline 
 
 \newline 
-The most efficient way to use libraries is to keep seperate modules in seperate
+The most efficient way to use libraries is to keep separate modules in separate
  source files.
- The lib file now should name all the modules.rel files.
+ The lib file now should name all the modules.rel
+\begin_inset LatexCommand \index{rel}
+
+\end_inset 
+
+ files.
  For an example see the standard library file 
 \emph on 
 libsdcc.lib
@@ -4302,7 +4443,7 @@ p16f627 p16f628 p16f84 p16f873 p16f877?
 
 
 \series default 
- Generate code for the Philips XA51
+ Generate code for the Phillips XA51
 \begin_inset LatexCommand \index{XA51}
 
 \end_inset 
@@ -5550,7 +5691,7 @@ status Collapsed
 
 \series default 
  The compiler by default uses a caller saves convention for register saving
- across function calls, however this can cause unneccessary register pushing
+ across function calls, however this can cause unnecessary register pushing
  & popping when calling small functions from larger functions.
  This option can be used to switch the register saving convention for the
  function names specified.
@@ -5558,7 +5699,7 @@ status Collapsed
  code will be generated at the entry & exit for these functions to save
  & restore the registers used by these functions, this can SUBSTANTIALLY
  reduce code & improve run time performance of the generated code.
- In the future the compiler (with interprocedural analysis) will be able
+ In the future the compiler (with inter procedural analysis) will be able
  to determine the appropriate scheme to use for each function call.
  DO NOT use this option for built-in functions such as _mulint..., if this
  option is used for a library function the appropriate library function
@@ -6099,7 +6240,7 @@ status Collapsed
 
 \series default 
  Include i-codes in the asm file.
- Sounds like noise but is most helpfull for debugging the compiler itself.
+ Sounds like noise but is most helpful for debugging the compiler itself.
 \layout List
 \labelwidthstring 00.00.0000
 
@@ -6147,15 +6288,39 @@ status Collapsed
 
 \series default 
  Display the directories in the compiler's search path
-\layout Subsubsection
-
-Intermediate Dump Options
-\begin_inset LatexCommand \index{Options intermediate dump}
+\layout List
+\labelwidthstring 00.00.0000
 
-\end_inset 
 
+\series bold 
+-
+\begin_inset ERT
+status Collapsed
 
-\begin_inset LatexCommand \index{Intermediate dump options}
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-vc
+\begin_inset LatexCommand \index{-\/-print-search-dirs}
+
+\end_inset 
+
+
+\series default 
+ Display the errors and warnings using MSVC style, so you can use SDCC with
+ visual studio
+\layout Subsubsection
+
+Intermediate Dump Options
+\begin_inset LatexCommand \index{Options intermediate dump}
+
+\end_inset 
+
+
+\begin_inset LatexCommand \index{Intermediate dump options}
 
 \end_inset 
 
@@ -6573,7 +6738,7 @@ SDCC_LIB
 
 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 documentated.
+ They can change or disappear very quickly, and will never be documented.
 \layout Subsection
 
 MCS51/DS390 Storage Class
@@ -6603,9 +6768,8 @@ Variables declared with this storage class will be placed in the extern
 default
 \series default 
  storage class for Large Memory model, e.g.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 xdata unsigned char xduc;
@@ -6626,9 +6790,8 @@ default
  storage class for Small Memory model.
  Variables declared with this storage class will be allocated in the internal
  RAM, e.g.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 data int iramdata;
@@ -6644,9 +6807,8 @@ idata
 
 Variables declared with this storage class will be allocated into the indirectly
  addressable portion of the internal ram of a 8051, e.g.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 idata int idi;
@@ -6663,9 +6825,8 @@ bit
 This is a data-type and a storage class specifier.
  When a variable is declared as a bit, it is allocated into the bit addressable
  memory of 8051, e.g.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 bit iFlag;
@@ -6690,9 +6851,8 @@ sfr / sbit
 \emph default 
 signifies both a data-type and storage class, they are used to describe
  the special function registers and special bit variables of a 8051, eg:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 sfr at 0x80 P0; /* special function register P0 at location 0x80 */
@@ -6731,14 +6891,10 @@ SDCC allows (via language extensions) pointers to explicitly point to any
 
 \newline 
 Pointer declaration examples:
-\newline 
-
-\size small 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-\size default 
 /* pointer physically in xternal ram pointing to object in internal ram
  */ 
 \newline 
@@ -6758,17 +6914,12 @@ code unsigned char * code p;
 \newline 
 
 \newline 
-/* the folowing is a generic pointer physically located in xdata space */
+/* the following is a generic pointer physically located in xdata space
+ */
 \newline 
 char * xdata p;
-\family default 
-\size small 
-
-\newline 
-
-\newline 
+\layout Standard
 
-\size default 
 Well you get the idea.
  
 \newline 
@@ -6877,14 +7028,10 @@ reentrant
 
 \emph default 
  keyword in the function declaration, e.g.:
-\newline 
-
-\size small 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-\size default 
 unsigned char foo(char i) reentrant 
 \newline 
 { 
@@ -6893,11 +7040,8 @@ unsigned char foo(char i) reentrant
  
 \newline 
 }
-\newline 
-
-\family default 
+\layout Standard
 
-\newline 
 Since stack space on 8051 is limited, the 
 \emph on 
 reentrant 
@@ -6932,9 +7076,8 @@ Local variables can be assigned storage classes and absolute
 \end_inset 
 
  addresses, e.g.: 
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 unsigned char foo() {
@@ -6955,7 +7098,7 @@ bit bvar;
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-data at 0x31 unsiged char j;
+data at 0x31 unsigned char j;
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -6965,11 +7108,8 @@ data at 0x31 unsiged char j;
  
 \newline 
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 In the above example the variable 
 \emph on 
 i
@@ -7081,9 +7221,8 @@ tion
 
  will NOT be overlayed since these are implemented using external functions,
  e.g.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 #pragma SAVE 
@@ -7145,11 +7284,8 @@ set_error(10);
  
 \newline 
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 In the above example the parameter 
 \emph on 
 errcd
@@ -7172,9 +7308,8 @@ Interrupt Service Routines
 
 SDCC allows interrupt service routines to be coded in C, with some extended
  keywords.
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 void timer_isr (void) interrupt 2 using 1 
@@ -7185,11 +7320,8 @@ void timer_isr (void) interrupt 2 using 1
  
 \newline 
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 The number following the 
 \emph on 
 interrupt
@@ -7518,14 +7650,10 @@ critical
  SDCC will generate code to disable all interrupts upon entry to a critical
  function and enable them back before returning.
  Note that nesting critical functions may cause unpredictable results.
-\newline 
-
-\size small 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-\size default 
 int foo () critical 
 \newline 
 { 
@@ -7537,11 +7665,8 @@ int foo () critical
  
 \newline 
 }
-\newline 
-
-\family default 
+\layout Standard
 
-\newline 
 The critical attribute maybe used with other attributes like 
 \emph on 
 reentrant.
@@ -7592,9 +7717,8 @@ return
  This is particularly useful for interrupt functions, which can have a large
  (and often unnecessary) prologue/epilogue.
  For example, compare the code generated by these two functions:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 data unsigned char counter;
@@ -7670,15 +7794,11 @@ _endasm
 ;
 \newline 
 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 For an 8051 target, the generated simpleInterrupt looks like:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 _simpleIterrupt:
@@ -7815,15 +7935,11 @@ acc
 \SpecialChar ~
 \SpecialChar ~
 reti
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 whereas nakedInterrupt looks like:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 _nakedInterrupt:
@@ -7846,11 +7962,8 @@ reti\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 ; MUST explicitly include ret(i) in _naked function.
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 While there is nothing preventing you from writing C code inside a _naked
  function, there are many ways to shoot yourself in the foot doing this,
  and it is recommended that you stick to inline assembler.
@@ -7898,7 +8011,7 @@ non-interrupt
 \emph default 
  function (but may occasionally be useful anyway
 \begin_inset Foot
-collapsed true
+collapsed false
 
 \layout Standard
 
@@ -8197,7 +8310,7 @@ bit CPOL;\SpecialChar ~
 /*This is a variable, let the linker allocate this one*/
 \layout Standard
 
-and you can use the same hardware dependant routine without changes, as
+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
  specified in the whole project.
@@ -8299,14 +8412,13 @@ status Collapsed
 
 .
  This might cause some unexpected changes in the inline assembler code.
- Please go throught the peephole optimizer rules defined in file 
+ Please go through the peephole optimizer rules defined in file 
 \emph on 
 SDCCpeeph.def
 \emph default 
  carefully before using this option.
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 _asm
@@ -8345,14 +8457,8 @@ _endasm
 \end_inset 
 
  ;
-\family default 
-\size small 
-
-\newline 
-
-\newline 
+\layout Standard
 
-\size default 
 The inline assembler code can contain any valid code understood by the assembler
 , this includes any assembler directives and comment lines.
  The compiler does not do any validation of the code within the 
@@ -8372,9 +8478,8 @@ Inline assembler code cannot reference any C-Labels, however it can reference
 \end_inset 
 
  defined by the inline assembler, e.g.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 foo() { 
@@ -8448,13 +8553,10 @@ _endasm ;
 /* some more c code */
 \newline 
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 In other words inline assembly code can access labels defined in inline
- assembly within the scope of the funtion.
+ assembly within the scope of the function.
  The same goes the other way, ie.
  labels defines in inline assembly CANNOT be accessed by C statements.
 \layout Subsection
@@ -8475,7 +8577,8 @@ int (16 bit)
 For signed & unsigned int (16 bit) and long (32 bit) variables, division,
  multiplication and modulus operations are implemented by support routines.
  These support routines are all developed in ANSI-C to facilitate porting
- to other MCUs, although some model specific assembler optimations are used.
+ to other MCUs, although some model specific assembler optimizations are
+ used.
  The following files contain the described routine, all of them can be found
  in <installdir>/share/sdcc/lib.
 \newline 
@@ -8769,9 +8872,9 @@ Floating Point Support
 
 \layout Standard
 
-SDCC supports IEEE (single precision 4bytes) floating point numbers.The floating
- point support routines are derived from gcc's floatlib.c and consists 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 consists
of the following routines:
 \newline 
 
 \newline 
@@ -9435,7 +9538,7 @@ never
  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 seperate directories as small
+ The compiled library modules are contained in separate directories as small
  and large so that you can link to either set.
  
 \layout Standard
@@ -9460,7 +9563,7 @@ Judicious usage of the processor specific storage classes
  and the 'reentrant' function type will yield much more efficient code,
  than using the large model.
  Several optimizations are disabled when the program is compiled using the
- large model, it is therefore strongly recommdended that the small model
+ large model, it is therefore strongly recommended that the small model
  be used unless absolutely required.
 \layout Subsection
 
@@ -9739,132 +9842,266 @@ SDCC_MODEL_FLAT24
 -mds390
 \emph default 
  is used
-\layout Section
-\pagebreak_top 
-SDCC Technical Data
 \layout Subsection
 
-Optimizations
-\begin_inset LatexCommand \index{Optimizations}
+Redirecting output on Windows Shells
+\layout Standard
 
+SDCC writes it's error messages to 
+\begin_inset Quotes sld
 \end_inset 
 
+standard error
+\begin_inset Quotes srd
+\end_inset 
 
+.
+ The windows 95/98/me shell (command or cmd) can't redirect it to a file.
+ The solution is to use a reasonable shell or a helper program like redir.exe:
 \layout Standard
 
-SDCC performs a host of standard optimizations in addition to some MCU specific
- optimizations.
-\layout Subsubsection
 
-Sub-expression Elimination
-\begin_inset LatexCommand \index{Subexpression elimination}
+\begin_inset LatexCommand \url{http://www.cygwin.com/ml/cygwin/1999-02/msg00603.html}
 
 \end_inset 
 
 
 \layout Standard
 
-The compiler does local and global common subexpression elimination, e.g.:
-\newline 
 
-\newline 
+\begin_inset LatexCommand \url{ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/misc/redir.zip}
 
-\family typewriter 
-i = x + y + 1; 
-\newline 
-j = x + y;
-\family default 
+\end_inset 
 
-\newline 
 
-\newline 
-will be translated to
-\newline 
+\layout Standard
 
-\newline 
 
-\family typewriter 
-iTemp = x + y 
-\newline 
-i = iTemp + 1 
-\newline 
-j = iTemp
-\newline 
+\begin_inset LatexCommand \url{ftp://ftp.xraylith.wisc.edu/pub/khan/gnu-win32/mingw32/misc/README.redir}
 
-\family defaul
+\end_inse
 
-\newline 
-Some subexpressions are not as obvious as the above example, e.g.:
-\newline 
 
 \newline 
 
-\family typewriter 
-a->b[i].c = 10; 
 \newline 
-a->b[i].d = 11;
-\family default 
+If you are using a windows NT/2K/XP shell, you can redirect the 
+\begin_inset Quotes sld
+\end_inset 
 
-\newline 
+standard error
+\begin_inset Quotes srd
+\end_inset 
 
-\newline 
-In this case the address arithmetic a->b[i] will be computed only once;
- the equivalent code in C would be.
-\newline 
+ output to a file using 
+\begin_inset Quotes sld
+\end_inset 
 
+2>
+\begin_inset Quotes srd
+\end_inset 
+
+.
+ For example:
 \newline 
 
-\family typewriter 
-iTemp = a->b[i]; 
+\series bold 
+
 \newline 
-iTemp.c = 10; 
+sdcc -c foo.c 2> foo.err
 \newline 
-iTemp.d = 11;
-\family default 
 
 \newline 
 
-\newline 
-The compiler will try to keep these temporary variables in registers.
-\layout Subsubsection
+\series default 
+To append the 
+\begin_inset Quotes sld
+\end_inset 
 
-Dead-Code Elimination
-\begin_inset LatexCommand \index{Dead-code elimination}
+standard error
+\begin_inset Quotes srd
+\end_inset 
+
+ output of SDCC to a file you can use 
+\begin_inset Quotes sld
+\end_inset 
 
+2>>
+\begin_inset Quotes srd
 \end_inset 
 
+.
+ I you happen to have visual studio installed in your windows machine, you
+ can use it to compile your sources using a custom build and the SDCC -
+\emph on 
+
+\begin_inset ERT
+status Collapsed
 
 \layout Standard
 
+\backslash 
+/
+\end_inset 
 
-\family typewriter 
-int global; 
-\newline 
-void f () { 
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-int i; 
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-i = 1; \SpecialChar ~
-/* dead store */ 
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-global = 1;\SpecialChar ~
-/* dead store */ 
+
+\emph default 
+-vc option.
+ Something like this should work:
 \newline 
-\SpecialChar ~
-\SpecialChar ~
-global = 2; 
+
 \newline 
-\SpecialChar ~
-\SpecialChar ~
-return; 
+
+\series bold 
+c:
+\backslash 
+sdcc
+\backslash 
+bin
+\backslash 
+sdcc.exe -
+\series default 
+\emph on 
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+
+\series bold 
+\emph default 
+-vc -
+\series default 
+\emph on 
+
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+
+\series bold 
+\emph default 
+-model-large -c $(InputPath)
+\layout Section
+\pagebreak_top 
+SDCC Technical Data
+\layout Subsection
+
+Optimizations
+\begin_inset LatexCommand \index{Optimizations}
+
+\end_inset 
+
+
+\layout Standard
+
+SDCC performs a host of standard optimizations in addition to some MCU specific
+ optimizations.
+\layout Subsubsection
+
+Sub-expression Elimination
+\begin_inset LatexCommand \index{Subexpression elimination}
+
+\end_inset 
+
+
+\layout Standard
+
+The compiler does local and global common subexpression elimination, e.g.:
+\layout Verse
+
+
+\family typewriter 
+i = x + y + 1; 
+\newline 
+j = x + y;
+\layout Standard
+
+will be translated to
+\layout Verse
+
+
+\family typewriter 
+iTemp = x + y 
+\newline 
+i = iTemp + 1 
+\newline 
+j = iTemp
+\layout Standard
+
+Some subexpressions are not as obvious as the above example, e.g.:
+\layout Verse
+
+
+\family typewriter 
+a->b[i].c = 10; 
+\newline 
+a->b[i].d = 11;
+\layout Standard
+
+In this case the address arithmetic a->b[i] will be computed only once;
+ the equivalent code in C would be.
+\layout Verse
+
+
+\family typewriter 
+iTemp = a->b[i]; 
+\newline 
+iTemp.c = 10; 
+\newline 
+iTemp.d = 11;
+\layout Standard
+
+The compiler will try to keep these temporary variables in registers.
+\layout Subsubsection
+
+Dead-Code Elimination
+\begin_inset LatexCommand \index{Dead-code elimination}
+
+\end_inset 
+
+
+\layout Verse
+
+
+\family typewriter 
+int global; 
+\newline 
+void f () { 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+int i; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+i = 1; \SpecialChar ~
+/* dead store */ 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+global = 1;\SpecialChar ~
+/* dead store */ 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+global = 2; 
+\newline 
+\SpecialChar ~
+\SpecialChar ~
+return; 
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -9872,15 +10109,11 @@ global = 3;\SpecialChar ~
 /* unreachable */ 
 \newline 
 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 will be changed to
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 int global; void f () 
@@ -9904,7 +10137,7 @@ Copy-Propagation
 \end_inset 
 
 
-\layout Standard
+\layout Verse
 
 
 \family typewriter 
@@ -9927,15 +10160,11 @@ j = i;
 return j; 
 \newline 
 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 will be changed to 
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 int f() { 
@@ -9957,11 +10186,8 @@ int f() {
  return 10; 
 \newline 
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 Note: the dead stores created by this copy propagation will be eliminated
  by dead-code elimination.
 \layout Subsubsection
@@ -10015,9 +10241,8 @@ NOINDUCTION
 
 \newline 
 Loop Invariant:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 for (i = 0 ; i < 100 ; i ++) 
@@ -10025,15 +10250,11 @@ for (i = 0 ; i < 100 ; i ++)
  \SpecialChar ~
  \SpecialChar ~
 f += k + l;
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 changed to
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 itemp = k + l; 
@@ -10043,11 +10264,8 @@ for (i = 0; i < 100; i++)
 \SpecialChar ~
 \SpecialChar ~
 f += itemp;
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 As mentioned previously some loop invariants are not as apparent, all static
  address computations are also moved out of the loop.
 \newline 
@@ -10059,9 +10277,8 @@ Strength Reduction
 \end_inset 
 
 , this optimization substitutes an expression by a cheaper expression:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 for (i=0;i < 100; i++)
@@ -10069,15 +10286,11 @@ for (i=0;i < 100; i++)
 \SpecialChar ~
 \SpecialChar ~
 ar[i*5] = i*3;
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 changed to
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 itemp1 = 0; 
@@ -10099,11 +10312,8 @@ itemp1 += 5;
 itemp2 += 3; 
 \newline 
 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 The more expensive multiplication
 \begin_inset LatexCommand \index{Multiplication}
 
@@ -10142,8 +10352,8 @@ The 'for' loop is of the form
 \newline 
 
 \family typewriter 
-for (<symbol> = <expression> ; <sym> [< | <=] <expression> ; [<sym>++ |
<sym> += 1])
+for(<symbol> = <expression>; <sym> [< | <=] <expression>; [<sym>++ | <sym>
+ += 1])
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -10188,9 +10398,8 @@ Algebraic Simplifications
 
 SDCC does numerous algebraic simplifications, the following is a small sub-set
  of these optimizations.
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 i = j + 0 ; /* changed to */ i = j; 
@@ -10200,11 +10409,8 @@ i /= 2; /* changed to */ i >>= 1;
 i = j - j ; /* changed to */ i = 0; 
 \newline 
 i = j / 1 ; /* changed to */ i = j;
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 Note the subexpressions
 \begin_inset LatexCommand \index{Subexpression}
 
@@ -10233,9 +10439,9 @@ SDCC changes switch statements to jump tables
 
 The case labels are in numerical sequence, the labels need not be in order,
  and the starting number need not be one or zero.
-\newline 
+\begin_deeper 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 switch(i) {\SpecialChar ~
@@ -10340,12 +10546,10 @@ case 4: ...
  \SpecialChar ~
  \SpecialChar ~
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 Both the above switch statements will be implemented using a jump-table.
+\end_deeper 
 \layout Itemize
 
 The number of case labels is at least three, since it takes two conditional
@@ -10360,97 +10564,117 @@ The number of case labels is less than 84, since each label takes 3 bytes
 Switch statements which have gaps in the numeric sequence or those that
  have more that 84 case labels can be split into more than one switch statement
  for efficient code generation, e.g.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 switch (i) { 
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 1: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 2: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 3: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 4: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 9: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 10: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 11: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 12: ...
  
 \newline 
 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 If the above switch statement is broken down into two switch statements
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 switch (i) { 
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 1: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 2: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 3: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 4: ...
  
 \newline 
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 and
-\family typewriter 
+\layout Verse
 
-\newline 
 
-\newline 
+\family typewriter 
 switch (i) { 
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 9: \SpecialChar ~
 ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 10: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 11: ...
  
 \newline 
+\SpecialChar ~
+\SpecialChar ~
 case 12:\SpecialChar ~
 ...
  
 \newline 
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 then both the switch statements will be implemented using jump-tables whereas
  the unmodified switch statement will not be.
 \layout Subsubsection
@@ -10467,11 +10691,10 @@ Bit shifting is one of the most frequently used operation in embedded programmin
 g.
  SDCC tries to implement bit-shift operations in the most efficient way
  possible, e.g.:
-\newline 
+\layout Verse
 
-\family typewriter 
 
-\newline 
+\family typewriter 
 unsigned char i;
 \newline 
 ...
@@ -10480,17 +10703,13 @@ unsigned char i;
 i>>= 4; 
 \newline 
 ...
-\newline 
-
-\family default 
+\layout Standard
 
-\newline 
 generates the following code:
-\newline 
+\layout Verse
 
-\family typewriter 
 
-\newline 
+\family typewriter 
 mov a,_i 
 \newline 
 swap a 
@@ -10498,16 +10717,12 @@ swap a
 anl a,#0x0f 
 \newline 
 mov _i,a
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 In general SDCC will never setup a loop if the shift count is known.
  Another example:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 unsigned int i; 
@@ -10518,15 +10733,11 @@ unsigned int i;
 i >>= 9; 
 \newline 
 ...
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 will generate:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 mov a,(_i + 1) 
@@ -10538,11 +10749,8 @@ clr c
 rrc a 
 \newline 
 mov _i,a
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 Note that SDCC stores numbers in little-endian format (i.e.
  lowest order first).
 \layout Subsubsection
@@ -10557,9 +10765,8 @@ Bit-rotation
 
 A special case of the bit-shift operation is bit rotation, SDCC recognizes
  the following expression to be a left bit-rotation:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 unsigned char i; 
@@ -10571,14 +10778,14 @@ i = ((i << 1) | (i >> 7));
 \family default 
 
 \newline 
+
+\family typewriter 
 ...
-\newline 
+\layout Standard
 
-\newline 
 will generate the following code:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 mov a,_i 
@@ -10586,16 +10793,12 @@ mov a,_i
 rl a 
 \newline 
 mov _i,a
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 SDCC uses pattern matching on the parse tree to determine this operation.Variatio
 ns of this case will also be recognized as bit-rotation, i.e.: 
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 i = ((i >> 7) | (i << 1)); /* left-bit rotation */
@@ -10613,10 +10816,9 @@ 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.:
-\newline 
+\layout Verse
+
 
-\newline 
 \family typewriter 
 unsigned int gint; 
 \newline 
@@ -10641,20 +10843,13 @@ hob = (gint >> 15) & 1;
  
 \newline 
 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 will generate the following code:
-\newline 
+\layout Verse
 
-\family typewriter 
 
-\newline 
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
+\family typewriter 
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -10683,9 +10878,7 @@ will generate the following code:
  61 ;\SpecialChar ~
  hob.c 7 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
- 000A E5*01\SpecialChar ~
+000A E5*01\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -10711,9 +10904,7 @@ will generate the following code:
  mov\SpecialChar ~
  a,(_gint + 1) 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
- 000C 33\SpecialChar ~
+000C 33\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -10742,9 +10933,7 @@ will generate the following code:
  rlc\SpecialChar ~
  a 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
- 000D E4\SpecialChar ~
+000D E4\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -10773,9 +10962,7 @@ will generate the following code:
  clr\SpecialChar ~
  a 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
- 000E 13\SpecialChar ~
+000E 13\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -10804,9 +10991,7 @@ will generate the following code:
  rrc\SpecialChar ~
  a 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
- 000F F5*02\SpecialChar ~
+000F F5*02\SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
@@ -10831,11 +11016,8 @@ will generate the following code:
 \SpecialChar ~
  mov\SpecialChar ~
  _foo_hob_1_1,a
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 Variations of this case however will 
 \emph on 
 not
@@ -10845,17 +11027,13 @@ not
  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.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 xyz = gint + ((gint >> 15) & 1);
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 will still be recognized.
 \layout Subsubsection
 
@@ -10897,9 +11075,8 @@ status Collapsed
 \emph default 
  option.
  The rule language is best illustrated with examples.
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 replace { 
@@ -10919,69 +11096,46 @@ mov a,%1
 mov %1,a
 \newline 
 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 The above rule will change the following assembly
 \begin_inset LatexCommand \index{Assembler routines}
 
 \end_inset 
 
  sequence:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-\SpecialChar ~
-\SpecialChar ~
 mov r1,a 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
 mov a,r1
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 to
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 mov r1,a
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 Note: All occurrences of a 
 \emph on 
 %n
 \emph default 
  (pattern variable) must denote the same string.
  With the above rule, the assembly sequence:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-\SpecialChar ~
-\SpecialChar ~
 mov r1,a 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
 mov a,r2
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 will remain unmodified.
 \newline 
 
@@ -11026,21 +11180,15 @@ ajmp
  and 
 \family typewriter 
 acall
-\family default 
-
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 replace { lcall %1 } by { acall %1 } 
 \newline 
 replace { ljmp %1 } by { ajmp %1 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 The 
 \emph on 
 inline-assembler code
@@ -11055,9 +11203,8 @@ e is MCU independent.
 
 \newline 
 The syntax for a rule is as follows:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 rule := replace [ restart ] '{' <assembly sequence> '
  '}' [if <functionName> ] '
 \backslash 
 n' 
-\newline 
-
-\family default 
+\layout Standard
 
-\newline 
 <assembly sequence> := assembly instruction (each instruction including
  labels must be on a separate line).
 \newline 
@@ -11137,9 +11281,8 @@ The optimizer will apply to the rules one by one from the top in the sequence
  the same rule again.
  An example of this (not a good one, it has side effects) is the following
  rule:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 replace restart { 
@@ -11157,90 +11300,56 @@ push %1 } by {
 ; nop 
 \newline 
 }
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 Note that the replace pattern cannot be a blank, but can be a comment line.
  Without the 'restart' option only the inner most 'pop' 'push' pair would
  be eliminated, i.e.:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-\SpecialChar ~
-\SpecialChar ~
 pop ar1 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
 pop ar2 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
 push ar2 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
 push ar1
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 would result in:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-\SpecialChar ~
-\SpecialChar ~
 pop ar1 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
 ; nop 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
 push ar1
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 
 \emph on 
 with
 \emph default 
  the restart option the rule will be applied again to the resulting code
  and then all the pop-push pairs will be eliminated to yield:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
-\SpecialChar ~
-\SpecialChar ~
 ; nop 
 \newline 
-\SpecialChar ~
-\SpecialChar ~
 ; nop
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 A conditional function can be attached to a rule.
  Attaching rules are somewhat more involved, let me illustrate this with
  an example.
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 replace { 
@@ -11262,11 +11371,8 @@ sjmp %5
 %2:
 \newline 
 } if labelInRange
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 The optimizer does a look-up of a function name table defined in function
  
 \emph on 
@@ -11445,7 +11551,7 @@ CALLEE-SAVES
 
  function1[,function2[,function3...]] - The compiler by default uses a caller
  saves convention for register saving across function calls, however this
- can cause unneccessary register pushing & popping when calling small functions
+ can cause unnecessary register pushing & popping when calling small functions
  from larger functions.
  This option can be used to switch off the register saving convention for
  the function names specified.
@@ -11453,7 +11559,7 @@ CALLEE-SAVES
  code need to be manually inserted at the entry & exit for these functions
  to save & restore the registers used by these functions, this can SUBSTANTIALLY
  reduce code & improve run time performance of the generated code.
- In the future the compiler (with interprocedural analysis) may be able
+ In the future the compiler (with inter procedural analysis) may be able
  to determine the appropriate scheme to use for each function call.
  If -
 \begin_inset ERT
@@ -11483,9 +11589,8 @@ The pragma's are intended to be used to turn-off certain optimizations which
  are used to control options & optimizations for a given function; pragmas
  should be placed before and/or after a function, placing pragma's inside
  a function body could have unpredictable results.
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 #pragma SAVE
@@ -11535,11 +11640,8 @@ int foo ()
 \end_inset 
 
  /* turn the optimizations back on */
-\family default 
-
-\newline 
+\layout Standard
 
-\newline 
 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.
@@ -11633,11 +11735,10 @@ Assembler Routine(non-reentrant
 
 \layout Standard
 
-In the following example the function cfunc calls an assembler routine asm_func,
- which takes two parameters.
-\newline 
+In the following example the function c_func calls an assembler routine
asm_func, which takes two parameters.
+\layout Verse
 
-\newline 
 
 \family typewriter 
 extern int asm_func(unsigned char, unsigned char);
@@ -11669,15 +11770,11 @@ int main()
 return c_func(10,9);
 \newline 
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 The corresponding assembler function is:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 .globl _asm_func_PARM_2 
@@ -11754,7 +11851,7 @@ add    a,_asm_func_PARM_2
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-mov     dpl,a 
+mov    dpl,a 
 \newline 
 \SpecialChar ~
 \SpecialChar ~
@@ -11764,7 +11861,11 @@ mov     dpl,a
 \SpecialChar ~
 \SpecialChar ~
 \SpecialChar ~
-mov   dpl
+mov\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+dpl
 \begin_inset LatexCommand \index{DPTR, DPH, DPL}
 
 \end_inset 
@@ -11780,11 +11881,8 @@ mov   dpl
 \SpecialChar ~
 \SpecialChar ~
 ret
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 Note here that the return values are placed in 'dpl' - One byte return value,
  'dpl' LSB & 'dph' MSB for two byte values.
  'dpl', 'dph' and 'b' for three byte values (generic pointers) and 'dpl','dph','
@@ -11825,8 +11923,8 @@ acc,b,dptr
 \begin_inset Quotes erd
 \end_inset 
 
- for four bytes, the varible name for the second parameter will be _<function_na
-me>_PARM_2.
+ for four bytes, the variable name for the second parameter will be _<function_n
+ame>_PARM_2.
 \newline 
 
 \newline 
@@ -11872,9 +11970,8 @@ In this case the second parameter onwards will be passed on the stack, the
  parameters are pushed from right to left i.e.
  after the call the left most parameter will be on the top of the stack.
  Here is an example:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 extern int asm_func(unsigned char, unsigned char);
@@ -11906,15 +12003,11 @@ int main()
 return c_func(10,9); 
 \newline 
 }
-\newline 
-
-\family default 
+\layout Standard
 
-\newline 
 The corresponding assembler routine is:
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 .globl _asm_func 
@@ -12016,11 +12109,8 @@ pop  _bp
 \SpecialChar ~
 \SpecialChar ~
 ret
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 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
@@ -12083,7 +12173,7 @@ ANSI-Compliance
 
 \layout Standard
 
-Deviations from the compliancy.
+Deviations from the compliance:
 \layout Itemize
 
 functions are not always reentrant.
@@ -12092,11 +12182,11 @@ functions are not always reentrant.
 structures 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.:
-\family typewriter 
+\begin_deeper 
+\layout Verse
 
-\newline 
 
-\newline 
+\family typewriter 
 struct s { ...
  }; 
 \newline 
@@ -12128,8 +12218,8 @@ s1 = s2 ; /* is invalid in SDCC although allowed in ANSI */
 \newline 
 }
 \newline 
-struct s foo1 (struct s parms) /* is invalid in SDCC although allowed in
- ANSI */ 
+struct s foo1 (struct s parms) /* invalid in SDCC although allowed in ANSI
+ */
 \newline 
 { 
 \newline 
@@ -12153,6 +12243,7 @@ struct s rets;
 return rets;/* is invalid in SDCC although allowed in ANSI */ 
 \newline 
 }
+\end_deeper 
 \layout Itemize
 
 'long long
@@ -12190,11 +12281,11 @@ Old K&R style
 \end_inset 
 
  function declarations are NOT allowed.
-\newline 
+\begin_deeper 
+\layout Verse
 
-\family typewriter 
 
-\newline 
+\family typewriter 
 foo(i,j) /* this old style of function declarations */ 
 \newline 
 int i,j; /* are valid in ANSI but not valid in SDCC */ 
@@ -12209,14 +12300,15 @@ int i,j; /* are valid in ANSI but not valid in SDCC */
  
 \newline 
 }
+\end_deeper 
 \layout Itemize
 
 functions declared as pointers must be dereferenced during the call.
-\newline 
+\begin_deeper 
+\layout Verse
 
-\family typewriter 
 
-\newline 
+\family typewriter 
 int (*foo)();
 \newline 
 ...
@@ -12224,7 +12316,8 @@ int (*foo)();
 \newline 
 /* has to be called like this */ 
 \newline 
-(*foo)(); /* ansi standard allows calls to be made like 'foo()' */
+(*foo)(); /* ANSI standard allows calls to be made like 'foo()' */
+\end_deeper 
 \layout Subsection
 
 Cyclomatic Complexity
@@ -12302,53 +12395,61 @@ r should do an explicit cast when integral promotion is required.
 Reducing the size of division, multiplication & modulus operations can reduce
  code size substantially.
  Take the following code for example.
-\family typewriter 
+\begin_deeper 
+\layout Verse
 
-\newline 
 
-\newline 
+\family typewriter 
 foobar(unsigned int p1, unsigned char ch)
 \newline 
 {
 \newline 
-    unsigned char ch1 = p1 % ch ;
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+unsigned char ch1 = p1 % ch ;
 \newline 
-    ....
-    
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+....
 \newline 
 }
-\newline 
-
-\family default 
+\layout Standard
 
-\newline 
 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 
-\newline 
+\layout Verse
 
-\family typewriter 
 
-\newline 
+\family typewriter 
 foobar(unsigned int p1, unsigned char ch)
 \newline 
 {
 \newline 
-    unsigned char ch1 = (unsigned char)p1 % ch ;
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+unsigned char ch1 = (unsigned char)p1 % ch ;
 \newline 
-    ....
-    
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+....
 \newline 
 }
-\newline 
-
-\family default 
+\layout Standard
 
-\newline 
 It would substantially reduce the code generated (future versions of the
- compiler will be smart enough to detect such optimization oppurtunities).
+ compiler will be smart enough to detect such optimization opportunities).
+\end_deeper 
 \layout Subsection
 
 Notes on MCS51 memory
@@ -12374,17 +12475,17 @@ The 8051 family of microcontrollers have a minimum of 128 bytes of internal
 
 \layout Standard
 
-Adittionally some members of the MCS51 family may have up to 128 bytes of
+Additionally some members of the MCS51 family may have up to 128 bytes of
  additional, indirectly addressable, internal RAM memory (
 \emph on 
 idata
 \emph default 
 ).
- Furtermore, some chips may have some built in external memory (
+ Furthermore, some chips may have some built in external memory (
 \emph on 
 xdata
 \emph default 
-) which should not be confused with the internal, direclty addressable RAM
+) which should not be confused with the internal, directly addressable RAM
  memory (
 \emph on 
 data
@@ -12494,8 +12595,8 @@ status Collapsed
 
  allows you to specify the start of the stack, i.e.
  you could start it after any data in the general purpose area.
- If your microcontroller has aditional indirectly addressable internal RAM
- (
+ If your microcontroller has additional indirectly addressable internal
RAM (
 \emph on 
 idata
 \emph default 
@@ -12567,7 +12668,7 @@ status Collapsed
 
 .
  If in doubt, don't specify any options and see if the resulting memory
- layout is appropiate, then you can twik it.
+ layout is appropriate, then you can adjust it.
 \layout Standard
 
 The 8051 linker generates two files with memory allocation information.
@@ -13629,7 +13730,7 @@ foo.c - the source file.
 foo.cdb - the debugger symbol information file.
 \layout Itemize
 
-foo.ihx - the intel hex format
+foo.ihx - the Intel hex format
 \begin_inset LatexCommand \index{Intel hex format}
 
 \end_inset 
@@ -14668,15 +14769,15 @@ The Z80 and gbz80 port
 
 SDCC can target both the Zilog Z80 and the Nintendo Gameboy's Z80-like gbz80.
  The port is incomplete - long support is incomplete (mul, div and mod are
- unimplimented), and both float and bitfield support is missing.
+ unimplemented), and both float and bitfield support is missing.
  Apart from that the code generated is correct.
 \layout Standard
 
 As always, the code is the authoritave reference - see z80/ralloc.c and z80/gen.c.
  The stack frame is similar to that generated by the IAR Z80 compiler.
  IX is used as the base pointer, HL is used as a temporary register, and
- BC and DE are available for holding varibles.
- IY is currently unusued.
+ BC and DE are available for holding variables.
+ IY is currently unused.
  Return values are stored in HL.
  One bad side effect of using IX as the base pointer is that a functions
  stack frame is limited to 127 bytes - this will be fixed in a later version.
@@ -14756,7 +14857,7 @@ The recommended way of reporting bugs is using the infrastructure of the
 Bug reports are automatically forwarded to the developer mailing list and
  will be fixed ASAP.
  When reporting a bug, it is very useful to include a small test program
- which reproduces the problem.
(the smaller the better) which reproduces the problem.
  If you can isolate the problem by looking at the generated assembly code,
  this can be very helpful.
  Compiling your program with the -
@@ -14775,6 +14876,33 @@ status Collapsed
 \end_inset 
 
  option can sometimes be useful in locating optimization problems.
+ When reporting a bug please maker sure you:
+\layout Enumerate
+
+Attach the code you are compiling with SDCC.
+\layout Enumerate
+
+Specify the exact command you use to run SDCC, or attach your Makefile.
+\layout Enumerate
+
+Specify the SDCC version (type "sdcc -v"), your platform, and operating
+ system.
+\layout Enumerate
+
+Provide an exact copy of any error message or incorrect output.
+\layout Standard
+
+Please attempt to include these 4 important parts, as applicable, in all
+ requests for support or when reporting any problems or bugs with SDCC.
+ Though this will make your message lengthy, it will greatly improve your
+ chance that SDCC users and developers will be able to help you.
+ Some SDCC developers are frustrated by bug reports without code provided
+ that they can use to reproduce and ultimately fix the problem, so please
+ be sure to provide sample code if you are reporting a bug! 
 \layout Standard
 
 Please have a short check that you are using a recent version of SDCC and
@@ -14820,7 +14948,7 @@ These links should take you directly to the
 
 
 \begin_inset Foot
-collapsed false
+collapsed true
 
 \layout Standard
 
@@ -14837,7 +14965,7 @@ Traffic on sdcc-devel and sdcc-user is about 100 mails/month each not counting
  a similar problem.
 \layout Subsection
 
-Changelog
+ChangeLog
 \begin_inset LatexCommand \index{Changelog}
 
 \end_inset 
@@ -14871,7 +14999,19 @@ Historically there often were long delays between official releases and
  Current excuses might refer to problems with live range analysis, but if
  this is fixed, the next problem rising is that another excuse will have
  to be found.
- Kidding aside, we have to get better there!
+ Kidding aside, we have to get better there! On the other hand there are
+ daily snapshots available at 
+\begin_inset LatexCommand \htmlurl[snap]{http://sdcc.sourceforge.net/snap.php}
+
+\end_inset 
+
+, and you can always built the very last version (hopefully with many bugs
+ fixed, and features added) from the source code available at 
+\begin_inset LatexCommand \htmlurl[Source]{http://sdcc.sourceforge.net/snap.php#Source}
+
+\end_inset 
+
+.
 \layout Subsection
 
 Examples
@@ -14886,7 +15026,7 @@ You'll find some small examples in the directory sdcc/device/examples/
 \layout Comment
 
 Maybe we should include some links to real world applications.
- Preferrably pointer to pointers (one for each architecture) so this stays
+ Preferably pointer to pointers (one for each architecture) so this stays
  manageable here?
 \layout Subsection
 
@@ -14972,7 +15112,7 @@ The anatomy of the compiler
 
 
 \shape italic 
-This is an excerpt from an atricle published in Circuit Cellar MagaZine
+This is an excerpt from an article published in Circuit Cellar Magazine
  in august 2000.
  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.
@@ -15129,9 +15269,8 @@ ICode Example
 This section shows some details of iCode.
  The example C code does not do anything useful; it is used as an example
  to illustrate the intermediate code generated by the compiler.
-\newline 
+\layout Verse
 
-\newline 
 
 \family typewriter 
 1.\SpecialChar ~
@@ -15195,7 +15334,21 @@ mul = 0;
 \newline 
 15.\SpecialChar ~
 \SpecialChar ~
-for (i = 0, j = 10 ; i < 10 ; i++, j--) {
+for (i = 0, j = 10 ; i < 10 ; i++, j
+\family default 
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
+\backslash 
+/
+\end_inset 
+
+-
+\family typewriter 
+) {
 \newline 
 16.\SpecialChar ~
 \SpecialChar ~
@@ -15225,11 +15378,8 @@ return sum+mul;
 \newline 
 21.\SpecialChar ~
 }
-\newline 
-
-\newline 
+\layout Standard
 
-\family default 
 In addition to the operands each iCode contains information about the filename
  and line it corresponds to in the source file.
  The first field in the listing should be interpreted as follows: