\tocdepth 3
\paragraph_separation indent
\defskip medskip
-\quotes_language english
+\quotes_language swedish
\quotes_times 2
\papercolumns 1
\papersides 1
\layout Title
-SDCC Compiler User Guide
+lSDCC Compiler User Guide
\layout Standard
\end_inset
-.
+ .
\layout Subsection
Open Source
\emph on
opensource
\emph default
-(freeware); source code for all the sub-packages (asxxxx assembler/linker,
+ (freeware); source code for all the sub-packages (asxxxx assembler/linker,
pre-processor) are distributed with the package.
This documentation is maintained using a freeware word processor (LyX).
Help stamp out software-hoarding!
\layout Subsection
+Typographic conventions
+\layout Standard
+
+Throughout this manual, we will use the following convention.
+ Commands you have to type in are printed in
+\family sans
+\series bold
+"sans serif"
+\series default
+.
+
+\family default
+ Code samples are printed in
+\family typewriter
+typewriter font.
+
+\family default
+ Interesting items and new terms are printed in
+\emph on
+italicised type.
+\layout Subsection
+
System Requirements
\layout Standard
Some of the other tools (simulator and assembler) included with SDCC contain
their own documentation and can be found in the source distribution.
If you want the latest unreleased software, the complete source package
- is available directly by anonymous CVS on www.sourceforge.net.
+ is available directly by anonymous CVS on cvs.sdcc.sourceforge.net.
\layout Section
Installation
\series medium
-Unpack the file using a command like: tar -xzf sdcc-2.x.x.tgz, this will create
- a sub-directory called sdcc with all of the sources.
+Unpack the file using a command like:
+\family sans
+\series bold
+"tar -xzf sdcc-2.x.x.tgz"
+\family default
+\series medium
+, this will create a sub-directory called sdcc with all of the sources.
\layout Enumerate
Change directory into the main SDCC directory, for example type:
-\begin_inset Quotes eld
-\end_inset
-
-cd sdcc
-\begin_inset Quotes erd
-\end_inset
-
+\family sans
+\series bold
+"cd sdcc"
+\series default
.
\layout Enumerate
\series medium
Type
-\begin_inset Quotes eld
-\end_inset
-
-./configure
-\begin_inset Quotes erd
-\end_inset
-
-
+\family sans
+\series bold
+"./configure"
+\family default
\series default
.
This configures the package for compilation on your system.
\series medium
Type
-\begin_inset Quotes eld
-\end_inset
-
-make
-\begin_inset Quotes erd
-\end_inset
-
+\family sans
+\series bold
+"make"
+\family default
+\series medium
.
\series default
\series medium
Type
-\begin_inset Quotes eld
-\end_inset
-
-make install
-\begin_inset Quotes erd
-\end_inset
-
-
+\family sans
+\series bold
+"make install"
+\family default
\series default
as root
\series medium
\layout Enumerate
Download the binary package and unpack it using your favorite unpacking
- tool(gunzip, WinZip, etc).
+ tool (gunzip, WinZip, etc).
This should unpack to a group of sub-directories.
An example directory structure after unpacking is: c:
\backslash
\series medium
the package
\series default
-(a large 80M byte sized dowload for the whole thing)
+ (a large 80M byte sized dowload for the whole thing)
\series medium
.
The first thing you should do after installing your SDCC compiler is to
see if it runs.
Type
-\begin_inset Quotes eld
-\end_inset
-
-sdcc --version
-\begin_inset Quotes erd
-\end_inset
-
+\family sans
+\series bold
+"sdcc --version"
+\family default
+\series default
at the prompt, and the program should run and tell you the version.
If it doesn't run, or gives a message about not finding sdcc program, then
you need to check over your installation.
for suggestions).
Make sure that the sdcc program is in the bin folder, if not perhaps something
did not install correctly.
-\layout Standard
+\newline
+\newline
\series medium
SDCC binaries are commonly installed in a directory arrangement like this:
\newline
-\family typewriter
+\series medium
\emph default
-main()
-\newline
-{
-\layout Standard
-
-
-\family typewriter
-int i;
-\layout Standard
-
-
-\family typewriter
-i = 0;
-\layout Standard
-
-
-\family typewriter
-i += 10;
-\newline
-}
+Compile this using the following command:
+\family sans
+\series bold
+"sdcc -c test.c"
\family default
-\emph on
-
-\newline
-
-\layout Standard
-
-
+\series default
+
\series medium
-Compile this using the following command:
-\begin_inset Quotes eld
-\end_inset
-
-sdcc -c test.c
-\begin_inset Quotes erd
-\end_inset
-
-.
- If all goes well, the compiler will generate a test.asm and test.rel file.
+If all goes well, the compiler will generate a test.asm and test.rel file.
Congratulations, you've just compiled your first program with SDCC.
We used the -c option to tell SDCC not to link the generated code, just
to keep things simple for this step.
-\layout Standard
+\series default
+
+\newline
+\newline
\series medium
The next step is to try it with the linker.
Type in
-\begin_inset Quotes eld
-\end_inset
-
-sdcc test.c
-\begin_inset Quotes erd
-\end_inset
-
+\family sans
+\series bold
+"sdcc test.c"
+\family default
+\series medium
.
If all goes well the compiler will link with the libraries and produce
a test.ihx output file.
\series medium
(see the Install trouble-shooting section for suggestions).
-\layout Standard
-
-
-\series medium
-The final test is to ensure sdcc can use the standard header files and libraries.
- Edit test.c and change it to the following:
\series default
\newline
\newline
-\family typewriter
+\series medium
+The final test is to ensure sdcc can use the
+\series default
+standard
+\series medium
+ header files and libraries.
+ Edit test.c and change it to the following:
+\layout LyX-Code
+
#include <string.h>
-\newline
-main()
-\newline
-{
-\layout Standard
+\layout LyX-Code
+main() {
+\layout LyX-Code
+
\family typewriter
char str1[10];
-\layout Standard
-
+\layout LyX-Code
+
\family typewriter
-strcpy(str1,
-\begin_inset Quotes eld
-\end_inset
-
-testing
-\begin_inset Quotes erd
-\end_inset
+strcpy(str1, "testing");
+\layout LyX-Code
-);
-\newline
-\newline
+\family typewriter
}
-\family default
-\emph on
-
-\newline
+\layout LyX-Code
\layout Standard
\series medium
-Compile this by typing:
-\begin_inset Quotes eld
-\end_inset
-
-sdcc test.c
-\begin_inset Quotes erd
-\end_inset
-
+Compile this by typing
+\family sans
+\series bold
+"sdcc test.c"
+\family default
+\series medium
.
This should generate a test.ihx output file, and it should give no warnings
such as not finding the string.h file.
.
An alternative is to specify these locations as compiler options like this:
- sdcc -L /usr/local/sdcc/lib/small -I /usr/local/sdcc/include test.c
+
+\family sans
+\series bold
+"sdcc -L /usr/local/sdcc/lib/small -I /usr/local/sdcc/include test.c"
+\family default
+\series default
+.
\layout Subsubsection
SDCC does not compile correctly.
A thing to try is starting from scratch by unpacking the .tgz source package
again in an empty directory.
Confure it again and build like:
-\layout Standard
-
+\newline
-\begin_inset Quotes eld
-\end_inset
+\newline
+\family sans
+\series bold
make 2&>1 | tee make.log
-\begin_inset Quotes erd
-\end_inset
-
+\family default
+\series default
-\layout Standard
+\newline
+\newline
After this you can review the make.log file to locate the problem.
Or a relevant part of this be attached to an email that could be helpful
when requesting help from the mailing list.
\layout Subsubsection
What the
-\begin_inset Quotes eld
+\begin_inset Quotes sld
\end_inset
./configure
-\begin_inset Quotes erd
+\begin_inset Quotes srd
\end_inset
does
\layout Standard
The
-\begin_inset Quotes eld
+\begin_inset Quotes sld
\end_inset
./configure
-\begin_inset Quotes erd
+\begin_inset Quotes srd
\end_inset
command is a script that analyzes your system and performs some configuration
\layout Subsubsection
What the
-\begin_inset Quotes eld
+\begin_inset Quotes sld
\end_inset
make
-\begin_inset Quotes erd
+\begin_inset Quotes srd
\end_inset
does.
\layout Subsubsection
What the
-\begin_inset Quotes eld
+\begin_inset Quotes sld
\end_inset
make install
\layout Standard
-The Cygwin package allows a Windows user to run a Unix command line interface(ba
-sh shell) and also implements a Unix like file system on top of Windows.
+The Cygwin package allows a Windows user to run a Unix command line interface
+ (bash shell) and also implements a Unix like file system on top of Windows.
Included are many of the famous GNU software development tools which can
augment the SDCC compiler.This is great if you have some experience with
Unix command line tools and file system conventions, if not you may find
Getting started with Cygwin
\layout Standard
-SDCC is typically distributed as a tarred/gzipped file(.tgz).
+SDCC is typically distributed as a tarred/gzipped file (.tgz).
This is a packed file similar to a .zip file.
- Cygwin includes the tools you will need to unpack the SDCC distribution(tar
- and gzip).
+ Cygwin includes the tools you will need to unpack the SDCC distribution
+ (tar and gzip).
To unpack it, simply follow the instructions under the Linux/Unix install
section.
Before you do this you need to learn how to start a cygwin shell and some
of the basic commands used to move files, change directory, run commands
and so on.
The change directory command is
+\family sans
+\series bold
+
\begin_inset Quotes eld
\end_inset
\begin_inset Quotes erd
\end_inset
+
+\family default
+\series default
, the move command is
+\family sans
+\series bold
+
\begin_inset Quotes eld
\end_inset
\begin_inset Quotes erd
\end_inset
+
+\family default
+\series default
.
To print the current working directory, type
+\family sans
+\series bold
+
\begin_inset Quotes eld
\end_inset
\begin_inset Quotes erd
\end_inset
+
+\family default
+\series default
.
To make a directory, use
+\family sans
+\series bold
+
\begin_inset Quotes eld
\end_inset
\begin_inset Quotes erd
\end_inset
+
+\family default
+\series default
.
\layout Standard
If you use the pre-compiled binaries, the install directories for the libraries
and header files may need to be specified on the sdcc command line like
- this: sdcc -L c:
+ this:
+\family sans
+\series bold
+"sdcc -L c:
\backslash
usr
\backslash
\backslash
sdcc
\backslash
-include test.c if you are running outside of a Unix bash shell.
+include test.c"
+\family default
+\series default
+ if you are running outside of a Unix bash shell.
\layout Standard
If you have successfully installed and compiled SDCC with the Cygwin package,
it is possible to compile into native .exe files by using the additional
makefiles included for this purpose.
- For example, with the Borland 32-bit compiler you would run make -f Makefile.bcc.
+ For example, with the Borland 32-bit compiler you would run
+\family sans
+\series bold
+"make -f Makefile.bcc"
+\family default
+\series default
+.
A command line version of the Borland 32-bit compiler can be downloaded
from the Inprise web site.
\layout Subsection
name> is the final location for the sdcc executables and libraries, (default
location is /usr/local).
The installation process will create the following directory structure
- under the <directory name> specified.
+ under the <directory name> specified (if they do not already exist).
+\newline
+
\layout Standard
-bin/ - binary exectables (add to PATH environment variable)
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-share/
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-sdcc/include/ - include header files
+bin/ - binary exectables (add to PATH environment variable)
+\layout Standard
+
+bin/share/
+\layout Standard
+
+bin/share/sdcc/include/ - include header files
+\layout Standard
+
+bin/share/sdcc/lib/
+\layout Standard
+
+bin/share/sdcc/lib/small/ - Object & library files for small model library
+\layout Standard
+
+bin/share/sdcc/lib/large/ - Object & library files for large model library
+\layout Standard
+
+bin/share/sdcc/lib/ds390/ - Object & library files forDS80C390 library
\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-sdcc/lib/ -
+
\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-small/ - Object & library files for small model library
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-large/ - Object & library files for large model library
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-ds390/ - Object & library files forDS80C390 library
-\layout Standard
-
The command
-\layout Standard
+\family sans
+\series bold
+\begin_inset Quotes sld
+\end_inset
-\series bold
-\size large
-\bar under
-'./configure --prefix=/usr/local
+./configure --prefix=/usr/local
\begin_inset Quotes erd
\end_inset
-\layout Standard
-
+\family default
+\series default
will configure the compiler to be installed in directory /usr/local/bin.
\layout Subsection
You might want to look at the various executables which are installed in
the bin directory.
At the time of this writing, we find the following programs:
+\newline
+
\layout Standard
\series bold
-sdcpd
+sdcdb
\series default
- The source debugger.
\layout Standard
\series bold
-linkz80, linkgbz80
+link-z80, link-gbz80
\series default
- The Z80 and GameBoy Z80 linkers.
\layout Standard
packihx
\series default
- A tool to pack Intel hex files.
-\layout Standard
+\newline
+\newline
As development for other processors proceeds, this list will expand to include
executables to support processors like AVR, PIC, etc.
\layout Subsubsection
cpp ( C-Preprocessor)
\layout Standard
-The preprocessor is extracted into the directory
-\emph on
-SDCCDIR/cpp
-\emph default
-, it is a modified version of the GNU preprocessor.
+The preprocessor is a modified version of the GNU preprocessor.
The C preprocessor is used to pull in #include sources, process #ifdef
statements, #defines and so on.
\layout Subsubsection
-asxxxx & aslink ( The assembler and Linkage Editor)
+asxxxx & aslink ( The Assembler and Linkage Editor)
\layout Standard
This is retargettable assembler & linkage editor, it was developed by Alan
- Baldwin, John Hartman created the version for 8051, and I (Sandeep) have
- some enhancements and bug fixes for it to work properly with the SDCC.
- This component is extracted into the directory
-\emph on
-SDCCDIR/asxxxx.
+ Baldwin.
+ John Hartman created the version for 8051, and I (Sandeep) have made some
+ enhancements and bug fixes for it to work properly with the SDCC.
\layout Subsubsection
-SDCC - The compiler
+sdcc - The Compiler
\layout Standard
This is the actual compiler, it in turn uses the c-preprocessor and invokes
- the assembler and linkage editors.
- All files with the prefix
-\emph on
-SDCC
-\emph default
-are part of the compiler and are extracted into the the directory
-\emph on
-SDCCDIR.
+ the assembler and linkage editor.
\layout Subsubsection
-S51 - Simulator
+s51 - Simulator
\layout Standard
-s51 is a freeware, opensource simulator developed by Daniel Drotos <drdani@mazso
-la.iit.uni-miskolc.hu>.
- The executable is built as part of the build process, for more information
- visit Daniel's website at <http://mazsola.iit.uni-miskolc.hu/~drdani/embedded/s51/
->.
+S51 is a freeware, opensource simulator developed by Daniel Drotos
+\begin_inset LatexCommand \url{mailto:drdani@mazsola.iit.uni-miskolc.hu}
+
+\end_inset
+
+.
+ The executable is built as part of the build process.
+ For more information visit Daniel's website at
+\begin_inset LatexCommand \url{http://mazsola.iit.uni-miskolc.hu/~drdani/embedded/s51}
+
+\end_inset
+
+.
\layout Subsubsection
-SDCDB - Source Level Debugger
+sdcdb - Source Level Debugger
\layout Standard
-SDCDB is the companion source level debugger.
+Sdcdb is the companion source level debugger.
The current version of the debugger uses Daniel's Simulator S51, but can
be easily changed to use other simulators.
\layout Section
\layout Standard
For single source file 8051 projects the process is very simple.
- Compile your programs with the following command
-\layout Standard
-
-
-\size footnotesize
-sdcc sourcefile.c
-\layout Standard
+ Compile your programs with the following command
+\family sans
+\series bold
+"sdcc sourcefile.c".
-The above command will compile ,assemble and link your source file.
+\family default
+\series default
+ This will compile, assemble and link your source file.
Output files are as follows.
\layout Itemize
SDCC can compile only ONE file at a time.
Let us for example assume that you have a project containing the following
files.
+\newline
+
\layout Standard
\size footnotesize
foomain.c (contains more functions and the function main)
-\layout Standard
-
-The first two files will need to be compiled separately with the commands
-\layout Standard
+\newline
+\newline
+\size default
+The first two files will need to be compiled separately with the commands
\size footnotesize
-sdcc -c foo1.c
-\layout Standard
-
-
+
+\family sans
+\series bold
+\size default
+"sdcc\SpecialChar ~
+-c\SpecialChar ~
+foo1.c"
+\family default
+\series default
\size footnotesize
-sdcc -c foo2.c
-\layout Standard
-
-Then compile the source file containing main and link the other files together
- with the following command.
-\layout Standard
-
-
+ and
+\family sans
+\series bold
+\size default
+"sdcc\SpecialChar ~
+-c\SpecialChar ~
+foo2.c"
+\family default
+\series default
\size footnotesize
-sdcc foomain.c foo1.rel foo2.rel
-\layout Standard
-
-Alternatively
+.
+
+\size default
+Then compile the source file containing the main() function and link the
+ files together with the following command:
+\family sans
+\series bold
+"sdcc\SpecialChar ~
+foomain.c\SpecialChar ~
+foo1.rel\SpecialChar ~
+foo2.rel"
+\family default
+\series default
+.
+ Alternatively, foomain.c
\emph on
-foomain.c
+
\emph default
- can be separately compiled as well
-\layout Standard
-
-
+can be separately compiled as well:
+\family sans
+\series bold
+"sdcc\SpecialChar ~
+-c\SpecialChar ~
+foomain.c"
+\family default
+\series default
\size footnotesize
-sdcc -c foomain.c
-\layout Standard
+ and
+\family sans
+\series bold
+\size default
+\begin_inset Quotes sld
+\end_inset
-\size footnotesize
-sdcc foomain.rel foo1.rel foo2.rel
-\layout Standard
+sdcc foomain.rel foo1.rel foo2.rel"
+\newline
-The file containing the main function MUST be the FIRST file specified in
- the command line , since the linkage editor processes file in the order
- they are presented to it.
+\newline
+
+\family default
+\series default
+The file containing the main function
+\emph on
+must
+\emph default
+ be the
+\emph on
+first
+\emph default
+ file specified in the command line, since the linkage editor processes
+ file in the order they are presented to it.
\layout Subsubsection
Projects with Additional Libraries
\series bold
---compile-only(-c)
+-M
+\series default
+ Tell the preprocessor to output a rule suitable for make describing the
+ dependencies of each object file.
+ For each source file, the preprocessor outputs one make-rule whose target
+ is the object file name for that source file and whose dependencies are
+ all the files `#include'd in it.
+ This rule may be a single line or may be continued with `
+\backslash
+'-newline if it is long.
+ The list of rules is printed on standard output instead of the preprocessed
+ C program.
+ `-M' implies `-E'.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-C
\series default
+ Tell the preprocessor not to discard comments.
+ Used with the `-E' option.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-MM
\size large
+\bar under
+\series default
\size default
- will compile and assemble the source, but will not call the linkage editor.
+\bar default
+Like `-M' but the output mentions only the user header files included with
+ `#include
+\begin_inset Quotes eld
+\end_inset
+
+file"'.
+ System header files included with `#include <file>' are omitted.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-Aquestion(answer)
+\series default
+ Assert the answer answer for question, in case it is tested with a preprocessor
+ conditional such as `#if #question(answer)'.
+ `-A-' disables the standard assertions that normally describe the target
+ machine.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-Aquestion
+\series default
+ (answer) Assert the answer answer for question, in case it is tested with
+ a preprocessor conditional such as `#if #question(answer)'.
+ `-A-' disables the standard assertions that normally describe the target
+ machine.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-Umacro
+\series default
+ Undefine macro macro.
+ `-U' options are evaluated after all `-D' options, but before any `-include'
+ and `-imacros' options.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-dM
+\series default
+ Tell the preprocessor to output only a list of the macro definitions that
+ are in effect at the end of preprocessing.
+ Used with the `-E' option.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-dD
+\series default
+ Tell the preprocessor to pass all macro definitions into the output, in
+ their proper sequence in the rest of the output.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-dN
+\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.
\layout Subsubsection
Linker Options
-\layout Standard
+\layout List
+\labelwidthstring 00.00.0000
\series bold
---lib-path(-L)
+-L\SpecialChar ~
+--lib-path
\bar under
\series default
The path name must be absolute.
Additional library files may be specified in the command line.
See section Compiling programs for more details.
-\layout Standard
+\layout List
+\labelwidthstring 00.00.0000
\series bold
value is 0x80.
The value entered can be in Hexadecimal or Decimal format, eg.
--idata-loc 0x88 or --idata-loc 136.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+--out-fmt-ihx
+\bar under
+
+\series default
+\bar default
+The linker output (final object code) is in Intel Hex format.
+ (This is the default option).
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+--out-fmt-s19
+\bar under
+
+\series default
+\bar default
+The linker output (final object code) is in Motorola S19 format.
\layout Subsubsection
MCS51 Options
\labelwidthstring 00.00.0000
-\series bold
---stack-auto
-\series default
-\size large
-\emph on
-
-\size default
-\emph default
-All functions in the source file will be compiled as
-\emph on
-reentrant
-\emph default
-, i.e.
- the parameters and local variables will be allocated on the stack.
- see section Parameters and Local Variables for more details.
- If this option is used all source files in the project should be compiled
- with this option.
-
-\layout List
-\labelwidthstring 00.00.0000
-
-
\series bold
--xstack
\series default
\series bold
---stack-auto
-\series default
- See MCS51 section for description.
-\layout List
-\labelwidthstring 00.00.0000
-
---
-\series bold
-model
-\series default
--
-\series bold
-flat24
+--model-flat24
\series default
\size large
\emph on
\series bold
--stack-10bit
\series default
- This option generates code for the 10 bit stack mode of the Dallas DS80C390
- part.
+ Generate code for the 10 bit stack mode of the Dallas DS80C390 part.
This is the one and only that the ds390 code generator supports right now
and is default when using -mds390.
In this mode, the stack is located in the lower 1K of the internal RAM,
\series bold
---callee-saves function1[,function2][,function3]....
-
+-c\SpecialChar ~
+--compile-only
\series default
- 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 from larger functions.
- This option can be used to switch the register saving convention for the
- function names specified.
- The compiler will not save registers when calling these functions, no extra
- 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
- to determine the appropriate scheme to use for each function call.
- DO NOT use this option for built-in functions such as _muluint..., if this
- option is used for a library function the appropriate library function
- needs to be recompiled with the same option.
- If the project consists of multiple source files then all the source file
- should be compiled with the same --callee-saves option string.
- Also see Pragma Directive CALLEE-SAVES.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
---debug
-\bar under
-
-\series default
-\bar default
-When this option is used the compiler will generate debug information ,
- that can be used with the SDCDB.
- The debug information is collected in a file with .cdb extension.
- For more information see documentation for SDCDB.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
---regextend
-\bar under
-
-\series default
-\bar default
- This option will cause the compiler to define pseudo registers , if this
- option is used, all source files in the project should be compiled with
- this option.
- See section Register Extension for more details.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
---peep-file
-\series default
-<filename> This option can be used to use additional rules to be used by
- the peep hole optimizer.
- See section Peep Hole optimizations for details on how to write these rules.
+ will compile and assemble the source, but will not call the linkage editor.
\layout List
\labelwidthstring 00.00.0000
\series bold
--M
-\series default
- Tell the preprocessor to output a rule suitable for make describing the
- dependencies of each object file.
- For each source file, the preprocessor outputs one make-rule whose target
- is the object file name for that source file and whose dependencies are
- all the files `#include'd in it.
- This rule may be a single line or may be continued with `
-\backslash
-'-newline if it is long.
- The list of rules is printed on standard output instead of the preprocessed
- C program.
- `-M' implies `-E'.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--C
+--stack-auto
\series default
- Tell the preprocessor not to discard comments.
- Used with the `-E' option.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--MM
\size large
-\bar under
+\emph on
-\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
-
-file"'.
- System header files included with `#include <file>' are omitted.
+\emph default
+All functions in the source file will be compiled as
+\emph on
+reentrant
+\emph default
+, i.e.
+ the parameters and local variables will be allocated on the stack.
+ see section Parameters and Local Variables for more details.
+ If this option is used all source files in the project should be compiled
+ with this option.
+
\layout List
\labelwidthstring 00.00.0000
\series bold
--Aquestion(answer)
-\series default
- Assert the answer answer for question, in case it is tested with a preprocessor
- conditional such as `#if #question(answer)'.
- `-A-' disables the standard assertions that normally describe the target
- machine.
-\layout List
-\labelwidthstring 00.00.0000
-
+--callee-saves function1[,function2][,function3]....
-\series bold
--Aquestion
\series default
- (answer) Assert the answer answer for question, in case it is tested with
- a preprocessor conditional such as `#if #question(answer)'.
- `-A-' disables the standard assertions that normally describe the target
- machine.
+ 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 from larger functions.
+ This option can be used to switch the register saving convention for the
+ function names specified.
+ The compiler will not save registers when calling these functions, no extra
+ 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
+ to determine the appropriate scheme to use for each function call.
+ DO NOT use this option for built-in functions such as _muluint..., if this
+ option is used for a library function the appropriate library function
+ needs to be recompiled with the same option.
+ If the project consists of multiple source files then all the source file
+ should be compiled with the same --callee-saves option string.
+ Also see Pragma Directive CALLEE-SAVES.
\layout List
\labelwidthstring 00.00.0000
\series bold
--Umacro
+--debug
+\bar under
+
\series default
- Undefine macro macro.
- `-U' options are evaluated after all `-D' options, but before any `-include'
- and `-imacros' options.
+\bar default
+When this option is used the compiler will generate debug information ,
+ that can be used with the SDCDB.
+ The debug information is collected in a file with .cdb extension.
+ For more information see documentation for SDCDB.
\layout List
\labelwidthstring 00.00.0000
\series bold
--dM
+\emph on
+--regextend
+\bar under
+
\series default
- Tell the preprocessor to output only a list of the macro definitions that
- are in effect at the end of preprocessing.
- Used with the `-E' option.
+\bar default
+ This option is obsolete and isn't supported anymore.
\layout List
\labelwidthstring 00.00.0000
\series bold
--dD
+\emph on
+--noregparms
\series default
- Tell the preprocessor to pass all macro definitions into the output, in
- their proper sequence in the rest of the output.
+ This option is obsolete and isn't supported anymore.
\layout List
\labelwidthstring 00.00.0000
\series bold
--dN
-\size large
-\bar under
-
+--peep-file
\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.
+<filename> This option can be used to use additional rules to be used by
+ the peep hole optimizer.
+ See section Peep Hole optimizations for details on how to write these rules.
\layout List
\labelwidthstring 00.00.0000
\labelwidthstring 00.00.0000
-\series bold
---out-fmt-ihx
-\bar under
-
-\series default
-\bar default
-The linker output (final object code) is in Intel Hex format.
- (This is the default option).
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
---out-fmt-s19
-\bar under
-
-\series default
-\bar default
-The linker output (final object code) is in Motorola S19 format.
-\layout List
-\labelwidthstring 00.00.0000
-
-
\series bold
--nooverlay
\series default
\series default
<Value> Causes the linker to check if the interal ram usage is within limits
of the given value.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+--nostdincl
+\series default
+ This will prevent the compiler from passing on the default include path
+ to the preprocessor.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+--nostdlib
+\series default
+ This will prevent the compiler from passing on the default library path
+ to the linker.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+--verbose
+\series default
+ Shows the various actions the compiler is performing.
+\layout List
+\labelwidthstring 00.00.0000
+
+
+\series bold
+-V
+\series default
+ Shows the actual commands the compiler is executing.
\layout Subsubsection
Intermediate Dump Options
\series bold
--dumlrange
\series default
- Will dump the life ranges for all symbols
+ Will dump the life ranges for all symbols.
\layout List
\labelwidthstring 00.00.0000
void set_error( unsigned char errcd)
\newline
{
-\layout Standard
-
-
-\family typewriter
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
P3 = errcd;
\newline
}
\newline
#pragma RESTORE
+\newline
+
\newline
void some_isr () interrupt 2 using 1
\newline
{
-\layout Standard
-
-
-\family typewriter
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
...
-\layout Standard
-
-
-\family typewriter
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
set_error(10);
-\layout Standard
-
-
-\family typewriter
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
...
\newline
SDCC allows interrupt service routines to be coded in C, with some extended
keywords.
-\layout Standard
+\newline
+\newline
-\size small
+\family typewriter
void timer_isr (void) interrupt 2 using 1
\newline
{
\newline
}
-\layout Standard
+\newline
+
+\newline
+\family default
The number following the 'interrupt' keyword is the interrupt number this
routine will service.
The compiler will insert a call to this routine in the interrupt vector
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
-
-\newline
-eg:
+
\newline
\size small
\newline
+
+\family typewriter
+\size default
int foo () critical
\newline
{
}
\newline
-\size default
+\family default
\newline
The critical attribute maybe used with other attributes like
\newline
\newline
+
+\family typewriter
data unsigned char counter;
\newline
void simpleIterrupt(void) interrupt 1
\newline
{
-\layout Standard
-
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
counter++;
\newline
}
void nakedInterrupt(void) interrupt 2 _naked
\newline
{
-\layout Standard
-
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
_asm
-\layout Standard
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+inc\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+_counter
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+reti\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+; MUST explicitly include ret in _naked function.
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+_endasm;
+\newline
+}
+\family default
+
+\newline
+
+\newline
+For an 8051 target, the generated simpleInterrupt looks like:
+\newline
+
+\newline
+\family typewriter
+_simpleIterrupt:
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+push\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+acc
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+push\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+b
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+push\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+dpl
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+push\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+dph
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+push\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+psw
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
\SpecialChar ~
+mov\SpecialChar ~
\SpecialChar ~
- inc\SpecialChar ~
- _counter
-\layout Standard
-
\SpecialChar ~
\SpecialChar ~
- reti\SpecialChar ~
\SpecialChar ~
+psw,#0x00
+\newline
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
+inc\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- ; MUST explicitly include ret in _naked function.
-\layout Standard
-
-_endasm;
-\newline
-}
-\newline
-
-\newline
-For an 8051 target, the generated simpleInterrupt looks like:
-\newline
-
+\SpecialChar ~
+\SpecialChar ~
+_counter
\newline
-_simpleIterrupt:
-\layout Standard
-
-push\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- acc
-\layout Standard
-
-push\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- b
-\layout Standard
-
-push\SpecialChar ~
+pop\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- dpl
-\layout Standard
-
-push\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- dph
-\layout Standard
-
-push\SpecialChar ~
+psw
+\newline
\SpecialChar ~
\SpecialChar ~
- psw
-\layout Standard
-
-mov\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
+pop\SpecialChar ~
\SpecialChar ~
- psw,#0x00
-\layout Standard
-
-inc\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- _counter
-\layout Standard
-
-pop\SpecialChar ~
+dph
+\newline
+\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- psw
-\layout Standard
-
pop\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- dph
-\layout Standard
-
-pop\SpecialChar ~
+\SpecialChar ~
+dpl
+\newline
+\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- dpl
-\layout Standard
-
pop\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- b
-\layout Standard
-
+\SpecialChar ~
+b
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
pop\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- acc
-\layout Standard
-
+\SpecialChar ~
+acc
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
reti
+\family default
+
\newline
\newline
\newline
\newline
-_nakedInterrupt:
-\layout Standard
+\family typewriter
+_nakedInterrupt:
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
inc\SpecialChar ~
- _counter
-\layout Standard
-
-reti\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
+_counter
+\newline
+\SpecialChar ~
+\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
+reti\SpecialChar ~
\SpecialChar ~
\SpecialChar ~
- ; MUST explicitly include ret(i) in _naked function.
+; MUST explicitly include ret(i) in _naked function.
+\family default
+
\newline
\newline
\emph on
at <address>
\emph default
- keyword, in addition to a storage class.
-\layout Standard
-
-eg.
-
-\layout Standard
+ keyword, in addition to a storage class, e.g.:
+\newline
+\newline
-\size small
+\family typewriter
xdata at 0x8000 unsigned char PORTA_8255 ;
-\layout Standard
+\newline
+
+\family default
+\newline
In the above example the
\emph on
PORTA_8255
\emph default
will be allocated to the location 0x8000 of the external ram.
-
-\layout Standard
-
-Note that is this feature is provided to give the programmer access to
+ Note that this feature is provided to give the programmer access to
\emph on
memory mapped
\emph default
variables that are declared without the absolute address, the assembler
listing file (.lst) and the linker output files (<filename>.rst) and (<filename>.m
ap) are a good places to look for such overlaps.
-\layout Standard
-
-Absolute address can be specified for variables in all storage classes.
-\layout Standard
-
+\newline
-\size small
-eg.
-\layout Standard
+\newline
+Absolute address can be specified for variables in all storage classes,
+ e.g.:
+\newline
+\newline
-\size small
+\family typewriter
bit at 0x02 bvar;
-\layout Standard
+\newline
+\newline
+
+\family default
The above example will allocate the variable at offset 0x02 in the bit-addressab
le space.
There is no real advantage to assigning absolute addresses to variables
SDCC allows the use of in-line assembler with a few restriction as regards
labels.
- All labels defined within inline assembler code HAS TO BE of the
+ All labels defined within inline assembler code HAS TO BE of the form
\emph on
-form nnnnn$
+nnnnn$
\emph default
where nnnn is a number less than 100 (which implies a limit of utmost 100
inline assembler labels
\noun default
.
It is strongly recommended that each assembly instruction (including labels)
- be placed in a separate line ( as the example shows).
+ be placed in a separate line (as the example shows).
When the
\series bold
-\bar under
--peep-asm
\series default
-\bar default
command line option is used, the inline assembler code will be passed through
the peephole optimizer, this might cause some unexpected changes in the
- inline assembler code, please go throught the peephole optimizer rules
- defined in file 'SDCCpeeph.def' carefully before using this option.
-\layout Standard
-
-
-\size small
-eg
-\layout Standard
+ inline assembler code.
+ Please go throught the peephole optimizer rules defined in file 'SDCCpeeph.def'
+ carefully before using this option.
+\newline
+\newline
-\size small
+\family typewriter
_asm
\newline
\SpecialChar ~
\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
-mov b,#10
+ mov b,#10
\newline
00001$:
\newline
\SpecialChar ~
\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
-djnz b,00001$
+ djnz b,00001$
\newline
_endasm ;
-\layout Standard
+\family default
+\size small
+\newline
+
+\newline
+
+\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
-\emph on
+\family typewriter
_asm ...
_endasm;
-\emph default
+\family default
keyword pair.
-\layout Standard
-
-Inline assembler code cannot reference any C-Labels however it can reference
- labels defined by the inline assembler.
-\layout Standard
-
+\newline
-\size small
-eg
-\layout Standard
+\newline
+Inline assembler code cannot reference any C-Labels, however it can reference
+ labels defined by the inline assembler, e.g.:
+\newline
+\newline
-\size small
+\family typewriter
foo() {
\newline
-...
- /* some c code */
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+/* some c code */
\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
_asm
\newline
\SpecialChar ~
- \SpecialChar ~
- \SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
; some assembler code
\newline
\SpecialChar ~
- \SpecialChar ~
- ljmp $0003
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+ljmp $0003
\newline
-_endasm ;
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+_endasm;
\newline
-...
- /* some more c code */
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+/* some more c code */
\newline
-clabel: \SpecialChar ~
- /* inline assembler cannot reference this label */
+clabel:\SpecialChar ~
+\SpecialChar ~
+/* inline assembler cannot reference this label */
\newline
-_asm
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+_asm
\newline
\SpecialChar ~
- \SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
$0003: ;label (can be reference by inline assembler only)
\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
_endasm ;
\newline
-...
-
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+/* some more c code */
\newline
}
-\layout Standard
+\newline
+
+\newline
+\family default
In other words inline assembly code can access labels defined in inline
assembly.
The same goes the other way, ie.
These support routines are all developed in ANSI-C to facilitate porting
to other MCUs.
The following files contain the described routine, all of them can be found
- in the directory SDCCDIR/sdcc51lib
+ in the directory default SDCC library path.
\layout Itemize
_modulong.c - unsigned 32 bit modulus.
\layout Standard
-All these routines are compiled as non-reentrant and small model.
- Since they are compiled as non-reentrant, interrupt service routines should
- not do any of the above operations, if this unavoidable then the above
- routines will need to ne compiled with the --stack-auto option, after which
- the source program will have to be compiled with --int-long-rent option.
+Since they are compiled as non-reentrant, interrupt service routines should
+ not do any of the above operations.
+ If this unavoidable then the above routines will need to be compiled with
+ the --stack-auto option, after which the source program will have to be
+ compiled with --int-long-rent option.
\layout Subsection
Floating Point Support
overflow.
For serious floating point usage it is strongly recommended that the Large
model be used (in which case the floating point routines mentioned above
- will need to recompiled with the --model-Large option)
+ will need to recompiled with the --model-large option)
\layout Subsection
MCS51 Memory Models
\layout Standard
SDCC allows two memory models for MCS51 code, small and large.
- Modules compiled with different memory models should never be combined
- together or the results would be unpredictable.
+ Modules compiled with different memory models should
+\emph on
+never
+\emph default
+ be combined together or the results would be unpredictable.
The library routines supplied with the compiler are compiled as both small
and large.
The compiled library modules are contained in seperate directories as small
and large so that you can link to either set.
- In general the use of the large model is discouraged.
+
\layout Standard
When the large model is used all variables declared without a storage class
\layout Standard
Judicious usage of the processor specific storage classes and the 'reentrant'
- function type will yield much more efficient code, than using the large-model.
+ 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
be used unless absolutely required.
\layout Subsection
-Flat 24 bit Addressing Model
+DS390 Memory Models
\layout Standard
-This option generates code for the 24 bit contiguous addressing mode of
- the Dallas DS80C390 part.
+The only model supported is Flat 24.
+ This generates code for the 24 bit contiguous addressing mode of the Dallas
+ DS80C390 part.
In this mode, up to four meg of external RAM or code space can be directly
addressed.
See the data sheets at www.dalsemi.com for further information on this part.
-\layout Standard
+\newline
+\newline
In older versions of the compiler, this option was used with the MCS51 code
generator (-mmcs51).
Now, however, the '390 has it's own code generator, selected by the -mds390
switch.
- This code generator currently supports only the flat24 model, but the --model-f
-lat24 switch is still required, in case later versions of the code generator
- support other models (such as the paged mode of the '390).
- The combination of -mmcs51 and --model-flat24 is now depracated.
-\layout Standard
+
+\newline
+\newline
Note that the compiler does not generate any code to place the processor
- into24 bitmode (it defaults to 8051 compatible mode).
- Boot loader or similar code must ensure that the processor is in 24 bit
- contiguous addressing mode before calling the SDCC startup code.
-\layout Standard
+ into 24 bitmode (although the tinibios in the ds390 libraries will do that
+ for you).
+ If you don't use tinibios, the boot loader or similar code must ensure
+ that the processor is in 24 bit contiguous addressing mode before calling
+ the SDCC startup code.
+\newline
+\newline
Like the --model-large option, variables will by default be placed into
the XDATA segment.
-\layout Standard
+\newline
+\newline
Segments may be placed anywhere in the 4 meg address space using the usual
--*-loc options.
Note that if any segments are located above 64K, the -r flag must be passed
HEX output format must be used.
The -r flag can be passed to the linker by using the option -Wl-r on the
sdcc command line.
+ However, currently the linker can not handle code segments > 64k.
\layout Subsection
Defines Created by the Compiler
SDCC - this Symbol is always defined.
\layout Itemize
+SDCC_mcs51 or SDCC_ds390 or SDCC_z80, etc - depending on the model used
+ (e.g.: -mds390)
+\layout Itemize
+
+__mcs51 or __ds390 or __z80, etc - depending on the model used (e.g.
+ -mz80)
+\layout Itemize
+
SDCC_STACK_AUTO - this symbol is defined when --stack-auto option is used.
\layout Itemize
\layout Itemize
SDCC_USE_XSTACK - when --xstack option is used.
+\layout Itemize
+
+SDCC_STACK_TENBIT - when -mds390 is used
+\layout Itemize
+
+SDCC_MODEL_FLAT24 - when -mds390 is used
\layout Section
SDCC Technical Data