-#LyX 1.5.0 created this file. For more info see http://www.lyx.org/
+#LyX 1.4.5 created this file. For more info see http://www.lyx.org/
\lyxformat 245
\begin_document
\begin_header
\papersides 1
\paperpagestyle fancy
\tracking_changes false
-\output_changes false
-\author ""
-\author ""
+\output_changes true
\end_header
\begin_body
\begin_layout Date
\size normal
-SDCC 2.7.3
+SDCC 2.8.0
\size footnotesize
\newline
\end_inset
.
+
+\series bold
+\series default
\emph on
Please note: the compiler will probably always be some steps ahead of this
documentation
\begin_layout Itemize
char type parameters to vararg
-\begin_inset LatexCommand \index{vararg, va\\_arg}
+\begin_inset LatexCommand \index{vararg, va\_arg}
+
+\end_inset
+
+ functions are casted to int unless explicitly casted and
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
\end_inset
- functions are casted to int unless explicitly casted
+-std-c89
+\begin_inset LatexCommand \index{-\/-std-c89}
+
+\end_inset
+
+
+\series default
+and
+\series bold
+ -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c99
+\begin_inset LatexCommand \index{-\/-std-c99}
+
+\end_inset
+
+
+\series default
+ command line option are not defined
\begin_inset Marginal
status collapsed
\family default
\newline
- will push a as an int and as a char resp.
+ will push a as an int and as a char resp if
+\series bold
+ -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c89
+\begin_inset LatexCommand \index{-\/-std-c89}
+
+\end_inset
+
+
+\series default
+and
+\series bold
+ -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c99
+\begin_inset LatexCommand \index{-\/-std-c99}
+
+\end_inset
+
+
+\series default
+ command line options are not defined,
+\newline
+ will push a as two ints if
+\series bold
+ -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c89
+\begin_inset LatexCommand \index{-\/-std-c89}
+
+\end_inset
+
+
+\series default
+or
+\series bold
+ -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c99
+\begin_inset LatexCommand \index{-\/-std-c99}
+
+\end_inset
+
+
+\series default
+ command line option is defined.
\end_layout
\begin_layout Itemize
\end_inset
-\begin_inset LatexCommand \index{\\_\\_sbit}
+\begin_inset LatexCommand \index{\_\_sbit}
\end_inset
\InsetSpace ~
\InsetSpace ~
b = ~
-\begin_inset LatexCommand \index{\\~\\/ Operator}
+\begin_inset LatexCommand \index{\~\/ Operator}
\end_inset
\begin_layout Enumerate
\series medium
-Unpack the file using a command like:
-\series default
-
+Unpack the file using a command like:
\family sans
\series bold
"tar -xvzf sdcc-src-yyyymmdd-rrrr.tar.bz2
\begin_layout Enumerate
\series medium
-Type
-\series default
-
+Type
\family sans
\series bold
"./configure
\begin_layout Enumerate
\series medium
-Type
-\series default
-
+Type
\family sans
\series bold
"make
\begin_layout Enumerate
\series medium
-Type
-\series default
-
+Type
\family sans
\series bold
"make install"
./configure CC=gcc2 CXX=g++2
\end_layout
+\begin_layout Standard
+Universal (ppc and i386) binaries can be produced on Mac OS X 10.4.x with
+ Xcode.
+ Run 'configure' with:
+\end_layout
+
+\begin_layout LyX-Code
+./configure
+\backslash
+
+\end_layout
+
+\begin_layout LyX-Code
+LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch
+ ppc"
+\backslash
+
+\end_layout
+
+\begin_layout LyX-Code
+CXXFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch
+ ppc"
+\backslash
+
+\end_layout
+
+\begin_layout LyX-Code
+CFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
+\end_layout
+
\begin_layout Subsection
Cross compiling SDCC on Linux for Windows
\end_layout
Make sure that the sdcc bin directory is in your executable search path
defined by the PATH environment setting (
\series medium
-see
+see
\series default
- section
+section
\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
\end_inset
\newline
\series medium
-SDCC
+SDCC
\series default
- is commonly installed as described in section
+is commonly installed as described in section
\begin_inset Quotes sld
\end_inset
\series medium
Make sure the compiler works on a very simple example.
- Type in the following test.c program using your favorite
+ Type in the following test.c program using your favorite
\series default
- ASCII
+ASCII
\series medium
editor:
\end_layout
\begin_layout Standard
\series medium
-Compile this using the following command:
-\series default
-
+Compile this using the following command:
\family sans
\series bold
"sdcc -c test.c".
\series medium
The next step is to try it with the linker.
- Type in
-\series default
-
+ Type in
\family sans
\series bold
"sdcc test.c
\series medium
(no test.ihx, and the linker generates warnings), then the problem is most
- likely that
+ likely that
\series default
- SDCC
+SDCC
\series medium
-cannot find the
+ cannot find the
\series default
- /
+/
\series medium
usr/local/share/sdcc/lib directory
\series default
\series medium
-(see
+(see
\series default
- section
+section
\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
\end_inset
\newline
\series medium
-The final test is to ensure
+The final test is to ensure
\series default
- SDCC
+SDCC
\series medium
-can use the
+ can use the
\series default
- standard
+standard
\series medium
-header files and libraries.
+ header files and libraries.
Edit test.c and change it to the following:
\end_layout
\begin_layout Standard
\series medium
-Compile this by typing
-\series default
-
+Compile this by typing
\family sans
\series bold
"sdcc test.c"
.
This should generate a test.ihx output file, and it should give no warnings
such as not finding the string.h file.
- If it cannot find the string.h file, then the problem is that
+ If it cannot find the string.h file, then the problem is that
\series default
- SDCC
+SDCC
\series medium
-cannot find the /usr/local/share/sdcc/include directory
+ cannot find the /usr/local/share/sdcc/include directory
\series default
\series medium
-(see the
+(see the
\series default
- section
+section
\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
\end_inset
-print-search-dirs
\series default
-\begin_inset LatexCommand \index{-\\/-print-search-dirs}
+\begin_inset LatexCommand \index{-\/-print-search-dirs}
\end_inset
\begin_layout Itemize
as-z80
\series bold
-,
+,
\series default
- as-gbz80 - The Z80 and GameBoy Z80 assemblers.
+as-gbz80 - The Z80 and GameBoy Z80 assemblers.
\end_layout
\begin_layout Itemize
\begin_layout Itemize
link-z80
\series bold
-,
+,
\series default
- link-gbz80 - The Z80 and GameBoy Z80 linkers.
+link-gbz80 - The Z80 and GameBoy Z80 linkers.
\end_layout
\begin_layout Itemize
\end_inset
-out-fmt-s19
-\begin_inset LatexCommand \index{-\\/-out-fmt-s19}
+\begin_inset LatexCommand \index{-\/-out-fmt-s19}
\end_inset
\end_inset
- or
+ or
\family sans
\shape italic
-srecord
+ srecord
\family default
\shape default
\end_inset
-debug
-\begin_inset LatexCommand \index{-\\/-debug}
+\begin_inset LatexCommand \index{-\/-debug}
\end_inset
\end_inset
-debug).
- The (Intel)
+ The (Intel)
\emph on
-a
+ a
\emph default
bsolute
\emph on
\newline
\newline
-
+
\family sans
\series bold
-packihx sourcefile.ihx >sourcefile.hex
+ packihx sourcefile.ihx >sourcefile.hex
\family default
\series default
\newline
\newline
-The separately available
+The separately available
\emph on
-srecord
+ srecord
\emph default
\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
\newline
Alternatively,
\emph on
-foomain.c
+foomain.c
\emph default
- can be separately compiled as well:
+can be separately compiled as well:
\family sans
\series bold
\emph on
main()
\emph default
- function
+ function
+\emph on
+
+\emph default
\noun on
must
\noun default
\emph on
foomain.c
\emph default
- and a library
+ and a library
\emph on
-foolib.lib
+ foolib.lib
\emph default
in the directory
\emph on
\family default
\series default
-Note here that
+Note here that
\emph on
-mylib
+ mylib
\emph default
must be an absolute path name.
\newline
\family sans
\series bold
sdcclib libint.lib _mulint.rel
+\family default
\series default
\newline
\begin_layout Standard
Or, if you preffer:
+\family sans
+\series bold
+
\newline
\end_layout
\family sans
\series bold
sdcclib libint.lib _divsint.rel _divuint.rel _modsint.rel _moduint.rel _mulint.rel
+\family default
+\series default
+
\newline
\end_layout
If a list of .rel files is available, you can tell sdcclib to add those
files to a library.
For example, if the file 'myliblist.txt' contains
+\family sans
+\series bold
+
\newline
\end_layout
\family sans
\series bold
_mulint.rel
+\family default
\series default
\newline
\end_layout
\begin_layout Standard
-Use
+Use
+\family sans
+\series bold
+
\newline
\end_layout
\family sans
\series bold
sdcclib -l libint.lib myliblist.txt
-\newline
-
-\end_layout
-
-\begin_layout Standard
-Additionally, you can instruct sdcclib to compile the files before adding
- them to the library by setting environment variables SDCCLIB_CC
-\begin_inset LatexCommand \index{SDCCLIB_CC}
-
-\end_inset
-
- and/or SDCCLIB_AS
-\begin_inset LatexCommand \index{SDCCLIB_AS}
-
-\end_inset
+\family default
+\series default
-.
- For example:
\newline
\end_layout
\begin_layout Standard
-
+Additionally, you can instruct sdcclib to compiles the files before adding
+ them to the library.
+ This is achieved using the environment variables SDCCLIB_CC and/or SDCCLIB_AS.
+ For example:
\family sans
\series bold
-set SDCCLIB_CC
-\begin_inset LatexCommand \index{SDCCLIB_CC}
-
-\end_inset
-
-=sdcc -
-\family default
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
+\newline
-\backslash
-/
\end_layout
-\end_inset
-
-
-\family sans
--use-stdout -
-\family default
-
-\begin_inset ERT
-status collapsed
-
\begin_layout Standard
-
-\backslash
-/
-\end_layout
-
-\end_inset
-
-
\family sans
--model-small -c
+\series bold
+set SDCCLIB_CC=sdcc -c
\end_layout
\begin_layout Standard
\family sans
\series bold
sdcclib -l libint.lib myliblist.txt
+\family default
+\series default
+
\newline
\end_layout
\end_inset
-debug
-\begin_inset LatexCommand \index{-\\/-debug}
+\begin_inset LatexCommand \index{-\/-debug}
\end_inset
\end_inset
-\series default
\size large
+\bar under
+\series default
\size default
+\bar default
Like `-M' but the output mentions only the user header files included with
`#include
\begin_inset Quotes eld
\end_inset
-\series default
\size large
+\bar under
+\series default
\size default
+\bar default
Like `-dD' except that the macro arguments and contents are omitted.
Only `#define name' is included in the output.
\end_layout
\end_inset
-
-\series default
-\bar default
+\series default
\size default
+\bar default
Pedantic parse numbers so that situations like 0xfe-LO_B(3) are parsed properly
and the macro LO_B(3) gets expanded.
See also #pragma pedantic_parse_number
\series bold
-lib-path
-\begin_inset LatexCommand \index{-\\/-lib-path <path>}
+\begin_inset LatexCommand \index{-\/-lib-path <path>}
\end_inset
-\begin_inset LatexCommand \index{-L -\\/-lib-path}
+\begin_inset LatexCommand \index{-L -\/-lib-path}
\end_inset
-xram-loc
\series default
-\begin_inset LatexCommand \index{-\\/-xram-loc <Value>}
+\begin_inset LatexCommand \index{-\/-xram-loc <Value>}
\end_inset
-code-loc
\series default
-\begin_inset LatexCommand \index{-\\/-code-loc <Value>}
+\begin_inset LatexCommand \index{-\/-code-loc <Value>}
\end_inset
-stack-loc
\series default
-\begin_inset LatexCommand \index{-\\/-stack-loc <Value>}
+\begin_inset LatexCommand \index{-\/-stack-loc <Value>}
\end_inset
\series default
\InsetSpace ~
-\begin_inset LatexCommand \index{-\\/-pack-iram}
+\begin_inset LatexCommand \index{-\/-pack-iram}
\end_inset
\series default
\InsetSpace ~
-\begin_inset LatexCommand \index{-\\/-no-pack-iram}
+\begin_inset LatexCommand \index{-\/-no-pack-iram}
\end_inset
-xstack-loc
\series default
-\begin_inset LatexCommand \index{-\\/-xstack-loc <Value>}
+\begin_inset LatexCommand \index{-\/-xstack-loc <Value>}
\end_inset
-data-loc
\series default
-\begin_inset LatexCommand \index{-\\/-data-loc <Value>}
+\begin_inset LatexCommand \index{-\/-data-loc <Value>}
\end_inset
-idata-loc
\series default
-\begin_inset LatexCommand \index{-\\/-idata-loc <Value>}
+\begin_inset LatexCommand \index{-\/-idata-loc <Value>}
\end_inset
\end_inset
-out-fmt-ihx
-\begin_inset LatexCommand \index{-\\/-out-fmt-ihx}
+\begin_inset LatexCommand \index{-\/-out-fmt-ihx}
\end_inset
+
+\bar under
\series default
+\bar default
The linker output (final object code) is in Intel Hex format.
\begin_inset LatexCommand \index{Intel hex format}
\end_inset
-out-fmt-s19
-\begin_inset LatexCommand \index{-\\/-out-fmt-s19}
+\begin_inset LatexCommand \index{-\/-out-fmt-s19}
\end_inset
+
+\bar under
\series default
+\bar default
The linker output (final object code) is in Motorola S19 format
\begin_inset LatexCommand \index{Motorola S19 format}
\end_inset
-out-fmt-elf
-\begin_inset LatexCommand \index{-\\/-out-fmt-s19}
+\begin_inset LatexCommand \index{-\/-out-fmt-s19}
\end_inset
-\begin_inset LatexCommand \index{HC08!Options!-\\/-out-fmt-elf}
+\begin_inset LatexCommand \index{HC08!Options!-\/-out-fmt-elf}
\end_inset
+
+\bar under
\series default
+\bar default
The linker output (final object code) is in ELF format
\begin_inset LatexCommand \index{ELF format}
\end_inset
-model-small
-\begin_inset LatexCommand \index{-\\/-model-small}
+\begin_inset LatexCommand \index{-\/-model-small}
\end_inset
\series default
\size large
+\emph on
\size default
+\emph default
Generate code for Small Model programs, see section Memory Models for more
details.
This is the default model.
\end_inset
-model-medium
-\begin_inset LatexCommand \index{-\\/-model-medium}
+\begin_inset LatexCommand \index{-\/-model-medium}
\end_inset
\end_inset
-model-large
-\begin_inset LatexCommand \index{-\\/-model-large}
+\begin_inset LatexCommand \index{-\/-model-large}
\end_inset
\end_inset
-xstack
-\begin_inset LatexCommand \index{-\\/-xstack}
+\begin_inset LatexCommand \index{-\/-xstack}
\end_inset
\series default
\InsetSpace ~
<Value>
-\begin_inset LatexCommand \index{-\\/-iram-size <Value>}
+\begin_inset LatexCommand \index{-\/-iram-size <Value>}
\end_inset
\series default
\InsetSpace ~
<Value>
-\begin_inset LatexCommand \index{-\\/-xram-size <Value>}
+\begin_inset LatexCommand \index{-\/-xram-size <Value>}
\end_inset
\series default
\InsetSpace ~
<Value>
-\begin_inset LatexCommand \index{-\\/-code-size <Value>}
+\begin_inset LatexCommand \index{-\/-code-size <Value>}
\end_inset
\series default
\InsetSpace ~
<Value>
-\begin_inset LatexCommand \index{-\\/-stack-size <Value>}
+\begin_inset LatexCommand \index{-\/-stack-size <Value>}
\end_inset
\series default
\InsetSpace ~
-\begin_inset LatexCommand \index{-\\/-pack-iram}
+\begin_inset LatexCommand \index{-\/-pack-iram}
\end_inset
\series default
\InsetSpace ~
-\begin_inset LatexCommand \index{-\\/-no-pack-iram}
+\begin_inset LatexCommand \index{-\/-no-pack-iram}
\end_inset
\series default
\InsetSpace ~
-\begin_inset LatexCommand \index{-\\/-acall-ajmp}
+\begin_inset LatexCommand \index{-\/-acall-ajmp}
\end_inset
acall/ajmp.
Only use this option if your code is in the same 2k block of memory.
You may need to use this option for some 8051 derivatives which lack the
- lcall/ljmp instructions.
+ lcall/ljmp instructions..
\end_layout
\begin_layout Standard
-model-flat24
\series default
-\begin_inset LatexCommand \index{DS390!Options!-\\/-model-flat24}
+\begin_inset LatexCommand \index{DS390!Options!-\/-model-flat24}
\end_inset
\size large
+\emph on
\size default
+\emph default
Generate 24-bit flat mode code.
This is the one and only that the ds390 code generator supports right now
and is default when using
\end_inset
-protect-sp-update
-\begin_inset LatexCommand \index{DS390!Options!-\\/-protect-sp-update}
+\begin_inset LatexCommand \index{DS390!Options!-\/-protect-sp-update}
\end_inset
-stack-10bit
\series default
-\begin_inset LatexCommand \index{DS390!Options!-\\/-stack-10bit}
+\begin_inset LatexCommand \index{DS390!Options!-\/-stack-10bit}
\end_inset
\end_inset
-stack-auto
-\begin_inset LatexCommand \index{-\\/-stack-auto}
+\begin_inset LatexCommand \index{-\/-stack-auto}
\end_inset
\end_inset
-xstack
-\begin_inset LatexCommand \index{-\\/-xstack}
+\begin_inset LatexCommand \index{-\/-xstack}
\end_inset
\end_inset
-stack-probe
-\begin_inset LatexCommand \index{DS390!Options!-\\/-stack-probe}
+\begin_inset LatexCommand \index{DS390!Options!-\/-stack-probe}
\end_inset
\series bold
-
\begin_inset ERT
-status collapsed
+status open
\begin_layout Standard
\end_inset
-tini-libid
-\begin_inset LatexCommand \index{DS390!Options!-\\/-tini-libid}
+\begin_inset LatexCommand \index{DS390!Options!-\/-tini-libid}
\end_inset
\end_inset
-use-accelerator
-\begin_inset LatexCommand \index{DS390!Options!-\\/-use-accelerator}
+\begin_inset LatexCommand \index{DS390!Options!-\/-use-accelerator}
\end_inset
-callee-saves-bc
\series default
-\begin_inset LatexCommand \index{Z80!Options!-\\/-callee-saves-bc}
+\begin_inset LatexCommand \index{Z80!Options!-\/-callee-saves-bc}
\end_inset
\size large
+\emph on
\size default
+\emph default
Force a called function to always save BC.
\end_layout
-no-std-crt0
\series default
-\begin_inset LatexCommand \index{Z80!Options!-\\/-no-std-crt0}
+\begin_inset LatexCommand \index{Z80!Options!-\/-no-std-crt0}
\end_inset
-portmode=
\series default
<Value>
-\begin_inset LatexCommand \index{Z80!Options!-\\/-portmode=<Value>}
+\begin_inset LatexCommand \index{Z80!Options!-\/-portmode=<Value>}
\end_inset
-asm=
\series default
<Value>
-\begin_inset LatexCommand \index{Z80!Options!-\\/-asm=<Value>}
+\begin_inset LatexCommand \index{Z80!Options!-\/-asm=<Value>}
\end_inset
\series default
\InsetSpace ~
<Value>
-\begin_inset LatexCommand \index{Z80!Options!-\\/-codeseg <Value>}
+\begin_inset LatexCommand \index{Z80!Options!-\/-codeseg <Value>}
\end_inset
\series default
\InsetSpace ~
<Value>
-\begin_inset LatexCommand \index{Z80!Options!-\\/-constseg <Value>}
+\begin_inset LatexCommand \index{Z80!Options!-\/-constseg <Value>}
\end_inset
-callee-saves-bc
\series default
-\begin_inset LatexCommand \index{GBZ80!Options!-\\/-callee-saves-bc}
+\begin_inset LatexCommand \index{GBZ80!Options!-\/-callee-saves-bc}
\end_inset
\size large
+\emph on
\size default
+\emph default
Force a called function to always save BC.
\end_layout
\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-no-std-crt0
+\series default
+
+\begin_inset LatexCommand \index{Z80!Options!-\/-no-std-crt0}
+
+\end_inset
+
+ When linking, skip the standard crt0.o object file.
+ You must provide your own crt0.o for your system when linking.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
\series bold
-bo
\series default
\series default
\InsetSpace ~
<Value>
-\begin_inset LatexCommand \index{GBZ80!Options!-\\/-codeseg <Value>}
+\begin_inset LatexCommand \index{GBZ80!Options!-\/-codeseg <Value>}
\end_inset
\series default
\InsetSpace ~
<Value>
-\begin_inset LatexCommand \index{GBZ80!Options!-\\/-constseg <Value>}
+\begin_inset LatexCommand \index{GBZ80!Options!-\/-constseg <Value>}
\end_inset
\end_inset
-nogcse
-\begin_inset LatexCommand \index{-\\/-nogcse}
+\begin_inset LatexCommand \index{-\/-nogcse}
\end_inset
will indicate the number of extra bytes it allocated.
It is recommended that this option NOT be used, #pragma\InsetSpace ~
nogcse
-\begin_inset LatexCommand \index{\\#pragma nogcse}
+\begin_inset LatexCommand \index{\#pragma nogcse}
\end_inset
\end_inset
-noinvariant
-\begin_inset LatexCommand \index{-\\/-noinvariant}
+\begin_inset LatexCommand \index{-\/-noinvariant}
\end_inset
.
It is recommended that this option NOT be used, #pragma\InsetSpace ~
noinvariant
-\begin_inset LatexCommand \index{\\#pragma noinvariant}
+\begin_inset LatexCommand \index{\#pragma noinvariant}
\end_inset
\end_inset
-noinduction
-\begin_inset LatexCommand \index{-\\/-noinduction}
+\begin_inset LatexCommand \index{-\/-noinduction}
\end_inset
for more details.
It is recommended that this option is NOT used, #pragma\InsetSpace ~
noinduction
-\begin_inset LatexCommand \index{\\#pragma noinduction}
+\begin_inset LatexCommand \index{\#pragma noinduction}
\end_inset
\end_inset
-nojtbound
-\begin_inset LatexCommand \index{-\\/-nojtbound}
+\begin_inset LatexCommand \index{-\/-nojtbound}
\end_inset
\size large
+\bar under
\series default
\size default
+\bar default
Will not generate boundary condition check when switch statements
\begin_inset LatexCommand \index{switch statement}
Switch Statements for more details.
It is recommended that this option is NOT used, #pragma\InsetSpace ~
nojtbound
-\begin_inset LatexCommand \index{\\#pragma nojtbound}
+\begin_inset LatexCommand \index{\#pragma nojtbound}
\end_inset
\end_inset
-noloopreverse
-\begin_inset LatexCommand \index{-\\/-noloopreverse}
+\begin_inset LatexCommand \index{-\/-noloopreverse}
\end_inset
nolabelopt
\series default
-\begin_inset LatexCommand \index{-\\/-nolabelopt }
+\begin_inset LatexCommand \index{-\/-nolabelopt }
\end_inset
\end_inset
-no-xinit-opt
-\begin_inset LatexCommand \index{-\\/-no-xinit-opt}
+\begin_inset LatexCommand \index{-\/-no-xinit-opt}
\end_inset
\end_inset
-nooverlay
-\begin_inset LatexCommand \index{-\\/-nooverlay}
+\begin_inset LatexCommand \index{-\/-nooverlay}
\end_inset
\end_inset
-no-peep
-\begin_inset LatexCommand \index{-\\/-no-peep}
+\begin_inset LatexCommand \index{-\/-no-peep}
\end_inset
-peep-file
\series default
-\begin_inset LatexCommand \index{-\\/-peep-file}
+\begin_inset LatexCommand \index{-\/-peep-file}
\end_inset
\end_inset
-peep-asm
-\begin_inset LatexCommand \index{-\\/-peep-asm}
+\begin_inset LatexCommand \index{-\/-peep-asm}
\end_inset
\end_inset
-opt-code-speed
-\begin_inset LatexCommand \index{-\\/-opt-code-speed}
+\begin_inset LatexCommand \index{-\/-opt-code-speed}
\end_inset
\end_inset
-opt-code-size
-\begin_inset LatexCommand \index{-\\/-opt-code-size}
+\begin_inset LatexCommand \index{-\/-opt-code-size}
\end_inset
\end_inset
-compile-only
-\begin_inset LatexCommand \index{-\\/-compile-only}
+\begin_inset LatexCommand \index{-\/-compile-only}
\end_inset
-\begin_inset LatexCommand \index{-c -\\/-compile-only}
+\begin_inset LatexCommand \index{-c -\/-compile-only}
\end_inset
\series bold
-c1mode
-\begin_inset LatexCommand \index{-\\/-c1mode}
+\begin_inset LatexCommand \index{-\/-c1mode}
\end_inset
\end_inset
-
+
\series default
- The output path where everything will be placed or the file name used for
+The output path where everything will be placed or the file name used for
all generated output files.
If the parameter is a path, it must have a trailing slash (or backslash
for the Windows binaries) to be recognized as a path.
- Note for Windows users: if the path contains spaces, it should be surrounded
+
+\emph on
+
+\emph default
+Note for Windows users: if the path contains spaces, it should be surrounded
by quotes.
The trailing backslash should be doubled in order to prevent escaping the
final quote, for example:
\end_inset
-stack-auto
-\begin_inset LatexCommand \index{-\\/-stack-auto}
+\begin_inset LatexCommand \index{-\/-stack-auto}
\end_inset
\series default
\size large
+\emph on
\size default
+\emph default
All functions in the source file will be compiled as
\emph on
reentrant
\end_inset
-callee-saves
-\begin_inset LatexCommand \index{-\\/-callee-saves}
+\begin_inset LatexCommand \index{-\/-callee-saves}
\end_inset
-callee-saves option string.
Also see #pragma\InsetSpace ~
callee_saves
-\begin_inset LatexCommand \index{\\#pragma callee\\_saves}
+\begin_inset LatexCommand \index{\#pragma callee\_saves}
\end_inset
\end_inset
-all-callee-saves
-\begin_inset LatexCommand \index{-\\/-all-callee-saves}
+\begin_inset LatexCommand \index{-\/-all-callee-saves}
\end_inset
-
+
\series default
- Function of -
+Function of
+\series bold
+
+\series default
+-
\begin_inset ERT
status collapsed
\end_inset
-debug
-\begin_inset LatexCommand \index{-\\/-debug}
+\begin_inset LatexCommand \index{-\/-debug}
\end_inset
+
+\bar under
\series default
+\bar default
When this option is used the compiler will generate debug information.
The debug information collected in a file with .cdb extension can be used
with the SDCDB.
\end_inset
-\series default
\size large
+\bar under
+\series default
\size default
+\bar default
Stop after the stage of compilation proper; do not assemble.
The output is an assembler code file for the input file specified.
\end_layout
\end_inset
-int-long-reent
-\begin_inset LatexCommand \index{-\\/-int-long-reent}
+\begin_inset LatexCommand \index{-\/-int-long-reent}
\end_inset
\end_inset
-cyclomatic
-\begin_inset LatexCommand \index{-\\/-cyclomatic}
+\begin_inset LatexCommand \index{-\/-cyclomatic}
\end_inset
+
+\bar under
\series default
+\bar default
This option will cause the compiler to generate an information message for
each function in the source file.
The message contains some
\end_inset
-float-reent
-\begin_inset LatexCommand \index{-\\/-float-reent}
+\begin_inset LatexCommand \index{-\/-float-reent}
\end_inset
\end_inset
-funsigned-char
-\begin_inset LatexCommand \index{-\\/-funsigned-char}
+\begin_inset LatexCommand \index{-\/-funsigned-char}
\end_inset
\series default
- The default signedness for every type is
+ The default signedness for every type is
\family typewriter
-signed
+ signed
\family default
.
- In some embedded environments the default signedness of
+ In some embedded environments the default signedness of
\family typewriter
-char
+ char
\family default
- is
+ is
\family typewriter
-unsigned
+ unsigned
\family default
.
To set the signess for characters to unsigned, use the option -
\end_inset
-main-return
-\begin_inset LatexCommand \index{-\\/-main-return}
+\begin_inset LatexCommand \index{-\/-main-return}
\end_inset
\end_inset
-nostdinc
-\begin_inset LatexCommand \index{-\\/-nostdinc}
+\begin_inset LatexCommand \index{-\/-nostdinc}
\end_inset
\end_inset
-nostdlib
-\begin_inset LatexCommand \index{-\\/-nostdlib}
+\begin_inset LatexCommand \index{-\/-nostdlib}
\end_inset
\end_inset
-verbose
-\begin_inset LatexCommand \index{-\\/-verbose}
+\begin_inset LatexCommand \index{-\/-verbose}
\end_inset
\end_inset
-no-c-code-in-asm
-\begin_inset LatexCommand \index{-\\/-no-c-code-in-asm}
+\begin_inset LatexCommand \index{-\/-no-c-code-in-asm}
\end_inset
\end_inset
-fverbose-asm
-\begin_inset LatexCommand \index{-\\/-no-gen-comments}
+\begin_inset LatexCommand \index{-\/-no-gen-comments}
\end_inset
\end_inset
-no-peep-comments
-\begin_inset LatexCommand \index{-\\/-no-peep-comments}
+\begin_inset LatexCommand \index{-\/-no-peep-comments}
\end_inset
\end_inset
-i-code-in-asm
-\begin_inset LatexCommand \index{-\\/-i-code-in-asm}
+\begin_inset LatexCommand \index{-\/-i-code-in-asm}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{-\\/-less-pedantic}
+\begin_inset LatexCommand \index{-\/-less-pedantic}
\end_inset
-disable-warning\InsetSpace ~
<nnnn>
-\begin_inset LatexCommand \index{-\\/-disable-warning}
+\begin_inset LatexCommand \index{-\/-disable-warning}
\end_inset
\begin_layout Standard
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-Werror
+\begin_inset LatexCommand \index{-\/-Werror}
+
+\end_inset
+
+
+\series default
+ Treat all warnings as errors.
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
\backslash
/
\end_layout
\end_inset
-print-search-dirs
-\begin_inset LatexCommand \index{-\\/-print-search-dirs}
+\begin_inset LatexCommand \index{-\/-print-search-dirs}
\end_inset
\end_inset
-vc
-\begin_inset LatexCommand \index{-\\/-vc}
+\begin_inset LatexCommand \index{-\/-vc}
\end_inset
\end_inset
-use-stdout
-\begin_inset LatexCommand \index{-\\/-use-stdout}
+\begin_inset LatexCommand \index{-\/-use-stdout}
\end_inset
\end_inset
-std-sdcc89
-\begin_inset LatexCommand \index{-\\/-std-sdcc89}
+\begin_inset LatexCommand \index{-\/-std-sdcc89}
\end_inset
\end_inset
-std-c89
-\begin_inset LatexCommand \index{-\\/-std-c89}
+\begin_inset LatexCommand \index{-\/-std-c89}
\end_inset
\end_inset
-std-sdcc99
-\begin_inset LatexCommand \index{-\\/-std-sdcc99}
+\begin_inset LatexCommand \index{-\/-std-sdcc99}
\end_inset
\end_inset
-std-c99
-\begin_inset LatexCommand \index{-\\/-std-sdcc99}
+\begin_inset LatexCommand \index{-\/-std-sdcc99}
\end_inset
-codeseg
\series default
-\begin_inset LatexCommand \index{-\\/-codeseg <Value>}
+\begin_inset LatexCommand \index{-\/-codeseg <Value>}
\end_inset
-constseg
\series default
-\begin_inset LatexCommand \index{-\\/-constseg <Value>}
+\begin_inset LatexCommand \index{-\/-constseg <Value>}
\end_inset
\end_inset
-fdollars-in-identifiers
-\begin_inset LatexCommand \index{-\\/-fdollars-in-identifiers}
+\begin_inset LatexCommand \index{-\/-fdollars-in-identifiers}
\end_inset
-more-pedantic
\series default
-\begin_inset LatexCommand \index{-\\/-more-pedantic}
+\begin_inset LatexCommand \index{-\/-more-pedantic}
\end_inset
-short-is-8bits
\series default
-\begin_inset LatexCommand \index{-\\/-short-is-8bits}
+\begin_inset LatexCommand \index{-\/-short-is-8bits}
\end_inset
\end_inset
-dumpraw
-\begin_inset LatexCommand \index{-\\/-dumpraw}
+\begin_inset LatexCommand \index{-\/-dumpraw}
\end_inset
\end_inset
-dumpgcse
-\begin_inset LatexCommand \index{-\\/-dumpgcse}
+\begin_inset LatexCommand \index{-\/-dumpgcse}
\end_inset
\end_inset
-dumpdeadcode
-\begin_inset LatexCommand \index{-\\/-dumpdeadcode}
+\begin_inset LatexCommand \index{-\/-dumpdeadcode}
\end_inset
\end_inset
-dumploop
-\begin_inset LatexCommand \index{-\\/-dumploop}
+\begin_inset LatexCommand \index{-\/-dumploop}
\end_inset
\end_inset
-dumprange
-\begin_inset LatexCommand \index{-\\/-dumprange}
+\begin_inset LatexCommand \index{-\/-dumprange}
\end_inset
\end_inset
-dumlrange
-\begin_inset LatexCommand \index{-\\/-dumlrange}
+\begin_inset LatexCommand \index{-\/-dumlrange}
\end_inset
\end_inset
-dumpregassign
-\begin_inset LatexCommand \index{-\\/-dumpregassign}
+\begin_inset LatexCommand \index{-\/-dumpregassign}
\end_inset
+
+\bar under
\series default
+\bar default
Will create a dump of iCodes, after register assignment
\begin_inset LatexCommand \index{Register assignment}
\end_inset
-dumplrange
-\begin_inset LatexCommand \index{-\\/-dumplrange}
+\begin_inset LatexCommand \index{-\/-dumplrange}
\end_inset
\end_inset
-dumpall
-\begin_inset LatexCommand \index{-\\/-dumpall}
+\begin_inset LatexCommand \index{-\/-dumpall}
\end_inset
\size large
+\bar under
\series default
\size default
+\bar default
Will cause all the above mentioned dumps to be created.
\end_layout
-
\series default
use-stdout
-\begin_inset LatexCommand \index{-\\/-use-stdout}
+\begin_inset LatexCommand \index{-\/-use-stdout}
\end_inset
\emph default
-vc
-\begin_inset LatexCommand \index{-\\/-vc}
+\begin_inset LatexCommand \index{-\/-vc}
\end_inset
\series bold
SDCC_LEAVE_SIGNALS
-\begin_inset LatexCommand \index{SDCC\\_LEAVE\\_SIGNALS}
+\begin_inset LatexCommand \index{SDCC\_LEAVE\_SIGNALS}
\end_inset
\series bold
SDCC_HOME
-\begin_inset LatexCommand \index{SDCC\\_HOME}
+\begin_inset LatexCommand \index{SDCC\_HOME}
\end_inset
\series bold
SDCC_INCLUDE
-\begin_inset LatexCommand \index{SDCC\\_INCLUDE}
+\begin_inset LatexCommand \index{SDCC\_INCLUDE}
\end_inset
\series bold
SDCC_LIB
-\begin_inset LatexCommand \index{SDCC\\_LIB}
+\begin_inset LatexCommand \index{SDCC\_LIB}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_data (mcs51, ds390 storage class)}
+\begin_inset LatexCommand \index{\_\_data (mcs51, ds390 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_near (storage class)}
+\begin_inset LatexCommand \index{\_\_near (storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_xdata (mcs51, ds390 storage class)}
+\begin_inset LatexCommand \index{\_\_xdata (mcs51, ds390 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_far (storage class)}
+\begin_inset LatexCommand \index{\_\_far (storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_idata (mcs51, ds390 storage class)}
+\begin_inset LatexCommand \index{\_\_idata (mcs51, ds390 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_pdata (mcs51, ds390 storage class)}
+\begin_inset LatexCommand \index{\_\_pdata (mcs51, ds390 storage class)}
\end_inset
\end_inset
-xstack
-\begin_inset LatexCommand \index{-\\/-xstack}
+\begin_inset LatexCommand \index{-\/-xstack}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_code}
+\begin_inset LatexCommand \index{\_\_code}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_bit}
+\begin_inset LatexCommand \index{\_\_bit}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_sfr}
+\begin_inset LatexCommand \index{\_\_sfr}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_sfr16}
+\begin_inset LatexCommand \index{\_\_sfr16}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_sfr32}
+\begin_inset LatexCommand \index{\_\_sfr32}
\end_inset
/ sbit
-\begin_inset LatexCommand \index{\\_\\_sbit}
+\begin_inset LatexCommand \index{\_\_sbit}
\end_inset
\begin_layout Standard
Like the bit keyword,
\emph on
-sfr / sfr16 / sfr32 / sbit
+sfr / sfr16 / sfr32 / sbit
\emph default
- signify both a data-type and storage class, they are used to describe the
+signify both a data-type and storage class, they are used to describe the
\emph on
s
\end_inset
-\begin_inset LatexCommand \index{\\_\\_at}
+\begin_inset LatexCommand \index{\_\_at}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_at}
+\begin_inset LatexCommand \index{\_\_at}
\end_inset
\begin_layout Standard
Special function registers which are located on an address dividable by
- 8 are bit-addressable, an
+ 8 are bit-addressable, an
\emph on
-sbit
+ sbit
\emph default
addresses a specific bit within these sfr.
\newline
then the sfr / sfr16 / sfr32 / sbit Storage Class extensions will most
likely be
\emph on
-not
+not
\emph default
- compatible.
+compatible.
Specifically the syntax
\family typewriter
\InsetSpace ~
\end_inset
.
-
-\family default
-\series bold
+\family default
Nevertheless it is possible to write header files
\begin_inset LatexCommand \index{Header files}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_idata (mcs51, ds390 storage class)}
+\begin_inset LatexCommand \index{\_\_idata (mcs51, ds390 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_xdata (mcs51, ds390 storage class)}
+\begin_inset LatexCommand \index{\_\_xdata (mcs51, ds390 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_data (mcs51, ds390 storage class)}
+\begin_inset LatexCommand \index{\_\_data (mcs51, ds390 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_using (mcs51, ds390 register bank)}
+\begin_inset LatexCommand \index{\_\_using (mcs51, ds390 register bank)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_interrupt}
+\begin_inset LatexCommand \index{\_\_interrupt}
\end_inset
\end_inset
-data-loc
-\begin_inset LatexCommand \index{-\\/-data-loc <Value>}
+\begin_inset LatexCommand \index{-\/-data-loc <Value>}
\end_inset
\end_inset
-iram-size
-\begin_inset LatexCommand \index{-\\/-iram-size <Value>}
+\begin_inset LatexCommand \index{-\/-iram-size <Value>}
\end_inset
\end_inset
-stack-loc
-\begin_inset LatexCommand \index{-\\/-stack-loc <Value>}
+\begin_inset LatexCommand \index{-\/-stack-loc <Value>}
\end_inset
\end_inset
-xdata-loc
-\begin_inset LatexCommand \index{-\\/-xdata-loc<Value>}
+\begin_inset LatexCommand \index{-\/-xdata-loc<Value>}
\end_inset
\end_inset
-xram-size
-\begin_inset LatexCommand \index{-\\/-xram-size <Value>}
+\begin_inset LatexCommand \index{-\/-xram-size <Value>}
\end_inset
\end_inset
-code-loc
-\begin_inset LatexCommand \index{-\\/-code-loc <Value>}
+\begin_inset LatexCommand \index{-\/-code-loc <Value>}
\end_inset
\end_inset
-code-size
-\begin_inset LatexCommand \index{-\\/-code-size <Value>}
+\begin_inset LatexCommand \index{-\/-code-size <Value>}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_sfr}
+\begin_inset LatexCommand \index{\_\_sfr}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_sfr}
+\begin_inset LatexCommand \index{\_\_sfr}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_at}
+\begin_inset LatexCommand \index{\_\_at}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_sfr}
+\begin_inset LatexCommand \index{\_\_sfr}
\end_inset
\end_inset
-portmode
-\begin_inset LatexCommand \index{Z180!Options!-\\/-portmode}
+\begin_inset LatexCommand \index{Z180!Options!-\/-portmode}
\end_inset
=180 (80) and a compiler #pragma\InsetSpace ~
portmode
-\begin_inset LatexCommand \index{Z180!Pragmas!\\#pragma portmode}
+\begin_inset LatexCommand \index{Z180!Pragmas!\#pragma portmode}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_data (hc08 storage class)}
+\begin_inset LatexCommand \index{\_\_data (hc08 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_xdata (hc08 storage class)}
+\begin_inset LatexCommand \index{\_\_xdata (hc08 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_at}
+\begin_inset LatexCommand \index{\_\_at}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_xdata (mcs51, ds390 storage class)}
+\begin_inset LatexCommand \index{\_\_xdata (mcs51, ds390 storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_at}
+\begin_inset LatexCommand \index{\_\_at}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_at}
+\begin_inset LatexCommand \index{\_\_at}
\end_inset
\end_inset
- by using the
+ by using the
\emph on
--
+ -
\begin_inset ERT
status collapsed
\end_inset
-stack-auto
-\begin_inset LatexCommand \index{-\\/-stack-auto}
+\begin_inset LatexCommand \index{-\/-stack-auto}
\end_inset
stackauto
\emph default
-\begin_inset LatexCommand \index{\\#pragma stackauto}
+\begin_inset LatexCommand \index{\#pragma stackauto}
\end_inset
\begin_layout Standard
Since stack space on 8051 is limited, the
\emph on
-reentrant
+reentrant
\emph default
- keyword or the
+keyword or the
\emph on
--
+ -
\begin_inset ERT
status collapsed
\emph on
bvar
\emph default
- in bit addressable space and
+ in bit addressable space and
\emph on
-j
+ j
\emph default
in internal ram.
When compiled with
should be preceded by a #pragma\InsetSpace ~
nooverlay
-\begin_inset LatexCommand \index{\\#pragma nooverlay}
+\begin_inset LatexCommand \index{\#pragma nooverlay}
\end_inset
#pragma save
\newline
#pragma nooverlay
-\begin_inset LatexCommand \index{\\#pragma nooverlay}
+\begin_inset LatexCommand \index{\#pragma nooverlay}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_interrupt}
+\begin_inset LatexCommand \index{\_\_interrupt}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_using (mcs51, ds390 register bank)}
+\begin_inset LatexCommand \index{\_\_using (mcs51, ds390 register bank)}
\end_inset
operations are implemented using external support routines.
If an interrupt service routine needs to do any of these operations then
the support routines (as mentioned in a following section) will have to
- be recompiled using the
+ be recompiled using the
\emph on
--
+ -
\begin_inset ERT
status collapsed
\end_inset
-stack-auto
-\begin_inset LatexCommand \index{-\\/-stack-auto}
+\begin_inset LatexCommand \index{-\/-stack-auto}
\end_inset
-int-long-reent
\emph default
-\begin_inset LatexCommand \index{-\\/-int-long-reent}
+\begin_inset LatexCommand \index{-\/-int-long-reent}
\end_inset
See f.e.
the cast
\family typewriter
-\series bold
(unsigned char)(tail-1)
\family default
-\series default
-
-\series bold
-within the if clause in section
+ within the if clause in section
\begin_inset LatexCommand \ref{sub:A-Step-by Assembler Introduction}
\end_inset
Note that when some function is called from an interrupt service routine
it should be preceded by a #pragma\InsetSpace ~
nooverlay
-\begin_inset LatexCommand \index{\\#pragma nooverlay}
+\begin_inset LatexCommand \index{\#pragma nooverlay}
\end_inset
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
+ You could use semaphores or make the function
\emph on
-critical
+ critical
\emph default
if all parameters are passed in registers.
\newline
\end_inset
-\begin_inset LatexCommand \index{\\_\\_using (mcs51, ds390 register bank)}
+\begin_inset LatexCommand \index{\_\_using (mcs51, ds390 register bank)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_critical}
+\begin_inset LatexCommand \index{\_\_critical}
\end_inset
\family typewriter
#define CLI _asm
-\begin_inset LatexCommand \index{\\_asm}
+\begin_inset LatexCommand \index{\_asm}
\end_inset
cli\InsetSpace ~
\InsetSpace ~
_endasm
-\begin_inset LatexCommand \index{\\_endasm}
+\begin_inset LatexCommand \index{\_endasm}
\end_inset
\end_inset
- bit test and clear instruction.
+ bit test and
+\emph on
+
+\emph default
+clear
+\emph on
+
+\emph default
+instruction.
These type of instructions are typically used in preemptive multitasking
systems, where a routine f.e.
claims the use of a data structure ('acquires a lock
\end_inset
-\begin_inset LatexCommand \index{\\_\\_using (mcs51, ds390 register bank)}
+\begin_inset LatexCommand \index{\_\_using (mcs51, ds390 register bank)}
\end_inset
\newline
\emph on
-(pending: Note, nowadays the
+(pending: Note, nowadays the
\emph default
- using
+using
\emph on
-attribute has an effect on
+ attribute has an effect on
\emph default
\emph on
-the generated code for a
+the generated code for a
\emph default
- non-interrupt
+non-interrupt
\emph on
-function
+ function
\emph default
.
\emph on
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
+orl a,#(l_PSEG
+ >> 8)
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
jz 00006$
\newline
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
-mov
- r1,#s_PSEG
+mov r1,#s_PSEG
\newline
\InsetSpace ~
\InsetSpace ~
clr a
\newline
00005$:\InsetSpace ~
-movx @r1,a
+movx
+ @r1,a
\newline
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
djnz r0,00005$
\newline
-0
-0006$:
+00006$:
\newline
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
-orl a,#(l_XSEG >> 8)
+orl a,#(l_XSEG >>
+ 8)
\newline
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
-mov r1,#((l_XSEG
- + 255) >> 8)
+mov r1,#((l_XSEG + 255) >> 8)
\newline
\InsetSpace ~
\InsetSpace ~
clr a
\newline
00007$:\InsetSpace ~
-movx @dptr,a
+movx
+ @dptr,a
\newline
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
-djnz
- r1,00007$
+djnz r1,00007$
\newline
00008$:
\end_layout
One of these modules (crtstart.asm) contains a call to the C routine
\emph on
_sdcc_external_startup()
-\begin_inset LatexCommand \index{\\_sdcc\\_external\\_startup()}
+\begin_inset LatexCommand \index{\_sdcc\_external\_startup()}
\end_inset
+\series bold
\emph default
- at the start of the CODE area.
+
+\series default
+at the start of the CODE area.
This routine is also in the runtime library
\begin_inset LatexCommand \index{Runtime library}
\end_inset
-iram-size
-\begin_inset LatexCommand \index{-\\/-iram-size <Value>}
+\begin_inset LatexCommand \index{-\/-iram-size <Value>}
\end_inset
opt
\emph default
-\begin_inset LatexCommand \index{-\\/-no-xinit-opt}
+\begin_inset LatexCommand \index{-\/-no-xinit-opt}
\end_inset
-main-return
\emph default
-\begin_inset LatexCommand \index{-\\/-main-return}
+\begin_inset LatexCommand \index{-\/-main-return}
\end_inset
\end_inset
about MCS51-variants.
+\newline
+
+\end_layout
+
+\begin_layout Standard
+While these initialization modules are meant as generic startup code there
+ might be the need for customization.
+ Let's assume the return value of
+\emph on
+_sdcc_external_startup()
+\emph default
+ in
+\emph on
+crtstart.asm
+\emph default
+ should not be checked (or
+\emph on
+_sdcc_external_startup()
+\emph default
+ should not be called at all).
+ The recommended way would be to copy
+\emph on
+crtstart.asm
+\emph default
+ (f.e.
+ from
+\begin_inset LatexCommand \url{http://sdcc.svn.sourceforge.net/viewvc/*checkout*/sdcc/trunk/sdcc/device/lib/mcs51/crtstart.asm}
+
+\end_inset
+
+) into the source directory, adapt it there, then assemble it with
+\emph on
+asx8051 -plosgff
+\begin_inset Foot
+status open
+
+\begin_layout Standard
+\begin_inset Quotes sld
+\end_inset
+
+-plosgff
+\begin_inset Quotes srd
+\end_inset
+
+ are the assembler options used in
+\begin_inset LatexCommand \url{http://sdcc.svn.sourceforge.net/viewvc/sdcc/trunk/sdcc/device/lib/mcs51/Makefile.in?view=markup }
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+
+ crtstart.asm
+\emph default
+ and when linking your project explicitely specify
+\emph on
+crtstart.rel
+\emph default
+.
+ As a bonus a listing of the relocated object file
+\emph on
+crtstart.rst
+\emph default
+ is generated.
+\end_layout
+
+\begin_layout Standard
\begin_inset VSpace bigskip
\end_inset
-no-std-crt0
\emph default
-\begin_inset LatexCommand \index{-\\/-no-std-crt0}
+\begin_inset LatexCommand \index{-\/-no-std-crt0}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_far (storage class)}
+\begin_inset LatexCommand \index{\_\_far (storage class)}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\_\\_at}
+\begin_inset LatexCommand \index{\_\_at}
\end_inset
\end_inset
about
-\family default
-
-\family typewriter
\series bold
-volatile
-\family default
+ volatile
\series default
-
-\family typewriter
-*/
+ */
\newline
\newline
\InsetSpace ~
if( head != (unsigned char)(tail-1)
)\InsetSpace ~
-/* cast
-\family default
-
-\family typewriter
+/* cast
\series bold
needed
-\family default
\series default
-
-\family typewriter
-to avoid promotion
+ to avoid promotion
\begin_inset LatexCommand \index{promotion to signed int}
\end_inset
\InsetSpace ~
\InsetSpace ~
_asm
-\begin_inset LatexCommand \index{\\_asm}
+\begin_inset LatexCommand \index{\_asm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_asm}
+\begin_inset LatexCommand \index{\_\_asm}
\end_inset
r2,dpl
\newline
;buffer.c if( head != (unsigned char)(tail-1) ) \InsetSpace ~
-/* cast
-\family default
-
-\family typewriter
+/* cast
\series bold
needed
-\family default
\series default
-
-\family typewriter
-to avoid promotion
+ to avoid promotion
\begin_inset LatexCommand \index{promotion to signed int}
\end_inset
\InsetSpace ~
\InsetSpace ~
_endasm
-\begin_inset LatexCommand \index{\\_endasm}
+\begin_inset LatexCommand \index{\_endasm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_endasm}
+\begin_inset LatexCommand \index{\_\_endasm}
\end_inset
\InsetSpace ~
\InsetSpace ~
_asm
-\begin_inset LatexCommand \index{\\_asm}
+\begin_inset LatexCommand \index{\_asm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_asm}
+\begin_inset LatexCommand \index{\_\_asm}
\end_inset
\InsetSpace ~
\InsetSpace ~
_endasm
-\begin_inset LatexCommand \index{\\_endasm}
+\begin_inset LatexCommand \index{\_endasm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_endasm}
+\begin_inset LatexCommand \index{\_\_endasm}
\end_inset
The compiler does not do any validation of the code within the
\family typewriter
_asm
-\begin_inset LatexCommand \index{\\_asm}
+\begin_inset LatexCommand \index{\_asm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_asm}
+\begin_inset LatexCommand \index{\_\_asm}
\end_inset
_endasm
\size footnotesize
-\begin_inset LatexCommand \index{\\_endasm}
+\begin_inset LatexCommand \index{\_endasm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_endasm}
+\begin_inset LatexCommand \index{\_\_endasm}
\end_inset
-
\emph on
peep-asm
-\begin_inset LatexCommand \index{-\\/-peep-asm}
+\begin_inset LatexCommand \index{-\/-peep-asm}
\end_inset
A special keyword may be associated with a function declaring it as
\emph on
_naked
-\begin_inset LatexCommand \index{\\_naked}
+\begin_inset LatexCommand \index{\_naked}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_naked}
+\begin_inset LatexCommand \index{\_\_naked}
\end_inset
.
-
+
\emph default
- The
+The
\emph on
_naked
\emph default
\end_inset
-\begin_inset LatexCommand \index{\\_\\_interrupt}
+\begin_inset LatexCommand \index{\_\_interrupt}
\end_inset
\InsetSpace ~
\InsetSpace ~
_asm
-\begin_inset LatexCommand \index{\\_asm}
+\begin_inset LatexCommand \index{\_asm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_asm}
+\begin_inset LatexCommand \index{\_\_asm}
\end_inset
\InsetSpace ~
\InsetSpace ~
_endasm
-\begin_inset LatexCommand \index{\\_endasm}
+\begin_inset LatexCommand \index{\_endasm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_endasm}
+\begin_inset LatexCommand \index{\_\_endasm}
\end_inset
\begin_layout Verse
\family typewriter
-Note, this is an
-\family default
-
-\family typewriter
+Note, this is an
\emph on
outdated
-\family default
\emph default
-
-\family typewriter
-example, recent versions of SDCC generate
+ example, recent versions of SDCC generate
\newline
-the
-\family default
-
-\family typewriter
+the
\emph on
same
-\family default
\emph default
-
-\family typewriter
-code for simpleInterrupt() and nakedInterrupt()!
+ code for simpleInterrupt() and nakedInterrupt()!
\newline
\newline
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
-pus
-h\InsetSpace ~
+pu
+sh\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\begin_layout Standard
The related directive #pragma exclude
-\begin_inset LatexCommand \index{\\#pragma exclude}
+\begin_inset LatexCommand \index{\#pragma exclude}
\end_inset
\family typewriter
_asm
-\begin_inset LatexCommand \index{\\_asm}
+\begin_inset LatexCommand \index{\_asm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_asm}
+\begin_inset LatexCommand \index{\_\_asm}
\end_inset
b,00001$
\newline
_endasm
-\begin_inset LatexCommand \index{\\_endasm}
+\begin_inset LatexCommand \index{\_endasm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_endasm}
+\begin_inset LatexCommand \index{\_\_endasm}
\end_inset
\InsetSpace ~
\InsetSpace ~
_endasm
-\begin_inset LatexCommand \index{\\_endasm}
+\begin_inset LatexCommand \index{\_endasm}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_endasm}
+\begin_inset LatexCommand \index{\_\_endasm}
\end_inset
\end_inset
-
+
\emph default
- and
+and
\emph on
-ACC
+ ACC
\begin_inset LatexCommand \index{ACC (mcs51, ds390 register)}
\end_inset
\emph on
DPL
\emph default
-,
+,
\emph on
-B
+ B
\emph default
and
\emph on
\end_inset
-callee-saves
-\begin_inset LatexCommand \index{-\\/-callee-saves}
+\begin_inset LatexCommand \index{-\/-callee-saves}
\end_inset
\end_inset
-stack-auto
-\begin_inset LatexCommand \index{-\\/-stack-auto}
+\begin_inset LatexCommand \index{-\/-stack-auto}
\end_inset
\end_inset
-int-long-reent
-\begin_inset LatexCommand \index{-\\/-int-long-reent}
+\begin_inset LatexCommand \index{-\/-int-long-reent}
\end_inset
\end_inset
-
+
\family default
- and
+and
\family typewriter
putchar()
\begin_inset LatexCommand \index{putchar()}
\end_layout
\begin_layout Standard
-The default
+The default
\family typewriter
-printf()
+ printf()
\begin_inset LatexCommand \index{printf()}
\end_inset
\family default
- implementation in
+ implementation in
\family typewriter
-printf_large.c
+ printf_large.c
\family default
does not support float (except on ds390).
To enable this recompile it with the option
\end_inset
DUSE_FLOATS=1
-\begin_inset LatexCommand \index{USE\\_FLOATS}
+\begin_inset LatexCommand \index{USE\_FLOATS}
\end_inset
\emph default
on the command line.
- Use
+ Use
\emph on
--
+ -
\begin_inset ERT
status collapsed
\end_inset
-model-large
-\begin_inset LatexCommand \index{-\\/-model-large}
+\begin_inset LatexCommand \index{-\/-model-large}
\end_inset
If you're short on code memory you might want to use
\family typewriter
printf_small()
-\begin_inset LatexCommand \index{printf\\_small()}
+\begin_inset LatexCommand \index{printf\_small()}
\end_inset
\emph on
instead
\emph default
- of
+ of
\family typewriter
-printf().
+ printf().
\family default
For the mcs51 there additionally are assembly versions
\family typewriter
printf_tiny()
-\begin_inset LatexCommand \index{printf\\_tiny() (mcs51)}
+\begin_inset LatexCommand \index{printf\_tiny() (mcs51)}
\end_inset
(subset of printf using less than 270 bytes) and
\family typewriter
printf_fast()
-\begin_inset LatexCommand \index{printf\\_fast() (mcs51)}
+\begin_inset LatexCommand \index{printf\_fast() (mcs51)}
\end_inset
-
+
\family default
- and
+and
\family typewriter
-printf_fast_f()
-\begin_inset LatexCommand \index{printf\\_fast\\_f() (mcs51)}
+ printf_fast_f()
+\begin_inset LatexCommand \index{printf\_fast\_f() (mcs51)}
\end_inset
\end_inset
-xstack option
-\begin_inset LatexCommand \index{-\\/-xstack}
+\begin_inset LatexCommand \index{-\/-xstack}
\end_inset
\end_inset
-stack-auto
-\begin_inset LatexCommand \index{-\\/-stack-auto}
+\begin_inset LatexCommand \index{-\/-stack-auto}
\end_inset
save
\series default
-\begin_inset LatexCommand \index{\\#pragma save}
+\begin_inset LatexCommand \index{\#pragma save}
\end_inset
restore
\series default
-\begin_inset LatexCommand \index{\\#pragma restore}
+\begin_inset LatexCommand \index{\#pragma restore}
\end_inset
callee_saves
\series default
-\begin_inset LatexCommand \index{\\#pragma callee\\_saves}
+\begin_inset LatexCommand \index{\#pragma callee\_saves}
\end_inset
), the function names specified in #pragma\InsetSpace ~
callee_saves
-\begin_inset LatexCommand \index{\\#pragma callee\\_saves}
+\begin_inset LatexCommand \index{\#pragma callee\_saves}
\end_inset
exclude
\series default
-\begin_inset LatexCommand \index{\\#pragma exclude}
+\begin_inset LatexCommand \index{\#pragma exclude}
\end_inset
To enable the normal register saving for ISR functions use #pragma\InsetSpace ~
exclude\InsetSpace ~
none
-\begin_inset LatexCommand \index{\\#pragma exclude}
+\begin_inset LatexCommand \index{\#pragma exclude}
\end_inset
.
See also the related keyword _naked
-\begin_inset LatexCommand \index{\\_naked}
+\begin_inset LatexCommand \index{\_naked}
\end_inset
-\begin_inset LatexCommand \index{\\_\\_naked}
+\begin_inset LatexCommand \index{\_\_naked}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\#pragma less\\_pedantic}
+\begin_inset LatexCommand \index{\#pragma less\_pedantic}
\end_inset
disable_warning
\series default
<nnnn>
-\begin_inset LatexCommand \index{\\#pragma disable\\_warning}
+\begin_inset LatexCommand \index{\#pragma disable\_warning}
\end_inset
nogcse
\series default
-\begin_inset LatexCommand \index{\\#pragma nogcse}
+\begin_inset LatexCommand \index{\#pragma nogcse}
\end_inset
noinduction
\series default
-\begin_inset LatexCommand \index{\\#pragma noinduction}
+\begin_inset LatexCommand \index{\#pragma noinduction}
\end_inset
noinvariant
\series default
-\begin_inset LatexCommand \index{\\#pragma noinvariant}
+\begin_inset LatexCommand \index{\#pragma noinvariant}
\end_inset
noiv
\series default
-\begin_inset LatexCommand \index{\\#pragma noiv}
+\begin_inset LatexCommand \index{\#pragma noiv}
\end_inset
nojtbound
\series default
-\begin_inset LatexCommand \index{\\#pragma nojtbound}
+\begin_inset LatexCommand \index{\#pragma nojtbound}
\end_inset
noloopreverse
\series default
-\begin_inset LatexCommand \index{\\#pragma noloopreverse}
+\begin_inset LatexCommand \index{\#pragma noloopreverse}
\end_inset
nooverlay
\series default
-\begin_inset LatexCommand \index{\\#pragma nooverlay}
+\begin_inset LatexCommand \index{\#pragma nooverlay}
\end_inset
stackauto
\series default
-\begin_inset LatexCommand \index{\\#pragma stackauto}
+\begin_inset LatexCommand \index{\#pragma stackauto}
\end_inset
\end_inset
-stack-auto
-\begin_inset LatexCommand \index{-\\/-stack-auto}
+\begin_inset LatexCommand \index{-\/-stack-auto}
\end_inset
opt_code_speed
\series default
-\begin_inset LatexCommand \index{\\#pragma opt\\_code\\_speed}
+\begin_inset LatexCommand \index{\#pragma opt\_code\_speed}
\end_inset
opt_code_size
\series default
-\begin_inset LatexCommand \index{\\#pragma opt\\_code\\_size}
+\begin_inset LatexCommand \index{\#pragma opt\_code\_size}
\end_inset
opt_code_balanced
\series default
-\begin_inset LatexCommand \index{\\#pragma opt\\_code\\_balanced}
+\begin_inset LatexCommand \index{\#pragma opt\_code\_balanced}
\end_inset
std_sdcc89
\series default
-\begin_inset LatexCommand \index{\\#pragma std\\_sdcc89}
+\begin_inset LatexCommand \index{\#pragma std\_sdcc89}
\end_inset
std_c89
\series default
-\begin_inset LatexCommand \index{\\#pragma std\\_c89}
+\begin_inset LatexCommand \index{\#pragma std\_c89}
\end_inset
std_sdcc99
\series default
-\begin_inset LatexCommand \index{\\#pragma std\\_sdcc99}
+\begin_inset LatexCommand \index{\#pragma std\_sdcc99}
\end_inset
std_c99
\series default
-\begin_inset LatexCommand \index{\\#pragma std\\_c99}
+\begin_inset LatexCommand \index{\#pragma std\_c99}
\end_inset
codeseg
\series default
<name>
-\begin_inset LatexCommand \index{\\#pragma codeseg}
+\begin_inset LatexCommand \index{\#pragma codeseg}
\end_inset
constseg
\series default
<name>
-\begin_inset LatexCommand \index{\\#pragma constseg}
+\begin_inset LatexCommand \index{\#pragma constseg}
\end_inset
\end_inset
-\begin_inset LatexCommand \index{\\#pragma pedantic\\_parse\\_number}
+\begin_inset LatexCommand \index{\#pragma pedantic\_parse\_number}
\end_inset
\newline
Below is an example on how to use this pragma.
-
+
\emph on
-Note: this functionality is not in conformance with standard!
+ Note: this functionality is not in conformance with standard!
\end_layout
\begin_layout Verse
\family typewriter
#pragma pedantic_parse_number +
-\begin_inset LatexCommand \index{\\#pragma pedantic\\_parse\\_number}
+\begin_inset LatexCommand \index{\#pragma pedantic\_parse\_number}
\end_inset
preproc_asm
\series default
-\begin_inset LatexCommand \index{\\#pragma preproc\\_asm}
+\begin_inset LatexCommand \index{\#pragma preproc\_asm}
\end_inset
\family typewriter
#pragma preproc_asm -
-\begin_inset LatexCommand \index{\\#pragma preproc\\_asm}
+\begin_inset LatexCommand \index{\#pragma preproc\_asm}
\end_inset
sdcc_hash
\series default
-\begin_inset LatexCommand \index{\\#pragma sdcc\\_hash}
+\begin_inset LatexCommand \index{\#pragma sdcc\_hash}
\end_inset
#pragma preproc_asm +
\newline
#pragma sdcc_hash +
-\begin_inset LatexCommand \index{\\#pragma sdcc\\_hash}
+\begin_inset LatexCommand \index{\#pragma sdcc\_hash}
\end_inset
\family typewriter
#pragma save
-\begin_inset LatexCommand \index{\\#pragma save}
+\begin_inset LatexCommand \index{\#pragma save}
\end_inset
/* save the current settings */
\newline
#pragma nogcse
-\begin_inset LatexCommand \index{\\#pragma nogcse}
+\begin_inset LatexCommand \index{\#pragma nogcse}
\end_inset
/* turnoff global subexpression elimination */
\newline
#pragma noinduction
-\begin_inset LatexCommand \index{\\#pragma noinduction}
+\begin_inset LatexCommand \index{\#pragma noinduction}
\end_inset
}
\newline
#pragma restore
-\begin_inset LatexCommand \index{\\#pragma restore}
+\begin_inset LatexCommand \index{\#pragma restore}
\end_inset
\begin_layout Standard
The compiler creates the following #defines
-\begin_inset LatexCommand \index{\\#defines}
+\begin_inset LatexCommand \index{\#defines}
\end_inset
\begin_layout Standard
\begin_inset Tabular
-<lyxtabular version="3" rows="11" columns="2">
+<lyxtabular version="3" rows="15" columns="2">
<features>
<column alignment="left" valignment="top" leftline="true" width="3in">
<column alignment="left" valignment="top" leftline="true" rightline="true" width="3in">
\begin_layout Standard
SDCC_mcs51
-\begin_inset LatexCommand \index{SDCC\\_mcs51}
+\begin_inset LatexCommand \index{SDCC\_mcs51}
\end_inset
or SDCC_ds390
-\begin_inset LatexCommand \index{SDCC\\_ds390}
+\begin_inset LatexCommand \index{SDCC\_ds390}
\end_inset
or SDCC_z80
-\begin_inset LatexCommand \index{SDCC\\_z80}
+\begin_inset LatexCommand \index{SDCC\_z80}
\end_inset
\begin_layout Standard
__mcs51
-\begin_inset LatexCommand \index{\\_\\_mcs51}
+\begin_inset LatexCommand \index{\_\_mcs51}
\end_inset
, __ds390
-\begin_inset LatexCommand \index{\\_\\_ds390}
+\begin_inset LatexCommand \index{\_\_ds390}
\end_inset
, __hc08
-\begin_inset LatexCommand \index{\\_\\_hc08}
+\begin_inset LatexCommand \index{\_\_hc08}
\end_inset
, __z80
-\begin_inset LatexCommand \index{\\_\\_z80}
+\begin_inset LatexCommand \index{\_\_z80}
\end_inset
\begin_layout Standard
SDCC_STACK_AUTO
-\begin_inset LatexCommand \index{SDCC\\_STACK\\_AUTO}
+\begin_inset LatexCommand \index{SDCC\_STACK\_AUTO}
\end_inset
\begin_layout Standard
SDCC_MODEL_SMALL
-\begin_inset LatexCommand \index{SDCC\\_MODEL\\_SMALL}
+\begin_inset LatexCommand \index{SDCC\_MODEL\_SMALL}
\end_inset
\begin_layout Standard
SDCC_MODEL_MEDIUM
-\begin_inset LatexCommand \index{SDCC\\_MODEL\\_MEDIUM}
+\begin_inset LatexCommand \index{SDCC\_MODEL\_MEDIUM}
\end_inset
\begin_layout Standard
SDCC_MODEL_LARGE
-\begin_inset LatexCommand \index{SDCC\\_MODEL\\_LARGE}
+\begin_inset LatexCommand \index{SDCC\_MODEL\_LARGE}
\end_inset
\begin_layout Standard
SDCC_USE_XSTACK
-\begin_inset LatexCommand \index{SDCC\\_USE\\_XSTACK}
+\begin_inset LatexCommand \index{SDCC\_USE\_XSTACK}
\end_inset
\begin_layout Standard
SDCC_STACK_TENBIT
-\begin_inset LatexCommand \index{SDCC\\_STACK\\_TENBIT}
+\begin_inset LatexCommand \index{SDCC\_STACK\_TENBIT}
\end_inset
\end_inset
</cell>
</row>
-<row topline="true" bottomline="true">
+<row topline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\begin_layout Standard
SDCC_MODEL_FLAT24
-\begin_inset LatexCommand \index{SDCC\\_MODEL\\_FLAT24}
+\begin_inset LatexCommand \index{SDCC\_MODEL\_FLAT24}
\end_inset
is used
\end_layout
+\end_inset
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+SDCC_REVISION
+\begin_inset LatexCommand \index{SDCC\_REVISION}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+Always defined.
+ SDCC svn revision number
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+SDCC_PARMS_IN_BANK1
+\begin_inset LatexCommand \index{SDCC\_PARMS\_IN\_BANK1}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+when
+\emph on
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-parms-in-bank1
+\emph default
+ is used
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row topline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+SDCC_FLOAT_REENT
+\begin_inset LatexCommand \index{SDCC\_MODEL\_FLAT24}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+when
+\emph on
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-float-reent
+\emph default
+ is used
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row topline="true" bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+SDCC_INT_LONG_REENT
+\begin_inset LatexCommand \index{SDCC\_INT\_LONG\_REENT}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+when
+\emph on
+-
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-int-long-reent
+\emph default
+ is used
+\end_layout
+
\end_inset
</cell>
</row>
should define an sfr with the name _XPAGE
\family typewriter
-\begin_inset LatexCommand \index{\\_XPAGE (mcs51)}
+\begin_inset LatexCommand \index{\_XPAGE (mcs51)}
\end_inset
These are currently not used for the MCS51 port.
If you absolutely need them you can fall back to inline assembly or submit
a patch to SDCC.
+\end_layout
+
+\begin_layout Subsection
+Bankswitching
+\end_layout
+
+\begin_layout Standard
+Bankswitching
+\begin_inset LatexCommand \index{Bankswitching}
+
+\end_inset
+
+ (a.k.a.
+ code banking
+\begin_inset LatexCommand \index{code banking}
+
+\end_inset
+
+) is a technique to increase the code space above the 64k limit of the 8051.
+\end_layout
+
+\begin_layout Subsubsection
+Hardware
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="3" columns="4">
+<features>
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" leftline="true" width="0">
+<column alignment="center" valignment="top" leftline="true" width="0">
+<column alignment="center" valignment="top" leftline="true" rightline="true" width="0">
+<row topline="true" bottomline="true">
+<cell multicolumn="1" alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+8000-FFFF
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+bank1
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+bank2
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+bank3
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row topline="true" bottomline="true">
+<cell multicolumn="1" alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+0000-7FFF
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+common
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell multicolumn="1" alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+SiLabs C8051F120 example
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\newline
+
+\newline
+Usually the hardware uses some sfr (an output port or an internal sfr) to
+ select a bank and put it in the banked area of the memory map.
+ Because the selected bank usually becomes active immediately you cannot
+ jump call directly from one bank to another and need to use a so-called
+ trampoline in the common area.
+ For SDCC an example trampoline is in crtbank.asm and you may need to change
+ it to your 8051 derivative or schematic.
+ The presented code is written for the C8051F120.
+\newline
+
+\newline
+When calling a banked function
+ SDCC will put the LSB of the functions address in register R0, the MSB
+ in R1 and the bank in R2 and then call this trampoline __sdcc_banked_call.
+ The current selected bank is saved on the stack, the new bank is selected
+ and an indirect jump is made.
+ When the banked function returns it jumps to __sdcc_banked_ret which restores
+ the previous bank and returns to the caller.
+\end_layout
+
+\begin_layout Subsubsection
+Software
+\end_layout
+
+\begin_layout Standard
+When writing banked software using SDCC you need to use some special keywords
+ and options.
+ You also need to take over a bit of work from the linker.
+\newline
+
+\newline
+To create a function
+ that can be called from another bank it requires the keyword banked.
+ The caller must see this in the prototype of the callee and the callee
+ needs it for a proper return.
+ Called functions within the same bank as the caller do not need the banked
+ keyword nor do functions in the common area.
+ Beware: SDCC does not know or check if functions are in the same bank.
+ This is your responsibility!
+\newline
+
+\newline
+Normally all functions you write end up in
+ the segment CSEG.
+ If you want a function explicitly to reside in the common area put it in
+ segment HOME.
+ This applies for instance to interrupt service routines as they should
+ not be banked.
+\end_layout
+
+\begin_layout Standard
+Functions that need to be in a switched bank must be put in a named segment.
+ The name can be mostly anything upto eight characters (e.g.
+ BANK1).
+ To do this you either use --codeseg BANK1 on the command line when compiling
+ or #pragma codeseg BANK1 at the top of the C source file.
+ The segment name always applies to the whole source file and generated
+ object so functions for different banks need to be defined in different
+ source files.
+\newline
+
+\newline
+When linking your objects you need to tell the linker where
+ to put your segments.
+ To do this you use the following command line option to SDCC: -Wl-b BANK1=0x180
+00.
+ This sets the virtual start address of this segment.
+ It sets the banknumber to 0x01 and maps the bank to 0x8000 and up.
+ The linker will not check for overflows, again this is your responsibility.
+\end_layout
+
+\begin_layout Standard
\begin_inset VSpace bigskip
\end_inset
\end_inset
-\newpage
-
\end_layout
\begin_layout Section
\end_layout
\begin_layout Standard
-16F: 627, 627a, 628, 628a, 630, 636, 639, 648a, 676, 684, 685, 687, 688,
- 689, 690
+16CR: 620a, 73, 74, 76, 77
+\end_layout
+
+\begin_layout Standard
+16F: 616, 627, 627a, 628, 628a, 630, 636, 639, 648, 648a, 676, 684, 685,
+ 687, 688, 689, 690
\end_layout
\begin_layout Standard
-16F: 716, 72, 73, 737, 74, 76, 767, 77, 777, 785
+16F: 716, 72, 73, 737, 74, 747, 76, 767, 77, 777, 785
\end_layout
\begin_layout Standard
16F: 818, 819, 84, 84a, 87, 870, 871, 872, 873, 873a, 874, 874a, 876, 876a,
- 877, 877a, 88
+ 877, 877a, 88, 886, 887
\end_layout
\begin_layout Standard
-16F: 913, 914, 916, 917
+16F: 913, 914, 916, 917, 946
+\end_layout
+
+\begin_layout Standard
+26HV: 626, 785
\end_layout
\begin_layout Standard
\end_layout
\begin_layout Standard
-Please note that indentations within a
+Please note that indentations within a
\family typewriter
-Makefile
+ Makefile
\family default
have to be done with a tabulator character.
\end_layout
\end_inset
-debug-xtra
-\begin_inset LatexCommand \index{PIC14!Options!-\\/-debug-extra}
+\begin_inset LatexCommand \index{PIC14!Options!-\/-debug-extra}
\end_inset
\end_inset
-no-pcode-opt
-\begin_inset LatexCommand \index{PIC14!Options!-\\/-no-pcode-opt}
+\begin_inset LatexCommand \index{PIC14!Options!-\/-no-pcode-opt}
\end_inset
\end_inset
-stack-loc
-\begin_inset LatexCommand \index{PIC14!Options!-\\/-stack-loc}
+\begin_inset LatexCommand \index{PIC14!Options!-\/-stack-loc}
\end_inset
\end_inset
-stack-size
-\begin_inset LatexCommand \index{PIC14!Options!-\\/-stack-size}
+\begin_inset LatexCommand \index{PIC14!Options!-\/-stack-size}
\end_inset
\begin_layout Standard
Functions with variable argument lists (like printf) are not yet supported.
- Similarly, taking the argument of the first argument passed into a function
+ Similarly, taking the address of the first argument passed into a function
does not work: It is currently passed in WREG and has no address...
\end_layout
\end_inset
-callee-saves
-\begin_inset LatexCommand \index{PIC16!Options!-\\/-callee-saves}
+\begin_inset LatexCommand \index{PIC16!Options!-\/-callee-saves}
\end_inset
\end_inset
-fommit-frame-pointer
-\begin_inset LatexCommand \index{PIC16!Options!-\\/-fommit-frame-pointer}
+\begin_inset LatexCommand \index{PIC16!Options!-\/-fommit-frame-pointer}
\end_inset
\end_inset
-debug
-\begin_inset LatexCommand \index{-\\/-debug}
+\begin_inset LatexCommand \index{-\/-debug}
\end_inset
\begin_layout Description
stack
-\begin_inset LatexCommand \index{PIC16!Pragmas!\\#pragma stack}
+\begin_inset LatexCommand \index{PIC16!Pragmas!\#pragma stack}
\end_inset
\begin_layout Description
code
-\begin_inset LatexCommand \index{PIC16!Pragmas!\\#pragma code}
+\begin_inset LatexCommand \index{PIC16!Pragmas!\#pragma code}
\end_inset
\begin_layout Enumerate
Add DEVICE to
\family typewriter
-/path/to/sdcc/device/lib/pics.all
+/path/to/sdcc/device/lib/pic16/pics.all
\family default
(and
\family typewriter
The FILE type is actually a generic pointer which defines one more type
of generic pointers, the
\emph on
-stream
+stream
\emph default
- pointer.
+pointer.
This new type has the format:
\end_layout
\begin_layout Standard
In order to increase performance
\emph on
-putchar
+putchar
\emph default
- is declared in stdio.h as having its parameter in WREG (it has the wparam
+is declared in stdio.h as having its parameter in WREG (it has the wparam
keyword).
In stdio.h exists the macro PUTCHAR(arg) that defines the putchar function
in a user-friendly way.
\begin_layout Standard
For sprintf and vsprintf
\emph on
-buf
+buf
\emph default
- should normally be a data pointer where the resulting string will be placed.
+should normally be a data pointer where the resulting string will be placed.
No range checking is done so the user should allocate the necessery buffer.
For fprintf and vfprintf
\emph on
\labelwidthstring 00.00.0000
\series medium
-SIGHANDLER(handler)
+SIGHANDLER(handler)
\series default
- this declares the function prototype for the
+this declares the function prototype for the
\emph on
handler
\emph default
\end_inset
-debug
-\begin_inset LatexCommand \index{-\\/-debug}
+\begin_inset LatexCommand \index{-\/-debug}
\end_inset
\newline
\family typewriter
-(load-file sdcdbsrc.el)
+(load-file sdcdbsrc.el)
\family default
-
+
\newline
\newline
more often than other compilers.
Eventually insert explicit casts to
\family typewriter
-(char)
+(char)
\family default
- or
+or
\family typewriter
-(unsigned char)
+ (unsigned char)
\family default
.
Also check that the ~\InsetSpace ~
operator
-\begin_inset LatexCommand \index{\\~\\/ Operator}
+\begin_inset LatexCommand \index{\~\/ Operator}
\end_inset
\begin_layout Itemize
check for differences in printf parameters (some compilers push (va_arg
-\begin_inset LatexCommand \index{vararg, va\\_arg}
+\begin_inset LatexCommand \index{vararg, va\_arg}
\end_inset
\begin_inset Text
\begin_layout Standard
-You're reading it right now
+You're reading it right now
\emph on
-\InsetSpace ~
+ \InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\begin_inset Text
\begin_layout Standard
-sdcc/Changelog
+sdcc/Changelog
\emph on
-\InsetSpace ~
+ \InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\emph default
\bar default
\noun default
-f
+f
\emph on
-\InsetSpace ~
+ \InsetSpace ~
\InsetSpace ~
\InsetSpace ~
\begin_layout Standard
\align left
\begin_inset Tabular
-<lyxtabular version="3" rows="14" columns="3">
+<lyxtabular version="3" rows="16" columns="3">
<features>
<column alignment="left" valignment="top" leftline="true" width="0pt">
<column alignment="block" valignment="top" leftline="true" width="30line%">
-<column alignment="left" valignment="top" leftline="true" rightline="true" width="0pt">
+<column alignment="left" valignment="top" leftline="true" rightline="true" width="40col%">
<row topline="true" bottomline="true">
<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
\begin_inset Text
\end_inset
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+d52
+\begin_inset LatexCommand \index{d52}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{d52 (disassembler)}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+Disassembler, can count instruction cycles
+\begin_inset LatexCommand \index{instruction cycles (count)}
+
+\end_inset
+
+, use with options -pnd
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset LatexCommand \url{http://www.8052.com/users/disasm/}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row bottomline="true">
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+cmake
+\begin_inset LatexCommand \index{cmake}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+Cross platform build system, generates Makefiles
+\begin_inset LatexCommand \index{Makefile}
+
+\end_inset
+
+ and project workspaces
+\begin_inset LatexCommand \index{project workspace}
+
+\end_inset
+
+
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Standard
+\begin_inset LatexCommand \url{http://www.cmake.org}
+
+\end_inset
+
+ \InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+and a dedicated wiki entry:
+\begin_inset LatexCommand \url{http://www.cmake.org/Wiki/CmakeSdcc}
+
+\end_inset
+
+
\end_layout
\end_inset
\end_inset
-dumpall
-\begin_inset LatexCommand \index{-\\/-dumpall}
+\begin_inset LatexCommand \index{-\/-dumpall}
\end_inset
\end_inset
-\family default
\series default
- will do.
+
+\family default
+will do.
\end_layout
\begin_layout Section
You'll find some small examples in the directory
\emph on
sdcc/device/examples/.
-
+
\emph default
- More examples and libraries are available at
+More examples and libraries are available at
\emph on
-The SDCC Open Knowledge Resource
+ The SDCC Open Knowledge Resource
\begin_inset LatexCommand \url{http://sdccokr.dl9sec.de/}
\end_inset
-
+
\emph default
- web site or at
+web site or at
\begin_inset LatexCommand \url{http://www.pjrc.com/tech/8051/}
\end_inset
\end_inset
check that SDCC itself compiles flawlessly on several host platforms (i386,
- Opteron, 64 bit Alpha, ppc64, Mac OS X on PPC, Solaris on Sparc) and checks
- the quality of the code generated by SDCC by running the code for several
- target platforms through simulators.
+ Opteron, 64 bit Alpha, ppc64, Mac OS X on ppc and i386, Solaris on Sparc)
+ and checks the quality of the code generated by SDCC by running the code
+ for several target platforms through simulators.
The regression test suite comprises more than 100 files which expand to
more than 500 test cases which include more than 4500 tests.
The results of these tests are published daily on SDCC's snapshot page
\emph on
loop invariant
\emph default
- lifting and
+ lifting and
\emph on
-strength reduction
+ strength reduction
\emph default
of loop induction variables.
In addition to the strength reduction the optimizer marks the induction
-noinduction option) or for a given function only using #pragma\InsetSpace ~
noinduction
-\begin_inset LatexCommand \index{\\#pragma noinduction}
+\begin_inset LatexCommand \index{\#pragma noinduction}
\end_inset
\begin_layout Standard
The pragma nojtbound
-\begin_inset LatexCommand \index{\\#pragma nojtbound}
+\begin_inset LatexCommand \index{\#pragma nojtbound}
\end_inset
...
\newline
-i = ((i << 1) | (i >> 7));
+i = ((i << 1) | (i >> 7));
\family default
-
+
\newline
\family typewriter
...
\newline
-i = ((i << 4) | (i >> 4));
+i = ((i << 4) | (i >> 4));
\family default
-
+
\newline
\family typewriter
\end_inset
--datapointer so little-endian is the more efficient byte order.
+-datapointer
+\emph on
+
+\emph default
+so little-endian is the more efficient byte order.
\end_layout
\end_inset
\end_inset
-peep-file
-\begin_inset LatexCommand \index{-\\/-peep-file}
+\begin_inset LatexCommand \index{-\/-peep-file}
\end_inset
\emph default
-acall-ajmp
-\begin_inset LatexCommand \index{ajmp}
+\begin_inset LatexCommand \index{-\/-acall-ajmp}
\end_inset
Currently implemented are
\emph on
labelInRange, labelRefCount, labelIsReturnOnly, operandsNotSame, xramMovcOption,
- 24bitMode, portIsDS390, 24bitModeAndPortDS390
+ 24bitMode, portIsDS390, 24bitModeAndPortDS390
\emph default
- and
+and
\emph on
-notVolatile
+ notVolatile
\emph default
.
\end_layout
\end_inset
-stack-auto
-\begin_inset LatexCommand \index{-\\/-stack-auto}
+\begin_inset LatexCommand \index{-\/-stack-auto}
\end_inset
\series bold
struct
-\family default
\series default
-
-\family typewriter
-s foo1 (
+ s foo1 (
\series bold
struct
-\family default
\series default
-
-\family typewriter
-s parms) /* invalid in SDCC although allowed in ANSI */
+ s parms) /* invalid in SDCC although allowed in ANSI */
\newline
{
\newline
\begin_layout Itemize
Old K&R style
-\begin_inset LatexCommand \index{K\\&R style}
+\begin_inset LatexCommand \index{K\&R style}
\end_inset
for (
\series bold
int
-\family default
\series default
-
-\family typewriter
-i=0; i<10; i++) /* is invalid in SDCC although allowed in C99 */
+ i=0; i<10; i++) /* is invalid in SDCC although allowed in C99 */
\end_layout
\end_deeper
\end_inset
-\family default
\series default
-
-\family typewriter
-int increment (int a) { return a+1; } /* inlines the increment without function
- call overhead */
+ int increment (int a) { return a+1; } /* inlines the increment without
+ function call overhead */
\newline
-int *
-\family default
-
-\family typewriter
+int *
\series bold
restrict
\begin_inset LatexCommand \index{inline (not supported)}
\end_inset
-\family default
\series default
-
-\family typewriter
-p; /* accepted but ignored */
+ p; /* accepted but ignored */
\end_layout
\end_deeper
\end_inset
-std-c89
-\begin_inset LatexCommand \index{-\\/-std-c89}
+\begin_inset LatexCommand \index{-\/-std-c89}
\end_inset
- or -
+
+\series default
+or
+\series bold
+ -
\begin_inset ERT
status collapsed
\end_inset
-std-c99
-\begin_inset LatexCommand \index{-\\/-std-c99}
+\begin_inset LatexCommand \index{-\/-std-c99}
\end_inset
'_naked'.
Compliant equivalents of these keywords are always available in a form
that begin with two underscores
-\begin_inset LatexCommand \index{\\_\\_ (prefix for extended keywords)}
+\begin_inset LatexCommand \index{\_\_ (prefix for extended keywords)}
\end_inset
'__data' instead of 'data'.
\end_layout
+\begin_layout Itemize
+Integer promotion of variable arguments is not performed if the argument
+ is explicitly taypecasted unless the
+\series bold
+ -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c89
+\begin_inset LatexCommand \index{-\/-std-c89}
+
+\end_inset
+
+
+\series default
+or
+\series bold
+ -
+\begin_inset ERT
+status collapsed
+
+\begin_layout Standard
+
+
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-std-c99
+\begin_inset LatexCommand \index{-\/-std-c99}
+
+\end_inset
+
+
+\series default
+ command line options are used.
+\end_layout
+
+\begin_deeper
+\begin_layout Verse
+
+\family typewriter
+void vararg_func (char *str, ...) { str; }
+\newline
+
+\newline
+void main (void)
+\newline
+{
+\newline
+\InsetSpace ~
+\InsetSpace ~
+char c = 10;
+\newline
+
+\newline
+\InsetSpace ~
+\InsetSpace ~
+/* argument
+ u is promoted to int before
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* passing to function */
+\newline
+\InsetSpace ~
+\InsetSpace ~
+vararg_func ("%c", c);
+\newline
+
+\newline
+\InsetSpace ~
+\InsetSpace ~
+/*
+ argument u is not promoted to int,
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* it is passed as char to function
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* if
+ --std-cXX is not defined;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* is promoted to int before passing
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+* to function
+ if --std-cXX is defined */
+\newline
+\InsetSpace ~
+\InsetSpace ~
+vararg_func ("%bc", (char)u);
+\newline
+}
+\end_layout
+
+\end_deeper
\begin_layout Section
Cyclomatic Complexity
\begin_inset LatexCommand \index{Cyclomatic complexity}
\shape italic
This is an excerpt from an article published in Circuit Cellar Magazine
- in
-\shape default
-
+ in
\series bold
-\shape italic
August 2000
\series default
.
\shape slanted
\size footnotesize
see f.e.
-
-\shape default
\family typewriter
-\shape slanted
gen51Code()
\family default
-\shape default
-
-\shape slanted
-in
-\shape default
-
+ in
\family typewriter
-\shape slanted
src/mcs51/gen.c
\end_layout
\end_layout
\begin_layout Standard
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net#Who}
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/#Who}
\end_inset