X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=doc%2Fsdccman.lyx;h=13c3965d913baf63085d59edad603cc92f977cc3;hb=52022dcd66afa047ce47e41493c84a0dba28116f;hp=05f928a99525f0850da55b8ad8daf659160f085e;hpb=42ff532e6577b0afc6cd286e8a2d272f8ad4a386;p=fw%2Fsdcc
diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx
index 05f928a9..13c3965d 100644
--- a/doc/sdccman.lyx
+++ b/doc/sdccman.lyx
@@ -1,5 +1,7 @@
-#LyX 1.3 created this file. For more info see http://www.lyx.org/
-\lyxformat 221
+#LyX 1.4.3 created this file. For more info see http://www.lyx.org/
+\lyxformat 245
+\begin_document
+\begin_header
\textclass book
\begin_preamble
\pdfoptionpdfminorversion=3
@@ -23,13 +25,12 @@
\fontscheme pslatex
\graphics default
\paperfontsize default
-\spacing single
+\spacing single
\papersize letterpaper
-\paperpackage a4
-\use_geometry 1
-\use_amsmath 0
-\use_natbib 0
-\use_numerical_citations 0
+\use_geometry true
+\use_amsmath 1
+\cite_engine basic
+\use_bibtopic false
\paperorientation portrait
\leftmargin 30mm
\topmargin 20mm
@@ -40,105 +41,139 @@
\paragraph_separation indent
\defskip medskip
\quotes_language swedish
-\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle fancy
+\tracking_changes false
+\output_changes true
+\end_header
-\layout Comment
+\begin_body
+\begin_layout Standard
+\begin_inset Note Comment
+status collapsed
+
+\begin_layout Standard
Please note: double dashed longoptions (e.g.
--version) are written this way: -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-
-\layout Comment
+\end_layout
+\begin_layout Standard
Two resp.
three consecutive dashes simply result in a long resp.
extra long dash.
-\layout Comment
+\end_layout
+\begin_layout Standard
Architecture specific stuff (like memory models, code examples) should maybe
later go
-\layout Comment
+\end_layout
+\begin_layout Standard
into seperate sections/chapters/appendices (it is hard to document PIC or
Z80 in
-\layout Comment
+\end_layout
+\begin_layout Standard
a 8051 centered document) - for now simply add.
-\layout Title
+\end_layout
+
+\end_inset
+
+\end_layout
+
+\begin_layout Title
SDCC Compiler User Guide
-\layout Date
+\end_layout
+\begin_layout Date
-\size normal
+\size normal
SDCC 2.6.4
-\size footnotesize
+\size footnotesize
-\newline
+\newline
$Date$
-\newline
+\newline
$Revision$
-\layout Comment
+\end_layout
+\begin_layout Standard
+\begin_inset Note Comment
+status collapsed
+
+\begin_layout Standard
The above strings enclosed in $ are automatically updated by Subversion
-\layout Standard
+\end_layout
+
+\end_inset
+\end_layout
+
+\begin_layout Standard
\begin_inset LatexCommand \tableofcontents{}
-\end_inset
+\end_inset
-\layout Chapter
+\end_layout
+\begin_layout Chapter
Introduction
-\layout Section
+\end_layout
+\begin_layout Section
About SDCC
-\layout Standard
+\end_layout
+\begin_layout Standard
-\series bold
+\series bold
SDCC
-\series default
+\series default
(
-\emph on
+\emph on
S
-\emph default
+\emph default
mall
-\emph on
+\emph on
D
-\emph default
+\emph default
evice
-\emph on
+\emph on
C
-\emph default
+\emph default
-\emph on
+\emph on
C
-\emph default
+\emph default
ompiler) is an open source, retargettable, optimizing ANSI-C compiler by
-\series bold
+\series bold
Sandeep Dutta
-\series default
+\series default
designed for 8 bit Microprocessors.
The current version targets Intel MCS51 based Microprocessors (8031, 8032,
8051, 8052
\begin_inset LatexCommand \index{8031, 8032, 8051, 8052, mcs51 CPU}
-\end_inset
+\end_inset
, etc.), Dallas DS80C390 variants, Freescale (formerly Motorola) HC08 and
Zilog Z80 based MCUs.
@@ -148,64 +183,71 @@ Sandeep Dutta
SDCC uses ASXXXX
\begin_inset LatexCommand \index{asXXXX (as-gbz80, as-hc08, asx8051, as-z80)}
-\end_inset
+\end_inset
& ASLINK
\begin_inset LatexCommand \index{aslink}
-\end_inset
+\end_inset
, an open source retargetable assembler & linker.
SDCC has extensive language extensions suitable for utilizing various microcont
rollers and underlying hardware effectively.
-\newline
+\newline
-\newline
-In addition to the MCU specific optimizations SDCC also does a host of standard
- optimizations like:
-\layout Itemize
+\newline
+In addition to the MCU specific optimizations SDCC also does a host of
+ standard optimizations like:
+\end_layout
+\begin_layout Itemize
global sub expression elimination,
-\layout Itemize
+\end_layout
+\begin_layout Itemize
loop optimizations (loop invariant, strength reduction of induction variables
and loop reversing),
-\layout Itemize
+\end_layout
+\begin_layout Itemize
constant folding & propagation,
-\layout Itemize
+\end_layout
+\begin_layout Itemize
copy propagation,
-\layout Itemize
+\end_layout
+\begin_layout Itemize
dead code elimination
-\layout Itemize
+\end_layout
+\begin_layout Itemize
jump tables for
-\emph on
+\emph on
switch
-\emph default
+\emph default
statements.
-\layout Standard
+\end_layout
+\begin_layout Standard
For the back-end SDCC uses a global register allocation scheme which should
be well suited for other 8 bit MCUs.
-\newline
+\newline
-\newline
-The peep hole optimizer uses a rule based substitution mechanism which is
- MCU independent.
+\newline
+The peep hole optimizer uses a rule based substitution mechanism which
+ is MCU independent.
-\newline
+\newline
-\newline
+\newline
Supported data-types are:
-\layout Standard
-
+\end_layout
-\begin_inset Tabular
+\begin_layout Standard
+\begin_inset Tabular
@@ -217,433 +259,485 @@ Supported data-types are:
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
type
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
width
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
default
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
signed range
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
unsigned range
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
bool
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
1 bit
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
unsigned
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
0, 1
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
char
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
8 bits, 1 byte
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
signed
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-128, +127
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
0, +255
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
short
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
16 bits, 2 bytes
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
signed
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-32.768, +32.767
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
0, +65.535
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
int
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
16 bits, 2 bytes
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
signed
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-32.768, +32.767
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
0, +65.535
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
long
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
32 bits, 4 bytes
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
signed
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-2.147.483.648, +2.147.483.647
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
0, +4.294.967.295
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
float
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
4 bytes IEEE 754
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
signed
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
1.175494351E-38,
-\family roman
-\series medium
-\shape up
-\size normal
-\emph off
-\bar no
-\noun off
+\family roman
+\series medium
+\shape up
+\size normal
+\emph off
+\bar no
+\noun off
\color none
3.402823466E+38
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
pointer
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
1, 2, 3 or 4 bytes
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
generic
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+
+\end_layout
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-\end_inset
+\end_layout
+
+\end_inset
-\end_inset
+\end_inset
-\newline
+\newline
The compiler also allows
-\emph on
+\emph on
inline assembler code
-\emph default
+\emph default
to be embedded anywhere in a function.
In addition, routines developed in assembly can also be called.
-\newline
+\newline
-\newline
-SDCC also provides an option (-
+\newline
+SDCC also
+ provides an option (-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-cyclomatic) to report the relative complexity of a function.
These functions can then be further optimized, or hand coded in assembly
if needed.
-\newline
+\newline
-\newline
+\newline
SDCC also comes with a companion source level debugger SDCDB, the debugger
currently uses ucSim a freeware simulator for 8051 and other micro-controllers.<
-\newline
+\newline
+
+\newline
-\newline
The latest version can be downloaded from
\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
-\end_inset
+\end_inset
.
-\series bold
+\series bold
-\series default
-\emph on
+\series default
+\emph on
Please note: the compiler will probably always be some steps ahead of this
documentation
-\series bold
-\emph default
+\series bold
+\emph default
\begin_inset LatexCommand \index{Status of documentation}
-\end_inset
+\end_inset
\begin_inset Foot
-collapsed false
-
-\layout Standard
+status open
+\begin_layout Standard
Obviously this has pros and cons
-\end_inset
+\end_layout
+
+\end_inset
.
-\layout Section
+\end_layout
+\begin_layout Section
Open Source
-\layout Standard
+\end_layout
+\begin_layout Standard
All packages used in this compiler system are
-\emph on
+\emph on
open source
-\emph default
+\emph default
and
-\emph on
+\emph on
freeware
-\emph default
+\emph default
; source code for all the sub-packages (pre-processor, assemblers, linkers
etc) is distributed with the package.
This documentation is maintained using a freeware word processor (LyX).
-\newline
-This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License
+\newline
+This
+ program is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License
\begin_inset LatexCommand \index{GNU General Public License, GPL}
-\end_inset
+\end_inset
as published by the Free Software Foundation; either version 2, or (at
your option) any later version.
@@ -651,7 +745,7 @@ This program is free software; you can redistribute it and/or modify it
ANY WARRANTY; without even the implied warranty
\begin_inset LatexCommand \index{warranty}
-\end_inset
+\end_inset
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@@ -662,229 +756,254 @@ This program is free software; you can redistribute it and/or modify it
You are forbidden to forbid anyone else to use, share and improve what
you give them.
Help stamp out software-hoarding!
-\layout Section
+\end_layout
+\begin_layout Section
Typographic conventions
\begin_inset LatexCommand \index{Typographic conventions}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
Throughout this manual, we will use the following convention.
Commands you have to type in are printed in
-\family sans
-\series bold
+\family sans
+\series bold
"sans serif"
-\series default
+\series default
.
-\family default
+\family default
Code samples are printed in
-\family typewriter
+\family typewriter
typewriter font.
-\family default
+\family default
Interesting items and new terms are printed in
-\emph on
+\emph on
italic.
-\layout Section
+\end_layout
+\begin_layout Section
Compatibility
\begin_inset LatexCommand \label{sec:Compatibility-with-previous}
-\end_inset
+\end_inset
with previous versions
\begin_inset LatexCommand \index{Compatibility with previous versions}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
This version has numerous bug fixes compared with the previous version.
But we also introduced some incompatibilities with older versions.
Not just for the fun of it, but to make the compiler more stable, efficient
and ANSI compliant
\begin_inset LatexCommand \index{ANSI-compliance}
-\end_inset
+\end_inset
(see section
\begin_inset LatexCommand \ref{sub:ANSI-Compliance}
-\end_inset
+\end_inset
for ANSI-Compliance).
-\newline
+\newline
-\layout Itemize
+\end_layout
+\begin_layout Itemize
short is now equivalent to int (16 bits), it used to be equivalent to char
(8 bits) which is not ANSI compliant.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
the default directory for gcc-builds where include, library and documentation
files are stored is now in /usr/local/share.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
char type parameters to vararg
\begin_inset LatexCommand \index{vararg, va\_arg}
-\end_inset
+\end_inset
functions are casted to int unless explicitly casted
\begin_inset Marginal
-collapsed true
+status collapsed
-\layout Standard
+\begin_layout Standard
-
-\series bold
-\SpecialChar ~
+\series bold
+\InsetSpace ~
!
-\end_inset
+\end_layout
+
+\end_inset
, e.g.:
-\newline
+\newline
-\family typewriter
-\SpecialChar ~
-\SpecialChar ~
+\family typewriter
+\InsetSpace ~
+\InsetSpace ~
char a=3;
-\newline
-\SpecialChar ~
-\SpecialChar ~
+\newline
+\InsetSpace ~
+\InsetSpace ~
printf ("%d %c
-\backslash
+\backslash
n", a, (char)a);
-\family default
+\family default
-\newline
+\newline
will push a as an int and as a char resp.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
option -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-regextend has been removed.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
option -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-noregparms has been removed.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
option -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-after-data has been removed.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
bit
\begin_inset LatexCommand \index{bit}
-\end_inset
+\end_inset
and sbit
\begin_inset LatexCommand \index{sbit}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{\_\_sbit}
-\end_inset
+\end_inset
types now consistently behave like the C99 _Bool type with respect to type
conversion
\begin_inset LatexCommand \index{type conversion}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{type promotion}
-\end_inset
+\end_inset
.
The most common incompatibility resulting from this change is related to
bit toggling
\begin_inset LatexCommand \index{Bit toggling}
-\end_inset
+\end_inset
idioms, e.g.:
-\newline
+\newline
-\family typewriter
-\SpecialChar ~
-\SpecialChar ~
+\family typewriter
+\InsetSpace ~
+\InsetSpace ~
bit b;
-\newline
-\SpecialChar ~
-\SpecialChar ~
+\newline
+\InsetSpace ~
+\InsetSpace ~
b = ~
\begin_inset LatexCommand \index{\~\/ Operator}
-\end_inset
+\end_inset
b; /* equivalent to b=1 instead of toggling b */
\begin_inset Marginal
-collapsed true
+status collapsed
-\layout Standard
+\begin_layout Standard
-
-\series bold
-\SpecialChar ~
+\series bold
+\InsetSpace ~
!
-\end_inset
+\end_layout
+
+\end_inset
-\newline
-\SpecialChar ~
-\SpecialChar ~
+\newline
+\InsetSpace ~
+\InsetSpace ~
b = !b; /* toggles b */
-\newline
+\newline
-\family default
+\family default
In previous versions, both forms would have toggled the bit.
-\layout Standard
+\end_layout
+\begin_layout Standard
-\emph on
+\emph on
-\layout Section
+\end_layout
+\begin_layout Section
System Requirements
-\layout Standard
+\end_layout
+\begin_layout Standard
What do you need before you start installation of SDCC? A computer, and
a desire to compute.
The preferred method of installation is to compile SDCC from source using
@@ -892,15 +1011,17 @@ What do you need before you start installation of SDCC? A computer, and
For Windows some pre-compiled binary distributions are available for your
convenience.
You should have some experience with command line tools and compiler use.
-\layout Section
+\end_layout
+\begin_layout Section
Other Resources
-\layout Standard
+\end_layout
+\begin_layout Standard
The SDCC home page at
\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/}
-\end_inset
+\end_inset
is a great place to find distribution sets.
You can also find links to the user mailing lists that offer help or discuss
@@ -911,7 +1032,7 @@ The SDCC home page at
A pdf version of this document is available at
\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/doc/sdccman.pdf}
-\end_inset
+\end_inset
.
Some of the other tools (simulator and assembler) included with SDCC contain
@@ -919,452 +1040,546 @@ The SDCC home page at
If you want the latest unreleased software, the complete source package
is available directly from Subversion on https://svn.sourceforge.net/svnroot/sdcc
/trunk/sdcc.
-\layout Section
+\end_layout
+\begin_layout Section
Wishes for the future
-\layout Standard
+\end_layout
+\begin_layout Standard
There are (and always will be) some things that could be done.
Here are some I can think of:
-\newline
+\newline
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
char KernelFunction3(char p) at 0x340;
-\newline
+\newline
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
better code banking
\begin_inset LatexCommand \index{code banking (limited support)}
-\end_inset
+\end_inset
support for mcs51
-\newline
+\newline
-\newline
+\newline
-\family default
+\family default
If you can think of some more, please see the section
\begin_inset LatexCommand \ref{sub:Requesting-Features}
-\end_inset
+\end_inset
about filing feature requests
\begin_inset LatexCommand \index{Requesting features}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Feature request}
-\end_inset
+\end_inset
.
-\newline
+\newline
-\layout Chapter
+\end_layout
+\begin_layout Chapter
Installing SDCC
\begin_inset LatexCommand \index{Installation}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
For most users it is sufficient to skip to either section
\begin_inset LatexCommand \ref{sub:Building-SDCC-on-Linux}
-\end_inset
+\end_inset
(Unix) or section
\begin_inset LatexCommand \ref{sub:Windows-Install}
-\end_inset
+\end_inset
(Windows).
More detailed instructions follow below.
-\layout Section
+\end_layout
+\begin_layout Section
Configure Options
\begin_inset LatexCommand \index{Options SDCC configuration}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
The install paths, search paths and other options are defined when running
'configure'.
The defaults can be overridden by:
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-prefix see table below
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-exec_prefix see table below
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-bindir see table below
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-datadir see table below
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-datarootdir see table below
-\newline
+\newline
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
-\SpecialChar ~
-\SpecialChar ~
-docdir environment variable, see table below
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\InsetSpace ~
+\InsetSpace ~
+docdir environment variable, see table below
+\end_layout
-\SpecialChar ~
-\SpecialChar ~
-include_dir_suffix environment variable, see table below
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\InsetSpace ~
+\InsetSpace ~
+include_dir_suffix environment variable, see table below
+\end_layout
-\SpecialChar ~
-\SpecialChar ~
-lib_dir_suffix environment variable, see table below
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\InsetSpace ~
+\InsetSpace ~
+lib_dir_suffix environment variable, see table below
+\end_layout
-\SpecialChar ~
-\SpecialChar ~
+\begin_layout List
+\labelwidthstring 00.00.0000
+\InsetSpace ~
+\InsetSpace ~
sdccconf_h_dir_separator environment variable, either / or
-\backslash
+\backslash
-\backslash
+\backslash
makes sense here.
This character will only be used in sdccconf.h; don't forget it's a C-header,
therefore a double-backslash is needed there.
-\newline
+\newline
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-mcs51-port Excludes the Intel mcs51 port
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-gbz80-port Excludes the Gameboy gbz80 port
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-z80-port Excludes the z80 port
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-avr-port Excludes the AVR port
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-ds390-port Excludes the DS390 port
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-hc08-port Excludes the HC08 port
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-pic-port Excludes the PIC port
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-xa51-port Excludes the XA51 port
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-ucsim Disables configuring and building of ucsim
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-device-lib Disables automatically building device libraries
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-packihx Disables building packihx
-\newline
+\newline
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-enable-doc Build pdf, html and txt files from the lyx sources
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-enable-libgc Use the Bohem memory allocator.
Lower runtime footprint.
-\layout Standard
+\end_layout
+\begin_layout Standard
Furthermore the environment variables CC, CFLAGS, ...
the tools and their arguments can be influenced.
Please see `configure -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-help` and the man/info pages of `configure` for details.
-\newline
+\newline
-\newline
-The names of the standard libraries STD_LIB, STD_INT_LIB, STD_LONG_LIB,
- STD_FP_LIB, STD_DS390_LIB, STD_XA51_LIB and the environment variables SDCC_DIR_
-NAME, SDCC_INCLUDE_NAME, SDCC_LIB_NAME are defined by `configure` too.
+\newline
+The names of the
+ standard libraries STD_LIB, STD_INT_LIB, STD_LONG_LIB, STD_FP_LIB, STD_DS390_LI
+B, STD_XA51_LIB and the environment variables SDCC_DIR_NAME, SDCC_INCLUDE_NAME,
+ SDCC_LIB_NAME are defined by `configure` too.
At the moment it's not possible to change the default settings (it was
simply never required).
-\newline
+\newline
-\newline
-These configure options are compiled into the binaries, and can only be
- changed by rerunning 'configure' and recompiling SDCC.
+\newline
+These configure options are compiled into the binaries,
+ and can only be changed by rerunning 'configure' and recompiling SDCC.
The configure options are written in
-\emph on
+\emph on
italics
-\emph default
+\emph default
to distinguish them from run time environment variables (see section search
paths).
-\newline
+\newline
-\newline
+\newline
The settings for
\begin_inset Quotes sld
-\end_inset
+\end_inset
Win32 builds
\begin_inset Quotes srd
-\end_inset
+\end_inset
are used by the SDCC team to build the official Win32 binaries.
The SDCC team uses Mingw32 to build the official Windows binaries, because
it's
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
open source,
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
a gcc compiler and last but not least
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
the binaries can be built by cross compiling on Sourceforge's compile farm.
-\layout Standard
+\end_layout
+\begin_layout Standard
See the examples, how to pass the Win32 settings to 'configure'.
The other Win32 builds using Borland, VC or whatever don't use 'configure',
but a header file sdcc_vc_in.h is the same as sdccconf.h built by 'configure'
for Win32.
-\newline
+\newline
-\newline
+\newline
These defaults are:
-\newline
+\newline
-\layout Standard
-\align center
+\end_layout
-\begin_inset Tabular
+\begin_layout Standard
+\align center
+\begin_inset Tabular
@@ -1374,306 +1589,336 @@ These defaults are:
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Variable
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
default
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Win32 builds
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
PREFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
/usr/local
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\backslash
+\backslash
sdcc
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
EXEC_PREFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$PREFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$PREFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
BINDIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$EXEC_PREFIX
-\emph default
+\emph default
/bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$EXEC_PREFIX
-\emph default
+\emph default
-\backslash
+\backslash
bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
DATADIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$DATAROOTDIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$DATAROOTDIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
DATAROOTDIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$PREFIX
-\emph default
+\emph default
/share
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$PREFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
DOCDIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$DATAROOTDIR
-\emph default
+\emph default
/sdcc/doc
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$DATAROOTDIR
-\emph default
+\emph default
-\backslash
+\backslash
doc
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
INCLUDE_DIR_SUFFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
sdcc/include
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
include
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
LIB_DIR_SUFFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
sdcc/lib
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
lib
-\end_inset
+\end_layout
+
+\end_inset
-\end_inset
+\end_inset
-\newline
+\newline
-\layout Standard
-\noindent
+\end_layout
+
+\begin_layout Standard
+\noindent
'configure' also computes relative paths.
This is needed for full relocatability of a binary package and to complete
search paths (see section search paths below):
-\newline
+\newline
-\layout Standard
-\align center
+\end_layout
-\begin_inset Tabular
+\begin_layout Standard
+\align center
+\begin_inset Tabular
@@ -1683,553 +1928,619 @@ lib
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Variable (computed)
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
default
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Win32 builds
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-\emph on
+\emph on
BIN2DATA_DIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
../share
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
..
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-\emph on
+\emph on
PREFIX2BIN_DIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-\emph on
+\emph on
PREFIX2DATA_DIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
share/sdcc
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+
+\end_layout
-\end_inset
+\end_inset
-\end_inset
+\end_inset
-\newline
+\newline
-\layout Standard
-\noindent
+\end_layout
+
+\begin_layout Standard
+\noindent
Examples:
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
./configure
-\newline
+\newline
./configure -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-prefix=
\begin_inset Quotes srd
-\end_inset
+\end_inset
/usr/bin
\begin_inset Quotes srd
-\end_inset
+\end_inset
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-datarootdir=
\begin_inset Quotes srd
-\end_inset
+\end_inset
/usr/share
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\newline
+\newline
./configure -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-avr-port -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-xa51-port
-\layout Standard
+\end_layout
+\begin_layout Standard
To cross compile on linux for Mingw32 (see also 'sdcc/support/scripts/sdcc_mingw
32'):
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
./configure
-\backslash
+\backslash
-\newline
+\newline
CC=
\begin_inset Quotes srd
-\end_inset
+\end_inset
i586-mingw32msvc-gcc
\begin_inset Quotes srd
-\end_inset
+\end_inset
CXX=
\begin_inset Quotes srd
-\end_inset
+\end_inset
i586-mingw32msvc-g++
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
RANLIB=
\begin_inset Quotes srd
-\end_inset
+\end_inset
i586-mingw32msvc-ranlib
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
STRIP=
\begin_inset Quotes srd
-\end_inset
+\end_inset
i586-mingw32msvc-strip
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-prefix=
\begin_inset Quotes srd
-\end_inset
+\end_inset
/sdcc
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-datarootdir=
\begin_inset Quotes srd
-\end_inset
+\end_inset
/sdcc
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
docdir=
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
${datarootdir}/doc
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
include_dir_suffix=
\begin_inset Quotes srd
-\end_inset
+\end_inset
include
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
lib_dir_suffix=
\begin_inset Quotes srd
-\end_inset
+\end_inset
lib
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
sdccconf_h_dir_separator=
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\backslash
+\backslash
-\backslash
+\backslash
-\backslash
+\backslash
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-disable-device-lib
-\backslash
+\backslash
-\newline
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-host=i586-mingw32msvc
-\backslash
+\backslash
-\newline
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-build=unknown-unknown-linux-gnu
-\layout Standard
+\end_layout
+\begin_layout Standard
To
\begin_inset Quotes sld
-\end_inset
+\end_inset
cross
\begin_inset Quotes srd
-\end_inset
+\end_inset
compile on Cygwin for Mingw32 (see also sdcc/support/scripts/sdcc_cygwin_mingw32
):
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
./configure -C
-\backslash
+\backslash
-\newline
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-prefix=
\begin_inset Quotes srd
-\end_inset
+\end_inset
/sdcc
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-datarootdir=
\begin_inset Quotes srd
-\end_inset
+\end_inset
/sdcc
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
docdir=
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
${datarootdir}/doc
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
include_dir_suffix=
\begin_inset Quotes srd
-\end_inset
+\end_inset
include
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
lib_dir_suffix=
\begin_inset Quotes srd
-\end_inset
+\end_inset
lib
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
sdccconf_h_dir_separator=
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\backslash
+\backslash
-\backslash
+\backslash
-\backslash
+\backslash
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
CC=
\begin_inset Quotes srd
-\end_inset
+\end_inset
gcc -mno-cygwin
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\backslash
+\backslash
-\newline
+\newline
CXX=
\begin_inset Quotes srd
-\end_inset
+\end_inset
g++ -mno-cygwin
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
'configure' is quite slow on Cygwin (at least on windows before Win2000/XP).
The option '-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-C' turns on caching, which gives a little bit extra speed.
However if options are changed, it can be necessary to delete the config.cache
file.
-\layout Section
+\end_layout
+\begin_layout Section
Install paths
\begin_inset LatexCommand \label{sub:Install-paths}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Install paths}
-\end_inset
+\end_inset
+
+\end_layout
-\layout Standard
-\added_space_top medskip \align center
+\begin_layout Standard
+\begin_inset VSpace medskip
+\end_inset
-\begin_inset Tabular
+
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Tabular
@@ -2240,282 +2551,313 @@ Install paths
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\series bold
+\series bold
Description
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\series bold
+\series bold
Path
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\series bold
+\series bold
Default
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\series bold
+\series bold
Win32 builds
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Binary files*
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$EXEC_PREFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
/usr/local/bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\backslash
+\backslash
sdcc
-\backslash
+\backslash
bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Include files
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$DATADIR/ $INCLUDE_DIR_SUFFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
/usr/local/share/sdcc/include
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\backslash
+\backslash
sdcc
-\backslash
+\backslash
include
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Library file**
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$DATADIR/$LIB_DIR_SUFFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
/usr/local/share/sdcc/lib
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\backslash
+\backslash
sdcc
-\backslash
+\backslash
lib
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Documentation
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$DOCDIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
/usr/local/share/sdcc/doc
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\backslash
+\backslash
sdcc
-\backslash
+\backslash
doc
-\end_inset
+\end_layout
+
+\end_inset
-\end_inset
+\end_inset
-\layout Verse
+\end_layout
+\begin_layout Verse
-\size footnotesize
+\size footnotesize
*compiler, preprocessor, assembler, and linker
-\newline
+\newline
**the
-\shape italic
+\shape italic
model
-\shape default
+\shape default
is auto-appended by the compiler, e.g.
small, large, z80, ds390 etc
-\layout Standard
-\noindent
+\end_layout
+
+\begin_layout Standard
+\noindent
The install paths can still be changed during `make install` with e.g.:
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
make install prefix=$(HOME)/local/sdcc
-\layout Standard
+\end_layout
+\begin_layout Standard
Of course this doesn't change the search paths compiled into the binaries.
-\newline
+\newline
-\newline
-Moreover the install path can be changed by defining DESTDIR
+\newline
+Moreove
+r the install path can be changed by defining DESTDIR
\begin_inset LatexCommand \index{DESTDIR}
-\end_inset
+\end_inset
:
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
make install DESTDIR=$(HOME)/sdcc.rpm/
-\layout Standard
+\end_layout
+\begin_layout Standard
Please note that DESTDIR must have a trailing slash!
-\layout Section
+\end_layout
+\begin_layout Section
Search Paths
\begin_inset LatexCommand \label{sub:Search-Paths}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Search path}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
Some search paths or parts of them are determined by configure variables
(in
-\emph on
+\emph on
italics
-\emph default
+\emph default
, see section above).
Further search paths are determined by environment variables during runtime.
-\newline
-The paths searched when running the compiler are as follows (the first catch
- wins):
-\newline
+\newline
+The paths searched when running the compiler are as follows (the first
+ catch wins):
+\newline
-\newline
+\newline
1.
Binary files (preprocessor, assembler and linker)
-\newline
+\newline
-\layout Standard
-\align center
+\end_layout
-\begin_inset Tabular
+\begin_layout Standard
+\align center
+\begin_inset Tabular
@@ -2525,127 +2867,142 @@ The paths searched when running the compiler are as follows (the first catch
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Search path
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
default
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Win32 builds
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_HOME/
-\emph on
+\emph on
$PPREFIX2BIN_DIR
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_HOME/bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_HOME
-\backslash
+\backslash
bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Path of argv[0] (if available)
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Path of argv[0]
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Path of argv[0]
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$PATH
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$PATH
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$PATH
-\end_inset
+\end_layout
+
+\end_inset
-\end_inset
+\end_inset
-\newline
+\newline
+
+\end_layout
-\layout Standard
-\noindent
+\begin_layout Standard
+\noindent
2.
Include files
-\newline
+\newline
-\layout Standard
-\align center
+\end_layout
-\begin_inset Tabular
+\begin_layout Standard
+\align center
+\begin_inset Tabular
@@ -2655,326 +3012,363 @@ $PATH
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Search path
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
default
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Win32 builds
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-I dir
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-I dir
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-I dir
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_INCLUDE
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_INCLUDE
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_INCLUDE
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_HOME/
-\newline
+\newline
-\emph on
+\emph on
$PREFIX2DATA_DIR/
-\newline
+\newline
$INCLUDE_DIR_SUFFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_ HOME/
-\newline
+\newline
share/sdcc/
-\newline
+\newline
include
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_HOME
-\backslash
+\backslash
include
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
path(argv[0])/
-\newline
+\newline
-\emph on
+\emph on
$BIN2DATADIR/
-\emph default
+\emph default
-\newline
+\newline
-\emph on
+\emph on
$INCLUDE_DIR_SUFFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
path(argv[0])/
-\newline
+\newline
../sdcc/include
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-
-\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
-
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Standard
path(argv[0])
-\backslash
+\backslash
..
-\backslash
+\backslash
include
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-\emph on
+\emph on
$DATADIR/
-\emph default
+\emph default
-\newline
+\newline
-\emph on
+\emph on
$INCLUDE_DIR_SUFFIX
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
/usr/local/share/sdcc/
-\newline
+\newline
include
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
(not on Win32)
-\end_inset
+\end_layout
+
+\end_inset
-\end_inset
+\end_inset
-\newline
+\newline
+
+\end_layout
-\layout Standard
-\noindent
+\begin_layout Standard
+\noindent
The option -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-nostdinc disables the last two search paths.
-\newline
+\newline
-\newline
+\newline
3.
Library files
-\newline
+\newline
-\layout Standard
+\end_layout
+\begin_layout Standard
With the exception of
\begin_inset Quotes sld
-\end_inset
+\end_inset
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-L dir
\begin_inset Quotes srd
-\end_inset
+\end_inset
the
-\shape italic
+\shape italic
model
-\shape default
+\shape default
is auto-appended by the compiler (e.g.
small, large, z80, ds390 etc.).
-\newline
+\newline
-\layout Standard
-\align center
+\end_layout
-\begin_inset Tabular
+\begin_layout Standard
+\align center
+\begin_inset Tabular
@@ -2984,662 +3378,748 @@ model
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Search path
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
default
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
Win32 builds
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-L dir
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-L dir
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-L dir
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_LIB/
-\newline
+\newline
-\emph on
+\emph on
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_LIB/
-\newline
+\newline
-\emph on
+\emph on
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_LIB
-\backslash
+\backslash
-\newline
+\newline
-\emph on
+\emph on
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_HOME/
-\newline
+\newline
-\emph on
+\emph on
$PREFIX2DATA_DIR/
-\newline
+\newline
$LIB_DIR_SUFFIX/
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_HOME/
-\newline
+\newline
share/sdcc/
-\newline
+\newline
lib/
-\emph on
+\emph on
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
$SDCC_HOME
-\backslash
+\backslash
lib
-\backslash
+\backslash
-\emph on
+\emph on
-\newline
+\newline
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
path(argv[0])/
-\newline
+\newline
-\emph on
+\emph on
$BIN2DATADIR/
-\emph default
+\emph default
-\newline
+\newline
-\emph on
+\emph on
$LIB_DIR_SUFFIX/
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
path(argv[0])/
-\newline
+\newline
../sdcc/lib/
-\emph on
+\emph on
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-
-\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
-
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+
+\end_layout
+
+\end_inset
+
+
+\begin_inset Text
+
+\begin_layout Standard
path(argv[0])
-\backslash
+\backslash
-\newline
+\newline
..
-\backslash
+\backslash
lib
-\backslash
+\backslash
-\emph on
+\emph on
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-
-\end_inset
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\emph on
+\emph on
$DATADIR/
-\newline
+\newline
$LIB_DIR_SUFFIX/
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
/usr/local/share/sdcc/
-\newline
+\newline
lib/
-\emph on
+\emph on
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
(not on Win32)
-\end_inset
+\end_layout
+
+\end_inset
-\end_inset
+\end_inset
-\newline
+\newline
-\layout Comment
+\end_layout
+\begin_layout Standard
+\begin_inset Note Comment
+status collapsed
+
+\begin_layout Standard
Don't delete any of the stray spaces in the table above without checking
the HTML output (last line)!
-\layout Standard
+\end_layout
+
+\end_inset
-\SpecialChar ~
-\newline
+\end_layout
+
+\begin_layout Standard
+\InsetSpace ~
+
+\newline
The option -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-nostdlib disables the last two search paths.
-\layout Section
+\end_layout
+\begin_layout Section
Building SDCC
\begin_inset LatexCommand \index{Building SDCC}
-\end_inset
+\end_inset
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Building SDCC on Linux
\begin_inset LatexCommand \label{sub:Building-SDCC-on-Linux}
-\end_inset
+\end_inset
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
-\series medium
+\series medium
Download the source package
-\series default
+\series default
either from the SDCC Subversion repository or from the nightly snapshots
-\series medium
+\series medium
, it will be named something like sdcc
-\series default
+\series default
.src
-\series medium
+\series medium
.t
-\series default
+\series default
ar.
-\series medium
+\series medium
gz
-\series default
+\series default
\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
-\end_inset
+\end_inset
.
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
-\series medium
+\series medium
Bring up a command line terminal, such as xterm.
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
-\series medium
+\series medium
Unpack the file using a command like:
-\family sans
-\series bold
+\family sans
+\series bold
"tar -xvzf sdcc.src.tar.gz
-\family default
-\series default
+\family default
+\series default
"
-\series medium
+\series medium
, this will create a sub-directory called sdcc with all of the sources.
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
Change directory into the main SDCC directory, for example type:
-\family sans
-\series bold
+\family sans
+\series bold
"cd sdcc
-\series default
+\series default
".
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
-\series medium
+\series medium
Type
-\family sans
-\series bold
+\family sans
+\series bold
"./configure
-\family default
-\series default
+\family default
+\series default
".
This configures the package for compilation on your system.
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
-\series medium
+\series medium
Type
-\family sans
-\series bold
+\family sans
+\series bold
"make
-\family default
-\series default
+\family default
+\series default
"
-\series medium
+\series medium
.
-\series default
+\series default
All of the source packages will compile, this can take a while.
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
-\series medium
+\series medium
Type
-\family sans
-\series bold
+\family sans
+\series bold
"make install"
-\family default
-\series default
+\family default
+\series default
as root
-\series medium
+\series medium
.
-\series default
+\series default
This copies the binary executables, the include files, the libraries and
the documentation to the install directories.
Proceed with section
\begin_inset LatexCommand \ref{sec:Testing-the-SDCC}
-\end_inset
+\end_inset
.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Building SDCC on OSX 2.x
-\layout Standard
+\end_layout
+\begin_layout Standard
Follow the instruction for Linux.
-\newline
+\newline
-\newline
-On OSX 2.x it was reported, that the default gcc (version 3.1 20020420 (prerelease
-)) fails to compile SDCC.
+\newline
+On OSX 2.x it was reported, that the default
+ gcc (version 3.1 20020420 (prerelease)) fails to compile SDCC.
Fortunately there's also gcc 2.9.x installed, which works fine.
This compiler can be selected by running 'configure' with:
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
./configure CC=gcc2 CXX=g++2
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Cross compiling SDCC on Linux for Windows
-\layout Standard
+\end_layout
+\begin_layout Standard
With the Mingw32 gcc cross compiler it's easy to compile SDCC for Win32.
See section 'Configure Options'.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Building SDCC using Cygwin and Mingw32
-\layout Standard
+\end_layout
+\begin_layout Standard
For building and installing a Cygwin executable follow the instructions
for Linux.
-\newline
+\newline
-\newline
+\newline
On Cygwin a
\begin_inset Quotes sld
-\end_inset
+\end_inset
native
\begin_inset Quotes srd
-\end_inset
+\end_inset
Win32-binary can be built, which will not need the Cygwin-DLL.
For the necessary 'configure' options see section 'configure options' or
the script 'sdcc/support/scripts/sdcc_cygwin_mingw32'.
-\newline
+\newline
-\newline
-In order to install Cygwin on Windows download setup.exe from
+\newline
+In order to install
+ Cygwin on Windows download setup.exe from
\begin_inset LatexCommand \url[www.cygwin.com]{http://www.cygwin.com/}
-\end_inset
+\end_inset
.
Run it, set the
\begin_inset Quotes sld
-\end_inset
+\end_inset
default text file type
\begin_inset Quotes srd
-\end_inset
+\end_inset
to
\begin_inset Quotes sld
-\end_inset
+\end_inset
unix
\begin_inset Quotes srd
-\end_inset
+\end_inset
and download/install at least the following packages.
Some packages are selected by default, others will be automatically selected
because of dependencies with the manually selected packages.
Never deselect these packages!
-\layout Itemize
+\end_layout
+\begin_layout Itemize
flex
-\layout Itemize
+\end_layout
+\begin_layout Itemize
bison
-\layout Itemize
+\end_layout
+\begin_layout Itemize
gcc ; version 3.x is fine, no need to use the old 2.9x
-\layout Itemize
+\end_layout
+\begin_layout Itemize
binutils ; selected with gcc
-\layout Itemize
+\end_layout
+\begin_layout Itemize
make
-\layout Itemize
+\end_layout
+\begin_layout Itemize
rxvt ; a nice console, which makes life much easier under windoze (see below)
-\layout Itemize
+\end_layout
+\begin_layout Itemize
man ; not really needed for building SDCC, but you'll miss it sooner or
later
-\layout Itemize
+\end_layout
+\begin_layout Itemize
less ; not really needed for building SDCC, but you'll miss it sooner or
later
-\layout Itemize
+\end_layout
+\begin_layout Itemize
svn ; only if you use Subversion access
-\layout Standard
+\end_layout
+\begin_layout Standard
If you want to develop something you'll need:
-\layout Itemize
+\end_layout
+\begin_layout Itemize
python ; for the regression tests
-\layout Itemize
+\end_layout
+\begin_layout Itemize
gdb ; the gnu debugger, together with the nice GUI
\begin_inset Quotes sld
-\end_inset
+\end_inset
insight
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\layout Itemize
+\end_layout
+\begin_layout Itemize
openssh ; to access the CF or commit changes
-\layout Itemize
+\end_layout
+\begin_layout Itemize
autoconf and autoconf-devel ; if you want to fight with 'configure', don't
use autoconf-stable!
-\layout Standard
+\end_layout
+\begin_layout Standard
rxvt is a nice console with history.
Replace in your cygwin.bat the line
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
bash -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-login -i
-\layout Standard
+\end_layout
+\begin_layout Standard
with (one line):
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
rxvt -sl 1000 -fn "Lucida Console-12" -sr -cr red
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
-bg black -fg white -geometry 100x65 -e bash -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-login
-\layout Standard
+\end_layout
+\begin_layout Standard
Text selected with the mouse is automatically copied to the clipboard, pasting
works with shift-insert.
-\newline
+\newline
-\newline
-The other good tip is to make sure you have no //c/-style paths anywhere,
- use /cygdrive/c/ instead.
+\newline
+The other good tip is to make sure you have no //c/-styl
+e paths anywhere, use /cygdrive/c/ instead.
Using // invokes a network lookup which is very slow.
If you think
\begin_inset Quotes sld
-\end_inset
+\end_inset
cygdrive
\begin_inset Quotes srd
-\end_inset
+\end_inset
is too long, you can change it with e.g.
-\layout LyX-Code
+\end_layout
+\begin_layout LyX-Code
mount -s -u -c /mnt
-\layout Standard
+\end_layout
+\begin_layout Standard
SDCC sources use the unix line ending LF.
Life is much easier, if you store the source tree on a drive which is mounted
in binary mode.
@@ -3648,51 +4128,53 @@ SDCC sources use the unix line ending LF.
The tabulator spacing
\begin_inset LatexCommand \index{tabulator spacing (8 columns)}
-\end_inset
+\end_inset
used in the project is 8.
Although a tabulator spacing of 8 is a sensible choice for programmers
(it's a power of 2 and allows to display 8/16 bit signed variables without
loosing columns) the plan is to move towards using only spaces in the source.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Building SDCC Using Microsoft Visual C++ 6.0/NET (MSVC)
-\layout Standard
+\end_layout
+\begin_layout Standard
-\series medium
+\series medium
Download the source package
-\series default
+\series default
either from the SDCC Subversion repository or from the
\begin_inset LatexCommand \url[nightly snapshots]{http://sdcc.sourceforge.net/snap.php}
-\end_inset
+\end_inset
-\series medium
+\series medium
, it will be named something like sdcc
-\series default
+\series default
.src
-\series medium
+\series medium
.tgz.
-\series default
+\series default
SDCC is distributed with all the projects, workspaces, and files you need
to build it using Visual C++ 6.0/NET (except for SDCDB and ucSim).
The workspace name is 'sdcc.dsw'.
Please note that as it is now, all the executables are created in a folder
called sdcc
-\backslash
+\backslash
bin_vc.
Once built you need to copy the executables from sdcc
-\backslash
+\backslash
bin_vc to sdcc
-\backslash
+\backslash
bin before running SDCC.
-\newline
+\newline
-\newline
+\newline
WARNING: Visual studio is very picky with line terminations; it expects
the 0x0d, 0x0a DOS style line endings, not the 0x0a Unix style line endings.
When using the Subversion repository it's easiest to configure the svn
@@ -3701,382 +4183,406 @@ WARNING: Visual studio is very picky with line terminations; it expects
by Developer Studio etc.
etc.
\begin_inset Quotes srd
-\end_inset
+\end_inset
when opening the sdcc.dsw workspace or any of the *.dsp projects, then you
need to convert the Unix style line endings to DOS style line endings.
To do so you can use the
\begin_inset Quotes sld
-\end_inset
+\end_inset
unix2dos
\begin_inset Quotes srd
-\end_inset
+\end_inset
utility freely available on the internet.
Doug Hawkins reported in the sdcc-user list that this works:
-\newline
+\newline
-\newline
+\newline
C:
-\backslash
+\backslash
Programming
-\backslash
+\backslash
SDCC> unix2dos sdcc.dsw
-\newline
+\newline
C:
-\backslash
+\backslash
Programming
-\backslash
+\backslash
SDCC> for /R %I in (*.dsp) do @unix2dos "%I"
-\newline
+\newline
-\newline
-In order to build SDCC with MSVC you need win32 executables of bison.exe,
- flex.exe, and gawk.exe.
+\newline
+In order to build SDCC with MSVC
+ you need win32 executables of bison.exe, flex.exe, and gawk.exe.
One good place to get them is
\begin_inset LatexCommand \url[here]{http://unxutils.sourceforge.net}
-\end_inset
+\end_inset
-\newline
+\newline
-\newline
+\newline
Download the file UnxUtils
\begin_inset LatexCommand \index{UnxUtils}
-\end_inset
+\end_inset
.zip.
Now you have to install the utilities and setup MSVC so it can locate the
required programs.
Here there are two alternatives (choose one!):
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
The easy way:
-\newline
+\newline
-\newline
+\newline
a) Extract UnxUtils.zip to your C:
-\backslash
+\backslash
hard disk PRESERVING the original paths, otherwise bison won't work.
(If you are using WinZip make certain that 'Use folder names' is selected)
-\newline
+\newline
-\newline
-b) In the Visual C++ IDE click Tools, Options, select the Directory tab,
- in 'Show directories for:' select 'Executable files', and in the directories
+\newline
+b)
+ In the Visual C++ IDE click Tools, Options, select the Directory tab, in
+ 'Show directories for:' select 'Executable files', and in the directories
window add a new path: 'C:
-\backslash
+\backslash
user
-\backslash
+\backslash
local
-\backslash
+\backslash
wbin', click ok.
-\newline
+\newline
-\newline
-(As a side effect, you get a bunch of Unix utilities that could be useful,
- such as diff and patch.)
-\layout Enumerate
+\newline
+(As a side effect, you get a bunch of Unix utilities that
+ could be useful, such as diff and patch.)
+\end_layout
+\begin_layout Enumerate
A more compact way:
-\newline
+\newline
-\newline
-This one avoids extracting a bunch of files you may not use, but requires
- some extra work:
-\newline
+\newline
+This one avoids extracting a bunch of files you may not
+ use, but requires some extra work:
+\newline
-\newline
-a) Create a directory were to put the tools needed, or use a directory already
- present.
+\newline
+a) Create a directory were to put the
+ tools needed, or use a directory already present.
Say for example 'C:
-\backslash
+\backslash
util'.
-\newline
+\newline
-\newline
-b) Extract 'bison.exe', 'bison.hairy', 'bison.simple', 'flex.exe', and gawk.exe
- to such directory WITHOUT preserving the original paths.
+\newline
+b) Extract 'bison.exe', 'bison.hairy', 'bison.simple', 'flex.exe', and
+ gawk.exe to such directory WITHOUT preserving the original paths.
(If you are using WinZip make certain that 'Use folder names' is not selected)
-\newline
+\newline
-\newline
-c) Rename bison.exe to '_bison.exe'.
-\newline
+\newline
+c
+) Rename bison.exe to '_bison.exe'.
+\newline
-\newline
+\newline
d) Create a batch file 'bison.bat' in 'C:
-\backslash
+\backslash
util
-\backslash
+\backslash
' and add these lines:
-\newline
-\SpecialChar ~
-\SpecialChar ~
+\newline
+\InsetSpace ~
+\InsetSpace ~
set BISON_SIMPLE=C:
-\backslash
+\backslash
util
-\backslash
+\backslash
bison.simple
-\newline
-\SpecialChar ~
-\SpecialChar ~
+\newline
+\InsetSpace ~
+\InsetSpace ~
set BISON_HAIRY=C:
-\backslash
+\backslash
util
-\backslash
+\backslash
bison.hairy
-\newline
-\SpecialChar ~
-\SpecialChar ~
+\newline
+\InsetSpace ~
+\InsetSpace ~
_bison %1 %2 %3 %4 %5 %6 %7 %8 %9
-\newline
+\newline
-\newline
-Steps 'c' and 'd' are needed because bison requires by default that the
- files 'bison.simple' and 'bison.hairy' reside in some weird Unix directory,
- '/usr/local/share/' I think.
+\newline
+Steps 'c' and 'd' are needed
+ because bison requires by default that the files 'bison.simple' and 'bison.hairy'
+ reside in some weird Unix directory, '/usr/local/share/' I think.
So it is necessary to tell bison where those files are located if they
are not in such directory.
That is the function of the environment variables BISON_SIMPLE and BISON_HAIRY.
-\newline
+\newline
-\newline
-e) In the Visual C++ IDE click Tools, Options, select the Directory tab,
+\newline
+e
+) In the Visual C++ IDE click Tools, Options, select the Directory tab,
in 'Show directories for:' select 'Executable files', and in the directories
window add a new path: 'c:
-\backslash
+\backslash
util', click ok.
Note that you can use any other path instead of 'c:
-\backslash
+\backslash
util', even the path where the Visual C++ tools are, probably: 'C:
-\backslash
+\backslash
Program Files
-\backslash
+\backslash
Microsoft Visual Studio
-\backslash
+\backslash
Common
-\backslash
+\backslash
Tools'.
So you don't have to execute step 'e' :)
-\layout Standard
+\end_layout
+\begin_layout Standard
That is it.
Open 'sdcc.dsw' in Visual Studio, click 'build all', when it finishes copy
the executables from sdcc
-\backslash
+\backslash
bin_vc to sdcc
-\backslash
+\backslash
bin, and you can compile using SDCC.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Building SDCC Using Borland
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
From the sdcc directory, run the command "make -f Makefile.bcc".
This should regenerate all the .exe files in the bin directory except for
SDCDB and ucSim.
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
If you modify any source files and need to rebuild, be aware that the dependenci
es may not be correctly calculated.
The safest option is to delete all .obj files and run the build again.
From a Cygwin BASH prompt, this can easily be done with the command (be
sure you are in the sdcc directory):
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
+\family sans
+\series bold
find .
-\backslash
+\backslash
( -name '*.obj' -o -name '*.lib' -o -name '*.rul'
-\backslash
+\backslash
) -print -exec rm {}
-\backslash
+\backslash
;
-\family default
-\series default
+\family default
+\series default
-\newline
+\newline
-\newline
+\newline
or on Windows NT/2000/XP from the command prompt with the command:
-\newline
+\newline
-\family sans
-\series bold
+\family sans
+\series bold
-\newline
+\newline
del /s *.obj *.lib *.rul
-\family default
-\series default
+\family default
+\series default
from the sdcc directory.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Windows Install Using a ZIP Package
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
Download the binary zip package from
\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
-\end_inset
+\end_inset
and unpack it using your favorite unpacking tool (gunzip, WinZip, etc).
This should unpack to a group of sub-directories.
An example directory structure after unpacking the mingw32 package is:
c:
-\backslash
+\backslash
sdcc
-\backslash
+\backslash
bin for the executables, c:
-\backslash
+\backslash
sdcc
-\backslash
+\backslash
include and c:
-\backslash
+\backslash
sdcc
-\backslash
+\backslash
lib for the include and libraries.
-\layout Enumerate
+\end_layout
+\begin_layout Enumerate
Adjust your environment variable PATH to include the location of the bin
directory or start sdcc using the full path.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Windows Install Using the Setup Program
\begin_inset LatexCommand \label{sub:Windows-Install}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
Download the setup program
-\emph on
+\emph on
sdcc-x.y.z-setup.exe
-\emph default
+\emph default
for an official release from
-\newline
+\newline
\begin_inset LatexCommand \url{http://sf.net/project/showfiles.php?group_id=599}
-\end_inset
+\end_inset
or a setup program for one of the snapshots
-\emph on
+\emph on
sdcc-yyyymmdd-xxxx-setup.exe
-\emph default
+\emph default
from
\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
-\end_inset
+\end_inset
and execute it.
A windows typical installer will guide you through the installation process.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
VPATH
\begin_inset LatexCommand \index{VPATH}
-\end_inset
+\end_inset
feature
-\layout Standard
+\end_layout
+\begin_layout Standard
SDCC supports the VPATH feature provided by configure and make.
It allows to separate the source and build trees.
Here's an example:
-\layout Standard
-
-
-\family typewriter
-cd ~\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+cd ~\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
# cd $HOME
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
-tar -xzf sdcc.src.tar.gz\SpecialChar ~
+\family typewriter
+tar -xzf sdcc.src.tar.gz\InsetSpace ~
# extract source to directory sdcc
-\layout Standard
-
-
-\family typewriter
-mkdir sdcc.build\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+mkdir sdcc.build\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
# put output in sdcc.build
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
cd sdcc.build
-\layout Standard
-
-
-\family typewriter
-../sdcc/configure\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+../sdcc/configure\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
# configure is doing all the magic!
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
make
-\layout Standard
-\noindent
+\end_layout
+
+\begin_layout Standard
+\noindent
That's it!
-\series bold
+\series bold
configure
-\series default
+\series default
will create the directory tree will all the necessary Makefiles in ~/sdcc.build.
It automagically computes the variables srcdir, top_srcdir and top_buildir
for each directory.
After running
-\series bold
+\series bold
make
-\series default
+\series default
the generated files will be in ~/sdcc.build, while the source files stay
in ~/sdcc.
-\newline
+\newline
This is not only usefull for building different binaries, e.g.
when cross compiling.
It also gives you a much better overview in the source tree when all the
@@ -4086,578 +4592,616 @@ This is not only usefull for building different binaries, e.g.
Simply copy it to the build directory, edit it, enter `make clean`, `rm
Makefile.dep` and `make`.
-\series bold
+\series bold
make
-\series default
+\series default
will do the rest for you!
-\layout Section
+\end_layout
+\begin_layout Section
Building the Documentation
-\layout Standard
+\end_layout
+\begin_layout Standard
Add -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-enable-doc to the configure arguments to build the documentation together
with all the other stuff.
You will need several tools (LyX, LaTeX, LaTeX2HTML, pdflatex, dvipdf,
dvips and makeindex) to get the job done.
Another possibility is to change to the doc directory and to type
-\family sans
-\series bold
+\family sans
+\series bold
\begin_inset Quotes srd
-\end_inset
+\end_inset
make
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\family default
-\series default
+\family default
+\series default
there.
You're invited to make changes and additions to this manual (sdcc/doc/sdccman.ly
x).
Using LyX
\begin_inset LatexCommand \url{http://www.lyx.org}
-\end_inset
+\end_inset
as editor is straightforward.
Prebuilt documentation in html and pdf format is available from
\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
-\end_inset
+\end_inset
.
-\layout Section
+\end_layout
+\begin_layout Section
Reading the Documentation
\begin_inset LatexCommand \index{Documentation}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
Currently reading the document in pdf format is recommended, as for unknown
reason the hyperlinks are working there whereas in the html version they
are not
\begin_inset Foot
-collapsed false
-
-\layout Standard
+status open
+\begin_layout Standard
If you should know why please drop us a note
-\end_inset
+\end_layout
+
+\end_inset
.
-\newline
+\newline
You'll find the pdf version
\begin_inset LatexCommand \index{PDF version of this document}
-\end_inset
+\end_inset
at
\begin_inset LatexCommand \url{http://sdcc.sf.net/doc/sdccman.pdf}
-\end_inset
+\end_inset
.
-\newline
+\newline
A html version
\begin_inset LatexCommand \index{HTML version of this document}
-\end_inset
+\end_inset
should be online at
\begin_inset LatexCommand \url{http://sdcc.sf.net/doc/sdccman.html/index.html}
-\end_inset
+\end_inset
.
-\newline
+\newline
This documentation is in some aspects different from a commercial documentation:
-\layout Itemize
+\end_layout
+\begin_layout Itemize
It tries to document SDCC for several processor architectures in one document
(commercially these probably would be separate documents/products).
This document
\begin_inset LatexCommand \index{Status of documentation}
-\end_inset
+\end_inset
currently matches SDCC for mcs51 and DS390 best and does give too few informati
on about f.e.
Z80, PIC14, PIC16 and HC08.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
There are many references pointing away from this documentation.
Don't let this distract you.
If there f.e.
was a reference like
\begin_inset LatexCommand \url{http://www.opencores.org}
-\end_inset
+\end_inset
together with a statement
\begin_inset Quotes sld
-\end_inset
+\end_inset
some processors which are targetted by SDCC can be implemented in a
-\emph on
+\emph on
f
-\emph default
+\emph default
ield
-\emph on
+\emph on
p
-\emph default
+\emph default
rogrammable
-\emph on
+\emph on
g
-\emph default
+\emph default
ate
-\emph on
+\emph on
a
-\emph default
+\emph default
rray
\begin_inset LatexCommand \index{FPGA (field programmable gate array)}
-\end_inset
+\end_inset
\begin_inset Quotes srd
-\end_inset
+\end_inset
or
\begin_inset LatexCommand \url{http://sf.net/projects/fpgac}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{FpgaC ((subset of) C to FPGA compiler)}
-\end_inset
+\end_inset
\begin_inset Quotes sld
-\end_inset
+\end_inset
have you ever heard of an open source compiler that compiles a subset of
C for an FPGA?
\begin_inset Quotes srd
-\end_inset
+\end_inset
we expect you to have a quick look there and come back.
If you read this you are on the right track.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
Some sections attribute more space to problems, restrictions and warnings
than to the solution.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
The installation section and the section about the debugger is intimidating.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
There are still lots of typos and there are more different writing styles
than pictures.
-\layout Section
+\end_layout
+\begin_layout Section
Testing the SDCC Compiler
\begin_inset LatexCommand \label{sec:Testing-the-SDCC}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
The first thing you should do after installing your SDCC compiler is to
see if it runs.
Type
-\family sans
-\series bold
+\family sans
+\series bold
"sdcc -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-version"
\begin_inset LatexCommand \index{version}
-\end_inset
+\end_inset
-\family default
-\series default
+\family default
+\series default
at the prompt, and the program should run and output its version like:
-\newline
+\newline
-\family typewriter
+\family typewriter
SDCC : mcs51/z80/avr/ds390/pic16/pic14/ds400/hc08 2.5.6 #4169 (May 8 2006)
(UNIX)
-\layout Standard
+\end_layout
+\begin_layout Standard
If it doesn't run, or gives a message about not finding sdcc program, then
you need to check over your installation.
Make sure that the sdcc bin directory is in your executable search path
defined by the PATH environment setting (
-\series medium
+\series medium
see
-\series default
+\series default
section
\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
-\series medium
+\series medium
Install trouble-shooting for suggestions
-\series default
+\series default
).
Make sure that the sdcc program is in the bin folder, if not perhaps something
did not install correctly.
-\newline
+\newline
-\newline
+\newline
-\series medium
+\series medium
SDCC
-\series default
+\series default
is commonly installed as described in section
\begin_inset Quotes sld
-\end_inset
+\end_inset
Install and search paths
\begin_inset Quotes srd
-\end_inset
+\end_inset
.
-\newline
+\newline
-\newline
+\newline
-\series medium
+\series medium
Make sure the compiler works on a very simple example.
Type in the following test.c program using your favorite
-\series default
+\series default
ASCII
-\series medium
+\series medium
editor:
-\layout Verse
+\end_layout
+\begin_layout Verse
-\family typewriter
+\family typewriter
char test;
-\newline
+\newline
-\newline
+\newline
void main(void) {
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
test=0;
-\newline
+\newline
}
-\layout Standard
+\end_layout
+\begin_layout Standard
-\series medium
+\series medium
Compile this using the following command:
-\family sans
-\series bold
+\family sans
+\series bold
"sdcc -c test.c".
-\family default
-\series default
+\family default
+\series default
-\series medium
+\series medium
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.
-\series default
+\series default
-\newline
+\newline
-\newline
+\newline
-\series medium
+\series medium
The next step is to try it with the linker.
Type in
-\family sans
-\series bold
+\family sans
+\series bold
"sdcc test.c
-\family default
-\series default
+\family default
+\series default
"
-\series medium
+\series medium
.
If all goes well the compiler will link with the libraries and produce
a test.ihx output file.
If this step fails
-\series default
+\series default
-\series medium
+\series medium
(no test.ihx, and the linker generates warnings), then the problem is most
likely that
-\series default
+\series default
SDCC
-\series medium
+\series medium
cannot find the
-\series default
+\series default
/
-\series medium
+\series medium
usr/local/share/sdcc/lib directory
-\series default
+\series default
-\series medium
+\series medium
(see
-\series default
+\series default
section
\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
-\series medium
+\series medium
Install trouble-shooting for suggestions).
-\series default
+\series default
-\newline
+\newline
-\newline
+\newline
-\series medium
+\series medium
The final test is to ensure
-\series default
+\series default
SDCC
-\series medium
+\series medium
can use the
-\series default
+\series default
standard
-\series medium
+\series medium
header files and libraries.
Edit test.c and change it to the following:
-\layout Verse
+\end_layout
+\begin_layout Verse
-\family typewriter
+\family typewriter
#include
-\newline
+\newline
-\newline
+\newline
char str1[10];
-\newline
+\newline
-\newline
+\newline
void main(void) {
-\newline
-\SpecialChar ~
-\SpecialChar ~
+\newline
+\InsetSpace ~
+\InsetSpace ~
strcpy(str1, "testing");
-\newline
+\newline
}
-\layout Standard
+\end_layout
+\begin_layout Standard
-\series medium
+\series medium
Compile this by typing
-\family sans
-\series bold
+\family sans
+\series bold
"sdcc test.c"
-\family default
-\series medium
+\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.
If it cannot find the string.h file, then the problem is that
-\series default
+\series default
SDCC
-\series medium
+\series medium
cannot find the /usr/local/share/sdcc/include directory
-\series default
+\series default
-\series medium
+\series medium
(see the
-\series default
+\series default
section
\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
-\series medium
+\series medium
Install trouble-shooting section for suggestions).
-\series default
+\series default
Use option
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-print-search-dirs
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-print-search-dirs}
-\end_inset
+\end_inset
to find exactly where SDCC is looking for the include and lib files.
-\layout Section
+\end_layout
+\begin_layout Section
Install Trouble-shooting
\begin_inset LatexCommand \label{sub:Install-Trouble-shooting}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Install trouble-shooting}
-\end_inset
+\end_inset
-\layout Subsection
+\end_layout
+\begin_layout Subsection
If SDCC does not build correctly
-\layout Standard
+\end_layout
+\begin_layout Standard
A thing to try is starting from scratch by unpacking the .tgz source package
again in an empty directory.
Configure it like:
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
+\family sans
+\series bold
./configure 2>&1 | tee configure.log
-\family default
-\series default
+\family default
+\series default
-\newline
+\newline
-\newline
+\newline
and build it like:
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
+\family sans
+\series bold
make 2>&1 | tee make.log
-\family default
-\series default
+\family default
+\series default
-\newline
+\newline
-\newline
+\newline
If anything goes wrong, you can review the log files to locate the problem.
Or a relevant part of this can be attached to an email that could be helpful
when requesting help from the mailing list.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
What the
\begin_inset Quotes sld
-\end_inset
+\end_inset
./configure
\begin_inset Quotes srd
-\end_inset
+\end_inset
does
-\layout Standard
+\end_layout
+\begin_layout Standard
The
\begin_inset Quotes sld
-\end_inset
+\end_inset
./configure
\begin_inset Quotes srd
-\end_inset
+\end_inset
command is a script that analyzes your system and performs some configuration
to ensure the source package compiles on your system.
It will take a few minutes to run, and will compile a few tests to determine
what compiler features are installed.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
What the
\begin_inset Quotes sld
-\end_inset
+\end_inset
make
\begin_inset Quotes srd
-\end_inset
+\end_inset
does
-\layout Standard
+\end_layout
+\begin_layout Standard
This runs the GNU make tool, which automatically compiles all the source
packages into the final installed binary executables.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
What the
\begin_inset Quotes sld
-\end_inset
+\end_inset
make install
\begin_inset Quotes erd
-\end_inset
+\end_inset
command does.
-\layout Standard
+\end_layout
+\begin_layout Standard
This will install the compiler, other executables libraries and include
files into the appropriate directories.
See sections
\begin_inset LatexCommand \ref{sub:Install-paths}
-\end_inset
+\end_inset
-,\SpecialChar ~
+,\InsetSpace ~
\begin_inset LatexCommand \ref{sub:Search-Paths}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
about install and search paths.
-\newline
-On most systems you will need super-user privileges to do this.
-\layout Section
+\newline
+On most systems you will need super-user privilege
+s to do this.
+\end_layout
+\begin_layout Section
Components of SDCC
-\layout Standard
+\end_layout
+\begin_layout Standard
SDCC is not just a compiler, but a collection of tools by various developers.
These include linkers, assemblers, simulators and other components.
Here is a summary of some of the components.
@@ -4665,815 +5209,884 @@ SDCC is not just a compiler, but a collection of tools by various developers.
which you can find in the source package in their respective directories.
As SDCC grows to include support for other processors, other packages from
various developers are included and may have their own sets of documentation.
-\newline
+\newline
-\newline
-You might want to look at the files which are installed in .
+\newline
+You
+ might want to look at the files which are installed in .
At the time of this writing, we find the following programs for gcc-builds:
-\newline
+\newline
+
-\newline
+\newline
In /bin:
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sdcc - The compiler.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sdcpp - The C preprocessor.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
asx8051 - The assembler for 8051 type processors.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
as-z80
-\series bold
+\series bold
,
-\series default
+\series default
as-gbz80 - The Z80 and GameBoy Z80 assemblers.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
aslink -The linker for 8051 type processors.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
link-z80
-\series bold
+\series bold
,
-\series default
+\series default
link-gbz80 - The Z80 and GameBoy Z80 linkers.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
s51 - The ucSim 8051 simulator.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sdcdb - The source debugger.
-\layout Itemize
+\end_layout
+\begin_layout Itemize
packihx - A tool to pack (compress) Intel hex files.
-\layout Standard
+\end_layout
+\begin_layout Standard
In /share/sdcc/include
-\layout Itemize
+\end_layout
+\begin_layout Itemize
the include files
-\layout Standard
+\end_layout
+\begin_layout Standard
In /share/sdcc/lib
-\layout Itemize
+\end_layout
+\begin_layout Itemize
the subdirs src and small, large, z80, gbz80 and ds390 with the precompiled
relocatables.
-\layout Standard
+\end_layout
+\begin_layout Standard
In /share/sdcc/doc
-\layout Itemize
+\end_layout
+\begin_layout Itemize
the documentation
-\layout Standard
+\end_layout
+\begin_layout Standard
As development for other processors proceeds, this list will expand to include
executables to support processors like AVR, PIC, etc.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
sdcc - The Compiler
-\layout Standard
+\end_layout
+\begin_layout Standard
This is the actual compiler, it in turn uses the c-preprocessor and invokes
the assembler and linkage editor.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
sdcpp - The C-Preprocessor
-\layout Standard
+\end_layout
+\begin_layout Standard
The preprocessor
\begin_inset LatexCommand \index{sdcpp (preprocessor)}
-\end_inset
+\end_inset
is a modified version of the GNU cpp
\begin_inset LatexCommand \index{cpp|see{sdcpp}}
-\end_inset
+\end_inset
preprocessor
\begin_inset LatexCommand \url{http://gcc.gnu.org/}
-\end_inset
+\end_inset
.
The C preprocessor is used to pull in #include sources, process #ifdef
statements, #defines and so on.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
as
-\emph on
+\emph on
xxxx
-\emph default
+\emph default
, aslink, link-
-\emph on
+\emph on
xxx
-\emph default
+\emph default
- The Assemblers and Linkage Editors
-\layout Standard
+\end_layout
+\begin_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 made some
enhancements and bug fixes for it to work properly with SDCC.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
s51 - The Simulator
-\layout Standard
+\end_layout
+\begin_layout Standard
S51
\begin_inset LatexCommand \index{s51}
-\end_inset
+\end_inset
is a freeware, opensource simulator developed by Daniel Drotos.
The simulator is built as part of the build process.
For more information visit Daniel's web site at:
\begin_inset LatexCommand \url{http://mazsola.iit.uni-miskolc.hu/~drdani/embedded/s51}
-\end_inset
+\end_inset
.
It currently supports the core mcs51, the Dallas DS80C390 and the Phillips
XA51 family.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
sdcdb - Source Level Debugger
-\layout Standard
+\end_layout
+\begin_layout Standard
SDCDB
\begin_inset LatexCommand \index{SDCDB (debugger)}
-\end_inset
+\end_inset
is the companion source level debugger.
More about SDCDB in section
\begin_inset LatexCommand \ref{cha:Debugging-with-SDCDB}
-\end_inset
+\end_inset
.
The current version of the debugger uses Daniel's Simulator S51
\begin_inset LatexCommand \index{s51}
-\end_inset
+\end_inset
, but can be easily changed to use other simulators.
-\layout Chapter
+\end_layout
+\begin_layout Chapter
Using SDCC
-\layout Section
+\end_layout
+\begin_layout Section
Compiling
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Single Source File Projects
-\layout Standard
+\end_layout
+\begin_layout Standard
For single source file 8051 projects the process is very simple.
Compile your programs with the following command
-\family sans
-\series bold
+\family sans
+\series bold
"sdcc sourcefile.c".
-\family default
-\series default
+\family default
+\series default
This will compile, assemble and link your source file.
Output files are as follows:
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.asm
\begin_inset LatexCommand \index{.asm}
-\end_inset
+\end_inset
- Assembler source
\begin_inset LatexCommand \index{Assembler source}
-\end_inset
+\end_inset
file created by the compiler
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.lst
\begin_inset LatexCommand \index{.lst}
-\end_inset
+\end_inset
- Assembler listing
\begin_inset LatexCommand \index{Assembler listing}
-\end_inset
+\end_inset
file created by the Assembler
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.rst
\begin_inset LatexCommand \index{.rst}
-\end_inset
+\end_inset
- Assembler listing
\begin_inset LatexCommand \index{Assembler listing}
-\end_inset
+\end_inset
file updated with linkedit information, created by linkage editor
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.sym
\begin_inset LatexCommand \index{.sym}
-\end_inset
+\end_inset
- symbol listing
\begin_inset LatexCommand \index{Symbol listing}
-\end_inset
+\end_inset
for the sourcefile, created by the assembler
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.rel
\begin_inset LatexCommand \index{.rel}
-\end_inset
+\end_inset
or sourcefile.o
\begin_inset LatexCommand \index{.o}
-\end_inset
+\end_inset
- Object file
\begin_inset LatexCommand \index{Object file}
-\end_inset
+\end_inset
created by the assembler, input to Linkage editor
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.map
\begin_inset LatexCommand \index{.map}
-\end_inset
+\end_inset
- The memory map
\begin_inset LatexCommand \index{Memory map}
-\end_inset
+\end_inset
for the load module, created by the Linker
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.mem
\begin_inset LatexCommand \index{.mem}
-\end_inset
+\end_inset
- A file with a summary of the memory usage
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.ihx
\begin_inset LatexCommand \index{.ihx}
-\end_inset
+\end_inset
- The load module in Intel hex format
\begin_inset LatexCommand \index{Intel hex format}
-\end_inset
+\end_inset
(you can select the Motorola S19 format
\begin_inset LatexCommand \index{Motorola S19 format}
-\end_inset
+\end_inset
with -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-out-fmt-s19
\begin_inset LatexCommand \index{-\/-out-fmt-s19}
-\end_inset
+\end_inset
.
If you need another format you might want to use
-\family sans
-\shape italic
+\family sans
+\shape italic
objdump
-\family default
-\shape default
+\family default
+\shape default
\begin_inset LatexCommand \index{objdump (tool)}
-\end_inset
+\end_inset
or
-\family sans
-\shape italic
+\family sans
+\shape italic
srecord
-\family default
-\shape default
+\family default
+\shape default
\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
-\end_inset
+\end_inset
).
Both formats are documented in the documentation of srecord
\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
-\end_inset
+\end_inset
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.adb
\begin_inset LatexCommand \index{.adb}
-\end_inset
+\end_inset
- An intermediate file containing debug information needed to create the
.cdb file (with -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-debug
\begin_inset LatexCommand \index{-\/-debug}
-\end_inset
+\end_inset
)
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.cdb
\begin_inset LatexCommand \index{.cdb}
-\end_inset
+\end_inset
- An optional file (with -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-debug) containing debug information.
The format is documented in cdbfileformat.pdf
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.
- (no extension)
\begin_inset LatexCommand \index{ (no extension)}
-\end_inset
+\end_inset
An optional AOMF or AOMF51
\begin_inset LatexCommand \index{AOMF, AOMF51}
-\end_inset
+\end_inset
\begin_inset LatexCommand \label{OMF file}
-\end_inset
+\end_inset
file containing debug information (generated with option -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-debug).
The (Intel)
-\emph on
+\emph on
a
-\emph default
+\emph default
bsolute
-\emph on
+\emph on
o
-\emph default
+\emph default
bject
-\emph on
+\emph on
m
-\emph default
+\emph default
odule
-\emph on
+\emph on
f
-\emph default
+\emph default
ormat is commonly used by third party tools (debuggers
\begin_inset LatexCommand \index{Debugger}
-\end_inset
+\end_inset
, simulators, emulators)
-\layout Itemize
+\end_layout
+\begin_layout Itemize
sourcefile.dump*
\begin_inset LatexCommand \index{.dump*}
-\end_inset
+\end_inset
- Dump file to debug the compiler it self (generated with option -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-dumpall) (see section
\begin_inset LatexCommand \ref{sub:Intermediate-Dump-Options}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
and section
\begin_inset LatexCommand \ref{sub:The-anatomy-of}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
\begin_inset Quotes sld
-\end_inset
+\end_inset
Anatomy of the compiler
\begin_inset Quotes srd
-\end_inset
+\end_inset
).
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Postprocessing the Intel Hex
\begin_inset LatexCommand \index{Intel hex format}
-\end_inset
+\end_inset
file
-\layout Standard
+\end_layout
+\begin_layout Standard
In most cases this won't be needed but the Intel Hex file
\begin_inset LatexCommand \index{.ihx}
-\end_inset
+\end_inset
which is generated by SDCC might include lines of varying length and the
addresses within the file are not guaranteed to be strictly ascending.
If your toolchain or a bootloader does not like this you can use the tool
-\family typewriter
+\family typewriter
packihx
-\family default
+\family default
\begin_inset LatexCommand \index{packihx (tool)}
-\end_inset
+\end_inset
which is part of the SDCC distribution:
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
+\family sans
+\series bold
packihx sourcefile.ihx >sourcefile.hex
-\family default
-\series default
+\family default
+\series default
-\newline
+\newline
-\newline
+\newline
The separately available
-\emph on
+\emph on
srecord
-\emph default
+\emph default
\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
-\end_inset
+\end_inset
package additionally allows to set undefined locations to a predefined
value, to insert checksums
\begin_inset LatexCommand \index{checksum}
-\end_inset
+\end_inset
of various flavours (crc, add, xor) and to perform other manipulations
(convert, split, crop, offset, ...).
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
-srec_cat\SpecialChar ~
-\SpecialChar ~
-sourcefile.ihx -intel\SpecialChar ~
-\SpecialChar ~
+\family sans
+\series bold
+srec_cat\InsetSpace ~
+\InsetSpace ~
+sourcefile.ihx -intel\InsetSpace ~
+\InsetSpace ~
-o sourcefile.hex -intel
-\newline
+\newline
-\newline
+\newline
-\family default
-\series default
+\family default
+\series default
An example for a more complex command line
\begin_inset Foot
-collapsed false
-
-\layout Standard
+status open
+\begin_layout Standard
the command backfills
\begin_inset LatexCommand \index{backfill unused memory}
-\end_inset
+\end_inset
unused memory with 0x12 and the overall 16 bit sum of the complete 64 kByte
block is zero.
If the program counter on an mcs51 runs wild the backfill pattern 0x12
will be interpreted as an
-\family typewriter
+\family typewriter
lcall
-\family default
+\family default
to address
-\family typewriter
+\family typewriter
0x1212
-\family default
+\family default
(where an emergency routine could sit).
-\end_inset
+\end_layout
+
+\end_inset
could look like:
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
-\size footnotesize
-srec_cat\SpecialChar ~
-sourcefile.ihx -intel\SpecialChar ~
-\SpecialChar ~
--fill 0x12 0x0000 0xfffe\SpecialChar ~
+\family sans
+\series bold
+\size footnotesize
+srec_cat\InsetSpace ~
+sourcefile.ihx -intel\InsetSpace ~
+\InsetSpace ~
+-fill 0x12 0x0000 0xfffe\InsetSpace ~
-little-endian-checksum-nega
-tive 0xfffe 0x02 0x02\SpecialChar ~
-\SpecialChar ~
+tive 0xfffe 0x02 0x02\InsetSpace ~
+\InsetSpace ~
-o sourcefile.hex -intel
-\size default
+\size default
-\newline
+\newline
-\newline
+\newline
-\family default
-\series default
+\family default
+\series default
The srecord package is available at
\begin_inset LatexCommand \url{http://sf.net/projects/srecord}
-\end_inset
+\end_inset
.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Projects with Multiple Source Files
-\layout Standard
+\end_layout
+\begin_layout Standard
SDCC can compile only ONE file at a time.
Let us for example assume that you have a project containing the following
files:
-\newline
+\newline
-\newline
+\newline
foo1.c (contains some functions)
-\newline
+\newline
foo2.c (contains some more functions)
-\newline
-foomain.c (contains more functions and the function main)
-\newline
+\newline
+foomai
+n.c (contains more functions and the function main)
+\newline
-\size footnotesize
+\size footnotesize
-\newline
+\newline
-\size default
+\size default
The first two files will need to be compiled separately with the commands:
-\size footnotesize
+\size footnotesize
-\size default
+\size default
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
-sdcc\SpecialChar ~
--c\SpecialChar ~
+\family sans
+\series bold
+sdcc\InsetSpace ~
+-c\InsetSpace ~
foo1.c
-\family default
-\series default
-\size footnotesize
+\family default
+\series default
+\size footnotesize
-\newline
+\newline
-\family sans
-\series bold
-\size default
-sdcc\SpecialChar ~
--c\SpecialChar ~
+\family sans
+\series bold
+\size default
+sdcc\InsetSpace ~
+-c\InsetSpace ~
foo2.c
-\family default
-\series default
+\family default
+\series default
-\newline
+\newline
-\newline
+\newline
Then compile the source file containing the
-\emph on
+\emph on
main()
-\emph default
+\emph default
function and link
\begin_inset LatexCommand \index{Linker}
-\end_inset
+\end_inset
the files together with the following command:
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
-sdcc\SpecialChar ~
-foomain.c\SpecialChar ~
-foo1.rel\SpecialChar ~
+\family sans
+\series bold
+sdcc\InsetSpace ~
+foomain.c\InsetSpace ~
+foo1.rel\InsetSpace ~
foo2.rel
-\family default
-\series default
+\family default
+\series default
\begin_inset LatexCommand \index{.rel}
-\end_inset
+\end_inset
-\newline
+\newline
-\newline
+\newline
Alternatively,
-\emph on
+\emph on
foomain.c
-\emph default
+\emph default
can be separately compiled as well:
-\family sans
-\series bold
+\family sans
+\series bold
-\newline
+\newline
-\newline
-sdcc\SpecialChar ~
--c\SpecialChar ~
+\newline
+sdcc\InsetSpace ~
+-c\InsetSpace ~
foomain.c
-\newline
+\newline
sdcc foomain.rel foo1.rel foo2.rel
-\newline
+\newline
-\newline
+\newline
-\family default
-\series default
+\family default
+\series default
The file containing the
-\emph on
+\emph on
main()
-\emph default
+\emph default
function
-\emph on
+\emph on
-\emph default
-\noun on
+\emph default
+\noun on
must
-\noun default
+\noun default
be the
-\noun on
+\noun on
first
-\noun default
+\noun default
file specified in the command line, since the linkage editor processes
file in the order they are presented to it.
The linker is invoked from SDCC using a script file with extension .lnk
\begin_inset LatexCommand \index{.lnk}
-\end_inset
+\end_inset
.
You can view this file to troubleshoot linking problems such as those arising
from missing libraries.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Projects with Additional Libraries
\begin_inset LatexCommand \index{Libraries}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
Some reusable routines may be compiled into a library, see the documentation
for the assembler and linkage editor (which are in /share/sdcc/doc)
for how to create a
-\emph on
+\emph on
.lib
\begin_inset LatexCommand \index{.lib}
-\end_inset
+\end_inset
-\emph default
+\emph default
library file.
Libraries created in this manner can be included in the command line.
Make sure you include the -L option to tell the linker where
to look for these files if they are not in the current directory.
Here is an example, assuming you have the source file
-\emph on
+\emph on
foomain.c
-\emph default
+\emph default
and a library
-\emph on
+\emph on
foolib.lib
-\emph default
+\emph default
in the directory
-\emph on
+\emph on
mylib
-\emph default
+\emph default
(if that is not the same as your current project):
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
+\family sans
+\series bold
sdcc foomain.c foolib.lib -L mylib
-\newline
+\newline
-\newline
+\newline
-\family default
-\series default
+\family default
+\series default
Note here that
-\emph on
+\emph on
mylib
-\emph default
+\emph default
must be an absolute path name.
-\newline
+\newline
-\newline
-The most efficient way to use libraries is to keep separate modules in separate
- source files.
+\newline
+The most efficient way to use libraries is
+ to keep separate modules in separate source files.
The lib file now should name all the modules.rel
\begin_inset LatexCommand \index{.rel}
-\end_inset
+\end_inset
files.
For an example see the standard library file
-\emph on
+\emph on
libsdcc.lib
-\emph default
+\emph default
in the directory /share/lib/small.
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Using sdcclib to Create and Manage Libraries
\begin_inset LatexCommand \index{sdcclib}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
Alternatively, instead of having a .rel file for each entry on the library
file as described in the preceding section, sdcclib can be used to embed
all the modules belonging to such library in the library file itself.
@@ -5482,248 +6095,282 @@ Alternatively, instead of having a .rel file for each entry on the library
Additionally, the packed library file contains an index of all include
modules and symbols that significantly speeds up the linking process.
To display a list of options supported by sdcclib type:
-\newline
+\newline
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcclib -?
\begin_inset LatexCommand \index{sdcclib}
-\end_inset
+\end_inset
-\newline
+\newline
-\newline
+\newline
-\family default
-\series default
+\family default
+\series default
To create a new library file, start by compiling all the required modules.
For example:
-\newline
+\newline
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcc -c _divsint.c
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcc -c _divuint.c
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcc -c _modsint.c
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcc -c _moduint.c
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcc -c _mulint.c
-\newline
+\newline
-\layout Standard
+\end_layout
+\begin_layout Standard
This will create files _divsint.rel, _divuint.rel, _modsint.rel, _moduint.rel,
and _mulint.rel.
The next step is to add the .rel files to the library file:
-\newline
+\newline
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcclib libint.lib _divsint.rel
-\family default
+\family default
\begin_inset LatexCommand \index{sdcclib}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcclib libint.lib _divuint.rel
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcclib libint.lib _modsint.rel
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcclib libint.lib _moduint.rel
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family sans
-\series bold
+\family sans
+\series bold
sdcclib libint.lib _mulint.rel
-\series default
+\series default
-\newline
+\newline
-\layout Standard
+\end_layout
+\begin_layout Standard
If the file already exists in the library, it will be replaced.
To see what modules and symbols are included in the library, options -s
and -m are available.
For example:
-\newline
+\newline
-\newline
+\newline
-\family sans
-\series bold
+\family sans
+\series bold
sdcclib -s libint.lib
-\family default
+\family default
\begin_inset LatexCommand \index{sdcclib}
-\end_inset
+\end_inset
-\newline
+\newline
-\family typewriter
-\series default
+\family typewriter
+\series default
_divsint.rel:
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__divsint_a_1_1
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__divsint_PARM_2
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__divsint
-\newline
+\newline
_divuint.rel:
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__divuint_a_1_1
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__divuint_PARM_2
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__divuint_reste_1_1
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__divuint_count_1_1
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__divuint
-\newline
+\newline
_modsint.rel:
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__modsint_a_1_1
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__modsint_PARM_2
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__modsint
-\newline
+\newline
_moduint.rel:
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__moduint_a_1_1
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__moduint_PARM_2
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__moduint_count_1_1
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__moduint
-\newline
+\newline
_mulint.rel:
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__mulint_PARM_2
-\layout Standard
+\end_layout
+\begin_layout Standard
-\family typewriter
+\family typewriter
__mulint
-\family default
-\series bold
+\family default
+\series bold
+
+\newline
-\newline
+\end_layout
-\layout Standard
-\added_space_bottom bigskip
+\begin_layout Standard
If the source files are compiled using -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-debug
\begin_inset LatexCommand \index{-\/-debug}
-\end_inset
+\end_inset
, the corresponding debug information file .adb will be include in the library
file as well.
@@ -5737,708 +6384,801 @@ status Collapsed
is embedded in the library file itself.
Library files created using sdcclib are used as described in the preceding
sections.
-\layout Section
+\begin_inset VSpace bigskip
+\end_inset
+
+\end_layout
+
+\begin_layout Section
Command Line Options
\begin_inset LatexCommand \index{Command Line Options}
-\end_inset
+\end_inset
-\layout Subsection
+\end_layout
+\begin_layout Subsection
Processor Selection Options
\begin_inset LatexCommand \index{Options processor selection}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Processor selection options}
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mmcs51
\begin_inset LatexCommand \index{-mmcs51}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Intel MCS51
\begin_inset LatexCommand \index{MCS51}
-\end_inset
+\end_inset
family of processors.
This is the default processor target.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mds390
\begin_inset LatexCommand \index{-mds390}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Dallas DS80C390
\begin_inset LatexCommand \index{DS80C390}
-\end_inset
+\end_inset
processor.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mds400
\begin_inset LatexCommand \index{-mds400}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Dallas DS80C400
\begin_inset LatexCommand \index{DS80C400}
-\end_inset
+\end_inset
processor.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mhc08
\begin_inset LatexCommand \index{-mhc08}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Freescale/Motorola HC08
\begin_inset LatexCommand \index{HC08}
-\end_inset
+\end_inset
family of processors.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mz80
\begin_inset LatexCommand \index{-mz80}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Zilog Z80
\begin_inset LatexCommand \index{Z80}
-\end_inset
+\end_inset
family of processors.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mgbz80
\begin_inset LatexCommand \index{-mgbz80}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the GameBoy Z80
\begin_inset LatexCommand \index{gbz80 (GameBoy Z80)}
-\end_inset
+\end_inset
processor (Not actively maintained).
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mavr
\begin_inset LatexCommand \index{-mavr}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Atmel AVR
\begin_inset LatexCommand \index{AVR}
-\end_inset
+\end_inset
processor (Not maintained, not complete).
AVR users should probably have a look at winavr
\begin_inset LatexCommand \url{http://sourceforge.net/projects/winavr}
-\end_inset
+\end_inset
or
\begin_inset LatexCommand \url{http://www.avrfreaks.net/index.php?name=PNphpBB2&file=index}
-\end_inset
+\end_inset
.
-\layout Comment
+\end_layout
+\begin_layout Standard
+\begin_inset Note Comment
+status collapsed
+
+\begin_layout Standard
I think it is fair to direct users there for now.
Open source is also about avoiding unnecessary work .
But I didn't find the 'official' link.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+
+\end_inset
+
+\end_layout
-\series bold
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
-mpic14
\begin_inset LatexCommand \index{-mpic14}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Microchip PIC 14
\begin_inset LatexCommand \index{PIC14}
-\end_inset
+\end_inset
-bit processors (p16f84 and variants.
In development, not complete).
-\layout Comment
+\end_layout
+\begin_layout Standard
+\begin_inset Note Comment
+status collapsed
+
+\begin_layout Standard
p16f627 p16f628 p16f84 p16f873 p16f877?
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\end_inset
-\series bold
+
+\end_layout
+
+\begin_layout List
+\labelwidthstring 00.00.0000
+
+\series bold
-mpic16
\begin_inset LatexCommand \index{-mpic16}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Microchip PIC 16
\begin_inset LatexCommand \index{PIC16}
-\end_inset
+\end_inset
-bit processors (p18f452 and variants.
In development, not complete).
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mtlcs900h
-\series default
+\series default
Generate code for the Toshiba TLCS-900H
\begin_inset LatexCommand \index{TLCS-900H}
-\end_inset
+\end_inset
processor (Not maintained, not complete).
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-mxa51
\begin_inset LatexCommand \index{-mxa51}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for the Phillips XA51
\begin_inset LatexCommand \index{XA51}
-\end_inset
+\end_inset
processor (Not maintained, not complete).
-\layout Subsection
+\end_layout
-Preprocessor Options
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+
+\begin_layout Subsection
+Preprocessor Options
\begin_inset LatexCommand \index{Options preprocessor}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Preprocessor options}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{sdcpp (preprocessor)}
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-I
\begin_inset LatexCommand \index{-I}
-\end_inset
+\end_inset
-\series default
+\series default
The additional location where the pre processor will look for <..h> or
\begin_inset Quotes eld
-\end_inset
+\end_inset
..h
\begin_inset Quotes erd
-\end_inset
+\end_inset
files.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-D
\begin_inset LatexCommand \index{-D}
-\end_inset
+\end_inset
-\series default
+\series default
Command line definition of macros.
Passed to the preprocessor.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-M
\begin_inset LatexCommand \index{-M}
-\end_inset
+\end_inset
-\series default
+\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
+\backslash
'-newline if it is long.
The list of rules is printed on standard output instead of the preprocessed
C program.
`-M' implies `-E
\begin_inset LatexCommand \index{-E}
-\end_inset
+\end_inset
'.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-C
\begin_inset LatexCommand \index{-C}
-\end_inset
+\end_inset
-\series default
+\series default
Tell the preprocessor not to discard comments.
Used with the `-E' option.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-MM
\begin_inset LatexCommand \index{-MM}
-\end_inset
+\end_inset
-\size large
-\bar under
+\size large
+\bar under
-\series default
-\size default
-\bar default
+\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
+\end_inset
file"'.
System header files included with `#include ' are omitted.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-Aquestion(answer)
\begin_inset LatexCommand \index{-Aquestion(answer)}
-\end_inset
+\end_inset
-\series default
+\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
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-Umacro
\begin_inset LatexCommand \index{-Umacro}
-\end_inset
+\end_inset
-\series default
+\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
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-dM
\begin_inset LatexCommand \index{-dM}
-\end_inset
+\end_inset
-\series default
+\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
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-dD
\begin_inset LatexCommand \index{-dD}
-\end_inset
+\end_inset
-\series default
+\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
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-dN
\begin_inset LatexCommand \index{-dN}
-\end_inset
+\end_inset
-\size large
-\bar under
+\size large
+\bar under
-\series default
-\size default
-\bar default
+\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 List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-pedantic-parse-number
\begin_inset LatexCommand \index{-pedantic-parse-number}
-\end_inset
+\end_inset
-\size large
-\bar under
+\size large
+\bar under
-\series default
-\size default
-\bar default
+\series default
+\size default
+\bar default
Pedentic parse numbers so that situations like 0xfe-LO_B(3) are parsed properly
and the macro LO_B(3) gets expanded.
See also #pragma pedantic_parse_number in section
\begin_inset LatexCommand \ref{sec:Pragmas}
-\end_inset
+\end_inset
-\emph on
+\emph on
Note: this functionality is not in conformance with standard!
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
--Wp\SpecialChar ~
+\series bold
+-Wp\InsetSpace ~
preprocessorOption[,preprocessorOption]
-\series default
+\series default
\begin_inset LatexCommand \index{-Wp preprocessorOption[,preprocessorOption]}
-\end_inset
+\end_inset
...
Pass the preprocessorOption to the preprocessor
-\family typewriter
+\family typewriter
sdcpp
-\family default
+\family default
\begin_inset LatexCommand \index{sdcpp (preprocessor)}
-\end_inset
+\end_inset
.
SDCC uses an adapted version of the preprocessor
-\emph on
+\emph on
cpp
-\emph default
+\emph default
of the GNU Compiler Collection
\begin_inset LatexCommand \index{gcc (GNU Compiler Collection)}
-\end_inset
+\end_inset
(
-\emph on
+\emph on
gcc
-\emph default
+\emph default
\begin_inset LatexCommand \url{http://gcc.gnu.org/}
-\end_inset
+\end_inset
-), if you need more dedicated options please refer to the GCC\SpecialChar ~
-4.1.1\SpecialChar ~
-CPP\SpecialChar ~
+), if you need more dedicated options please refer to the GCC\InsetSpace ~
+4.1.1\InsetSpace ~
+CPP\InsetSpace ~
Manual
at
\begin_inset LatexCommand \htmlurl{http://www.gnu.org/software/gcc/onlinedocs/}
-\end_inset
+\end_inset
.
-\layout Subsection
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+\end_layout
+
+\begin_layout Subsection
Linker Options
\begin_inset LatexCommand \index{Options linker}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Linker options}
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
--L\SpecialChar ~
+\series bold
+-L\InsetSpace ~
-
-\series default
+\series default
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-\series bold
+\series bold
-lib-path
\begin_inset LatexCommand \index{-\/-lib-path }
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{-L -\/-lib-path}
-\end_inset
+\end_inset
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
This option is passed to the linkage
editor's additional libraries
\begin_inset LatexCommand \index{Libraries}
-\end_inset
+\end_inset
search path.
The path name must be absolute.
Additional library files may be specified in the command line.
See section Compiling programs for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-xram-loc
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-xram-loc }
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
The start location of the external ram
\begin_inset LatexCommand \index{xdata (mcs51, ds390 storage class)}
-\end_inset
+\end_inset
, default value is 0.
The value entered can be in Hexadecimal or Decimal format, e.g.: -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-xram-loc 0x8000 or -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-xram-loc 32768.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-code-loc
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-code-loc }
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
The start location of the code
\begin_inset LatexCommand \index{code}
-\end_inset
+\end_inset
segment, default value 0.
Note when this option is used the interrupt vector table
\begin_inset LatexCommand \index{interrupt vector table}
-\end_inset
+\end_inset
is also relocated to the given address.
The value entered can be in Hexadecimal or Decimal format, e.g.: -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-code-loc 0x8000 or -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-code-loc 32768.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-loc
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-stack-loc }
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
By default the stack
\begin_inset LatexCommand \index{stack}
-\end_inset
+\end_inset
is placed after the data segment.
Using this option the stack can be placed anywhere in the internal memory
@@ -6446,23 +7186,29 @@ status Collapsed
The value entered can be in Hexadecimal or Decimal format, e.g.
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-loc 0x20 or -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-loc 32.
Since the sp register is incremented before a push or call, the initial
@@ -6471,79 +7217,89 @@ status Collapsed
register banks or the data segment and with enough space for the current
application.
The
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-pack-iram
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
\begin_inset LatexCommand \index{-\/-pack-iram}
-\end_inset
+\end_inset
option (which is now a default setting) will override this setting, so
you should also specify the
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-no-pack-iram
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
\begin_inset LatexCommand \index{-\/-no-pack-iram}
-\end_inset
+\end_inset
option if you need to manually place the stack.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-xstack-loc
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-xstack-loc }
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
By default the external stack
\begin_inset LatexCommand \index{xstack}
-\end_inset
+\end_inset
is placed after the pdata
\begin_inset LatexCommand \index{pdata (mcs51, ds390 storage class)}
-\end_inset
+\end_inset
segment.
Using this option the xstack can be placed anywhere in the external memory
@@ -6551,76 +7307,92 @@ status Collapsed
The value entered can be in Hexadecimal or Decimal format, e.g.
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-xstack-loc 0x8000 or -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-loc 32768.
The provided value should not overlap any other memory areas such as the
pdata or xdata segment and with enough space for the current application.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-data-loc
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-data-loc }
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
The start location of the internal ram data
\begin_inset LatexCommand \index{data (mcs51, ds390 storage class)}
-\end_inset
+\end_inset
segment.
The value entered can be in Hexadecimal or Decimal format, eg.
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-data-loc 0x20 or -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-data-loc 32.
(By default, the start location of the internal ram data segment is set
@@ -6629,622 +7401,720 @@ status Collapsed
For example if register banks 0 and 1 are used without bit variables, the
data segment will be set, if -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-data-loc is not used, to location 0x10.)
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-idata-loc
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-idata-loc }
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
The start location of the indirectly addressable internal ram
\begin_inset LatexCommand \index{idata (mcs51, ds390 storage class)}
-\end_inset
+\end_inset
of the 8051, default value is 0x80.
The value entered can be in Hexadecimal or Decimal format, eg.
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-idata-loc 0x88 or -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-idata-loc 136.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-bit-loc
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
The start location of the bit
\begin_inset LatexCommand \index{bit}
-\end_inset
+\end_inset
addressable internal ram of the 8051.
This is
-\emph on
+\emph on
not
-\emph default
+\emph default
implemented yet.
- Instead an option can be passed directly to the linker: -Wl\SpecialChar ~
+ Instead an option can be passed directly to the linker: -Wl\InsetSpace ~
-bBSEG=.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-out-fmt-ihx
\begin_inset LatexCommand \index{-\/-out-fmt-ihx}
-\end_inset
+\end_inset
-\bar under
+\bar under
-\series default
-\bar default
+\series default
+\bar default
The linker output (final object code) is in Intel Hex format.
\begin_inset LatexCommand \index{Intel hex format}
-\end_inset
+\end_inset
This is the default option.
The format itself is documented in the documentation of srecord
\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
-\end_inset
+\end_inset
.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-out-fmt-s19
\begin_inset LatexCommand \index{-\/-out-fmt-s19}
-\end_inset
+\end_inset
-\bar under
+\bar under
-\series default
-\bar default
+\series default
+\bar default
The linker output (final object code) is in Motorola S19 format
\begin_inset LatexCommand \index{Motorola S19 format}
-\end_inset
+\end_inset
.
The format itself is documented in the documentation of srecord.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-out-fmt-elf
\begin_inset LatexCommand \index{-\/-out-fmt-s19}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{HC08!Options!-\/-out-fmt-elf}
-\end_inset
+\end_inset
-\bar under
+\bar under
-\series default
-\bar default
+\series default
+\bar default
The linker output (final object code) is in ELF format
\begin_inset LatexCommand \index{ELF format}
-\end_inset
+\end_inset
.
(Currently only supported for the HC08
\begin_inset LatexCommand \index{HC08}
-\end_inset
+\end_inset
processors)
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
--Wl\SpecialChar ~
+\series bold
+-Wl\InsetSpace ~
linkOption[,linkOption]
-\series default
+\series default
\begin_inset LatexCommand \index{-Wl linkOption[,linkOption]}
-\end_inset
+\end_inset
...
Pass the linkOption to the linker.
If a bootloader is used an option like
\begin_inset Quotes sld
-\end_inset
+\end_inset
--Wl\SpecialChar ~
+-Wl\InsetSpace ~
-bCSEG=0x1000
\begin_inset Quotes srd
-\end_inset
+\end_inset
would be typical to set the start of the code segment.
See also #pragma constseg and #pragma codeseg in section
\begin_inset LatexCommand \ref{sec:Pragmas}
-\end_inset
+\end_inset
.
File sdcc/as/doc/asxhtm.html has more on linker options.
-\layout Subsection
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+\begin_layout Subsection
MCS51 Options
\begin_inset LatexCommand \index{Options MCS51}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{MCS51 options}
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-model-small
\begin_inset LatexCommand \index{-\/-model-small}
-\end_inset
+\end_inset
-\series default
-\size large
-\emph on
+\series default
+\size large
+\emph on
-\size default
-\emph default
+\size default
+\emph default
Generate code for Small Model programs, see section Memory Models for more
details.
This is the default model.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-model-medium
\begin_inset LatexCommand \index{-\/-model-medium}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for Medium model programs, see section Memory Models for
more details.
If this option is used all source files in the project have to be compiled
with this option.
It must also be used when invoking the linker.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-model-large
\begin_inset LatexCommand \index{-\/-model-large}
-\end_inset
+\end_inset
-\series default
+\series default
Generate code for Large model programs, see section Memory Models for more
details.
If this option is used all source files in the project have to be compiled
with this option.
It must also be used when invoking the linker.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-xstack
\begin_inset LatexCommand \index{-\/-xstack}
-\end_inset
+\end_inset
-\series default
+\series default
Uses a pseudo stack in the pdata
\begin_inset LatexCommand \index{pdata (mcs51, ds390 storage class)}
-\end_inset
+\end_inset
area (usually the first 256 bytes in the external ram) for allocating variables
and passing parameters.
See section
\begin_inset LatexCommand \ref{sub:External-Stack}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
External Stack for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-iram-size
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
\begin_inset LatexCommand \index{-\/-iram-size }
-\end_inset
+\end_inset
Causes the linker to check if the internal ram usage is within limits of
the given value.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-xram-size
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
\begin_inset LatexCommand \index{-\/-xram-size }
-\end_inset
+\end_inset
Causes the linker to check if the external ram usage is within limits of
the given value.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-code-size
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
\begin_inset LatexCommand \index{-\/-code-size }
-\end_inset
+\end_inset
Causes the linker to check if the code memory usage is within limits of
the given value.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-size
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
\begin_inset LatexCommand \index{-\/-stack-size }
-\end_inset
+\end_inset
Causes the linker to check if there is at minimum bytes for stack.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-pack-iram
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
\begin_inset LatexCommand \index{-\/-pack-iram}
-\end_inset
+\end_inset
Causes the linker to use unused register banks for data variables and pack
data, idata and stack together.
This is the default now.
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-no-pack-iram
-\series default
-\SpecialChar ~
+\series default
+\InsetSpace ~
\begin_inset LatexCommand \index{-\/-no-pack-iram}
-\end_inset
+\end_inset
Causes the linker to use old style for allocating memory areas.
-\layout Subsection
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+\end_layout
+
+\begin_layout Subsection
DS390 / DS400 Options
\begin_inset LatexCommand \index{Options DS390}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{DS390}
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-model-flat24
-\series default
+\series default
\begin_inset LatexCommand \index{DS390!Options!-\/-model-flat24}
-\end_inset
+\end_inset
-\size large
-\emph on
+\size large
+\emph on
-\size default
-\emph default
+\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
-\emph on
+\emph on
-mds390
-\emph default
+\emph default
.
See section Memory Models for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-protect-sp-update
\begin_inset LatexCommand \index{DS390!Options!-\/-protect-sp-update}
-\end_inset
+\end_inset
-\series default
+\series default
disable interrupts during ESP:SP updates.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-10bit
-\series default
+\series default
\begin_inset LatexCommand \index{DS390!Options!-\/-stack-10bit}
-\end_inset
+\end_inset
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
-\emph on
+\emph on
-mds390
-\emph default
+\emph default
.
In this mode, the stack is located in the lower 1K of the internal RAM,
which is mapped to 0x400000.
@@ -7259,796 +8129,919 @@ status Collapsed
It is important to ensure that the processor is in this mode before calling
any re-entrant functions compiled with this option.
In principle, this should work with the
-\emph on
+\emph on
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-auto
\begin_inset LatexCommand \index{-\/-stack-auto}
-\end_inset
+\end_inset
-\emph default
+\emph default
option, but that has not been tested.
It is incompatible with the
-\emph on
+\emph on
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-xstack
\begin_inset LatexCommand \index{-\/-xstack}
-\end_inset
+\end_inset
-\emph default
+\emph default
option.
It also only makes sense if the processor is in 24 bit contiguous addressing
mode (see the
-\emph on
+\emph on
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-model-flat24 option
-\emph default
+\emph default
).
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-probe
\begin_inset LatexCommand \index{DS390!Options!-\/-stack-probe}
-\end_inset
+\end_inset
-\series default
+\series default
insert call to function __stack_probe at each function prologue.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-tini-libid
\begin_inset LatexCommand \index{DS390!Options!-\/-tini-libid}
-\end_inset
+\end_inset
-\series default
+\series default
LibraryID used in -mTININative.
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-use-accelerator
\begin_inset LatexCommand \index{DS390!Options!-\/-use-accelerator}
-\end_inset
+\end_inset
-\series default
+\series default
generate code for DS390 Arithmetic Accelerator.
-\layout Subsection
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+\end_layout
+
+\begin_layout Subsection
Z80 Options
\begin_inset LatexCommand \index{Options Z80}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Z80}
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-callee-saves-bc
-\series default
+\series default
\begin_inset LatexCommand \index{Z80!Options!-\/-callee-saves-bc}
-\end_inset
+\end_inset
-\size large
-\emph on
+\size large
+\emph on
-\size default
-\emph default
+\size default
+\emph default
Force a called function to always save BC.
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-no-std-crt0
-\series default
+\series default
\begin_inset LatexCommand \index{Z80!Options!-\/-no-std-crt0}
-\end_inset
+\end_inset
When linking, skip the standard crt0.o object file.
You must provide your own crt0.o for your system when linking.
-\layout Subsection
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+
+\end_layout
+\begin_layout Subsection
Optimization Options
\begin_inset LatexCommand \index{Options optimization}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Optimization options}
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-nogcse
\begin_inset LatexCommand \index{-\/-nogcse}
-\end_inset
+\end_inset
-\series default
+\series default
Will not do global subexpression elimination, this option may be used when
the compiler creates undesirably large stack/data spaces to store compiler
temporaries (
-\emph on
+\emph on
s
-\emph default
+\emph default
pill
-\emph on
+\emph on
loc
-\emph default
+\emph default
ations, sloc
\begin_inset LatexCommand \index{sloc (spill location)}
-\end_inset
+\end_inset
).
A warning message will be generated when this happens and the compiler
will indicate the number of extra bytes it allocated.
- It is recommended that this option NOT be used, #pragma\SpecialChar ~
+ It is recommended that this option NOT be used, #pragma\InsetSpace ~
nogcse
\begin_inset LatexCommand \index{\#pragma nogcse}
-\end_inset
+\end_inset
can be used to turn off global subexpression elimination
\begin_inset LatexCommand \index{Subexpression elimination}
-\end_inset
+\end_inset
for a given function only.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-noinvariant
\begin_inset LatexCommand \index{-\/-noinvariant}
-\end_inset
+\end_inset
-\series default
+\series default
Will not do loop invariant optimizations, this may be turned off for reasons
explained for the previous option.
For more details of loop optimizations performed see Loop Invariants in
section
\begin_inset LatexCommand \ref{sub:Loop-Optimizations}
-\end_inset
+\end_inset
.
- It is recommended that this option NOT be used, #pragma\SpecialChar ~
+ It is recommended that this option NOT be used, #pragma\InsetSpace ~
noinvariant
\begin_inset LatexCommand \index{\#pragma noinvariant}
-\end_inset
+\end_inset
can be used to turn off invariant optimizations for a given function only.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-noinduction
\begin_inset LatexCommand \index{-\/-noinduction}
-\end_inset
+\end_inset
-\series default
+\series default
Will not do loop induction optimizations, see section strength reduction
for more details.
- It is recommended that this option is NOT used, #pragma\SpecialChar ~
+ It is recommended that this option is NOT used, #pragma\InsetSpace ~
noinduction
\begin_inset LatexCommand \index{\#pragma noinduction}
-\end_inset
+\end_inset
can be used to turn off induction optimizations for a given function only.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-nojtbound
\begin_inset LatexCommand \index{-\/-nojtbound}
-\end_inset
+\end_inset
-\size large
-\bar under
+\size large
+\bar under
-\series default
-\size default
-\bar default
+\series default
+\size default
+\bar default
Will not generate boundary condition check when switch statements
\begin_inset LatexCommand \index{switch statement}
-\end_inset
+\end_inset
are implemented using jump-tables.
See section
\begin_inset LatexCommand \ref{sub:'switch'-Statements}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
Switch Statements for more details.
- It is recommended that this option is NOT used, #pragma\SpecialChar ~
+ It is recommended that this option is NOT used, #pragma\InsetSpace ~
nojtbound
\begin_inset LatexCommand \index{\#pragma nojtbound}
-\end_inset
+\end_inset
can be used to turn off boundary checking for jump tables for a given function
only.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-noloopreverse
\begin_inset LatexCommand \index{-\/-noloopreverse}
-\end_inset
+\end_inset
-\series default
-\size large
+\series default
+\size large
-\size default
+\size default
Will not do loop reversal
\begin_inset LatexCommand \index{Loop reversing}
-\end_inset
+\end_inset
optimization.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-
-\series bold
+\series bold
nolabelopt
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-nolabelopt }
-\end_inset
+\end_inset
Will not optimize labels (makes the dumpfiles more readable).
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-no-xinit-opt
\begin_inset LatexCommand \index{-\/-no-xinit-opt}
-\end_inset
+\end_inset
-\series default
+\series default
Will not memcpy initialized data from code space into xdata space.
This saves a few bytes in code space if you don't have initialized data
\begin_inset LatexCommand \index{Variable initialization}
-\end_inset
+\end_inset
.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-nooverlay
\begin_inset LatexCommand \index{-\/-nooverlay}
-\end_inset
+\end_inset
-\series default
+\series default
The compiler will not overlay parameters and local variables of any function,
see section Parameters and local variables for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-no-peep
\begin_inset LatexCommand \index{-\/-no-peep}
-\end_inset
+\end_inset
-\series default
+\series default
Disable peep-hole optimization with built-in rules.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-peep-file
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-peep-file}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
This option can be used to use additional rules to be used by
the peep hole optimizer.
See section
\begin_inset LatexCommand \ref{sub:Peephole-Optimizer}
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
Peep Hole optimizations for details on how to write these rules.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-peep-asm
\begin_inset LatexCommand \index{-\/-peep-asm}
-\end_inset
+\end_inset
-\series default
+\series default
Pass the inline assembler code through the peep hole optimizer.
This can cause unexpected changes to inline assembler code, please go through
the peephole optimizer
\begin_inset LatexCommand \index{Peephole optimizer}
-\end_inset
+\end_inset
rules defined in the source file tree '/peeph.def' before using
this option.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-opt-code-speed
\begin_inset LatexCommand \index{-\/-opt-code-speed}
-\end_inset
+\end_inset
-\series default
+\series default
The compiler will optimize code generation towards fast code, possibly
at the expense of code size.
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-opt-code-size
\begin_inset LatexCommand \index{-\/-opt-code-size}
-\end_inset
+\end_inset
-\series default
+\series default
The compiler will optimize code generation towards compact code, possibly
at the expense of code speed.
-\layout Subsection
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+\end_layout
+
+\begin_layout Subsection
Other Options
\begin_inset LatexCommand \index{Options other}
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
--c\SpecialChar ~
+\series bold
+-c\InsetSpace ~
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-compile-only
\begin_inset LatexCommand \index{-\/-compile-only}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{-c -\/-compile-only}
-\end_inset
+\end_inset
-\series default
+\series default
will compile and assemble the source, but will not call the linkage editor.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
-\series default
+\series default
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-\series bold
+\series bold
-c1mode
\begin_inset LatexCommand \index{-\/-c1mode}
-\end_inset
+\end_inset
-\series default
+\series default
reads the preprocessed source from standard input and compiles it.
The file name for the assembler output must be specified using the -o option.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-E
\begin_inset LatexCommand \index{-E}
-\end_inset
+\end_inset
-\series default
+\series default
Run only the C preprocessor.
Preprocess all the C source files specified and output the results to standard
output.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
--o\SpecialChar ~
+\series bold
+-o\InsetSpace ~
\begin_inset LatexCommand \index{-o }
-\end_inset
+\end_inset
-\series default
+\series default
The output path resp.
file where everything will be placed.
If the parameter is a path, it must have a trailing slash (or backslash
for the Windows binaries) to be recognized as a path.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-stack-auto
\begin_inset LatexCommand \index{-\/-stack-auto}
-\end_inset
+\end_inset
-\series default
-\size large
-\emph on
+\series default
+\size large
+\emph on
-\size default
-\emph default
+\size default
+\emph default
All functions in the source file will be compiled as
-\emph on
+\emph on
reentrant
-\emph default
+\emph default
\begin_inset LatexCommand \index{reentrant}
-\end_inset
+\end_inset
, i.e.
the parameters and local variables will be allocated on the stack
\begin_inset LatexCommand \index{stack}
-\end_inset
+\end_inset
.
See section
\begin_inset LatexCommand \ref{sec:Parameters-and-Local-Variables}
-\end_inset
+\end_inset
Parameters and Local Variables for more details.
If this option is used all source files in the project should be compiled
with this option.
It automatically implies --int-long-reent and --float-reent.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-callee-saves
\begin_inset LatexCommand \index{-\/-callee-saves}
-\end_inset
+\end_inset
function1[,function2][,function3]....
-\series default
+\series default
The compiler by default uses a caller saves convention for register saving
across function calls, however this can cause unnecessary register pushing
& popping when calling small functions from larger functions.
@@ -8056,23 +9049,23 @@ status Collapsed
function names specified.
The compiler will not save registers when calling these functions, no extra
code will be generated at the entry & exit (function prologue
-\series bold
+\series bold
\begin_inset LatexCommand \index{function prologue}
-\end_inset
+\end_inset
-\series default
+\series default
& epilogue
-\series bold
+\series bold
\begin_inset LatexCommand \index{function epilogue}
-\end_inset
+\end_inset
-\series default
+\series default
) 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.
@@ -8084,47 +9077,54 @@ status Collapsed
If the project consists of multiple source files then all the source file
should be compiled with the same -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-callee-saves option string.
- Also see #pragma\SpecialChar ~
+ Also see #pragma\InsetSpace ~
callee_saves
\begin_inset LatexCommand \index{\#pragma callee\_saves}
-\end_inset
+\end_inset
.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-debug
\begin_inset LatexCommand \index{-\/-debug}
-\end_inset
+\end_inset
-\bar under
+\bar under
-\series default
-\bar default
+\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.
@@ -8132,147 +9132,164 @@ When this option is used the compiler will generate debug information.
Another file with no extension contains debug information in AOMF or AOMF51
\begin_inset LatexCommand \index{AOMF, AOMF51}
-\end_inset
+\end_inset
format which is commonly used by third party tools.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-S
\begin_inset LatexCommand \index{-S}
-\end_inset
+\end_inset
-\size large
-\bar under
+\size large
+\bar under
-\series default
-\size default
-\bar default
+\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.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-int-long-reent
\begin_inset LatexCommand \index{-\/-int-long-reent}
-\end_inset
+\end_inset
-\series default
+\series default
Integer (16 bit) and long (32 bit) libraries have been compiled as reentrant.
Note by default these libraries are compiled as non-reentrant.
See section Installation for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-cyclomatic
\begin_inset LatexCommand \index{-\/-cyclomatic}
-\end_inset
+\end_inset
-\bar under
+\bar under
-\series default
-\bar default
+\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
-\emph on
+\emph on
important
-\emph default
+\emph default
information about the function.
The number of edges and nodes the compiler detected in the control flow
graph of the function, and most importantly the
-\emph on
+\emph on
cyclomatic complexity
\begin_inset LatexCommand \index{Cyclomatic complexity}
-\end_inset
+\end_inset
-\emph default
+\emph default
see section on Cyclomatic Complexity for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-float-reent
\begin_inset LatexCommand \index{-\/-float-reent}
-\end_inset
+\end_inset
-\series default
+\series default
Floating point library is compiled as reentrant
\begin_inset LatexCommand \index{reentrant}
-\end_inset
+\end_inset
.
See section Installation for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-main-return
\begin_inset LatexCommand \index{-\/-main-return}
-\end_inset
+\end_inset
-\series default
+\series default
This option can be used if the code generated is called by a monitor program
or if the main routine includes an endless loop.
This option results in slightly smaller code and saves two bytes of stack
@@ -8280,457 +9297,523 @@ status Collapsed
The return from the 'main'
\begin_inset LatexCommand \index{main return}
-\end_inset
+\end_inset
function will return to the function calling main.
The default setting is to lock up i.e.
generate a '
-\family typewriter
+\family typewriter
sjmp .
-\family default
+\family default
'.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-nostdinc
\begin_inset LatexCommand \index{-\/-nostdinc}
-\end_inset
+\end_inset
-\series default
+\series default
This will prevent the compiler from passing on the default include path
to the preprocessor.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-nostdlib
\begin_inset LatexCommand \index{-\/-nostdlib}
-\end_inset
+\end_inset
-\series default
+\series default
This will prevent the compiler from passing on the default library
\begin_inset LatexCommand \index{Libraries}
-\end_inset
+\end_inset
path to the linker.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-verbose
\begin_inset LatexCommand \index{-\/-verbose}
-\end_inset
+\end_inset
-\series default
+\series default
Shows the various actions the compiler is performing.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-V
\begin_inset LatexCommand \index{-V}
-\end_inset
+\end_inset
-\series default
+\series default
Shows the actual commands the compiler is executing.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-no-c-code-in-asm
\begin_inset LatexCommand \index{-\/-no-c-code-in-asm}
-\end_inset
+\end_inset
-\series default
+\series default
Hides your ugly and inefficient c-code from the asm file, so you can always
blame the compiler :)
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-no-peep-comments
\begin_inset LatexCommand \index{-\/-no-peep-comments}
-\end_inset
+\end_inset
-\series default
+\series default
Will not include peep-hole comments in the generated files.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-i-code-in-asm
\begin_inset LatexCommand \index{-\/-i-code-in-asm}
-\end_inset
+\end_inset
-\series default
+\series default
Include i-codes in the asm file.
Sounds like noise but is most helpful for debugging the compiler itself.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-less-pedantic
\begin_inset LatexCommand \index{-\/-less-pedantic}
-\end_inset
+\end_inset
-\series default
+\series default
Disable some of the more pedantic warnings
\begin_inset LatexCommand \index{Warnings}
-\end_inset
+\end_inset
(jwk burps: please be more specific here, please!).
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
--disable-warning\SpecialChar ~
+-disable-warning\InsetSpace ~
\begin_inset LatexCommand \index{-\/-disable-warning}
-\end_inset
+\end_inset
-\series default
+\series default
Disable specific warning with number .
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-print-search-dirs
\begin_inset LatexCommand \index{-\/-print-search-dirs}
-\end_inset
+\end_inset
-\series default
+\series default
Display the directories in the compiler's search path
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-vc
\begin_inset LatexCommand \index{-\/-vc}
-\end_inset
+\end_inset
-\series default
+\series default
Display errors and warnings using MSVC style, so you can use SDCC with
the visual studio IDE
\begin_inset LatexCommand \index{IDE}
-\end_inset
+\end_inset
.
With SDCC both offering a GCC-like (the default) and a MSVC-like
\begin_inset LatexCommand \index{MSVC output style}
-\end_inset
+\end_inset
output style, integration into most programming editors should be straightforwa
rd.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-use-stdout
\begin_inset LatexCommand \index{-\/-use-stdout}
-\end_inset
+\end_inset
-\series default
+\series default
Send errors and warnings to stdout instead of stderr.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
--Wa\SpecialChar ~
+\series bold
+-Wa\InsetSpace ~
asmOption[,asmOption]
-\series default
+\series default
\begin_inset LatexCommand \index{-Wa asmOption[,asmOption]}
-\end_inset
+\end_inset
...
Pass the asmOption to the assembler
\begin_inset LatexCommand \index{Options assembler}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Assembler options}
-\end_inset
+\end_inset
.
See file sdcc/as/doc/asxhtm.html for assembler options.cd
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-std-sdcc89
\begin_inset LatexCommand \index{-\/-std-sdcc89}
-\end_inset
+\end_inset
-\series default
+\series default
Generally follow the C89 standard, but allow SDCC features that conflict
with the standard (default).
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-std-c89
\begin_inset LatexCommand \index{-\/-std-c89}
-\end_inset
+\end_inset
-\series default
+\series default
Follow the C89 standard and disable SDCC features that conflict with the
standard.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-std-sdcc99
\begin_inset LatexCommand \index{-\/-std-sdcc99}
-\end_inset
+\end_inset
-\series default
+\series default
Generally follow the C99 standard, but allow SDCC features that conflict
with the standard (incomplete support).
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-std-c99
\begin_inset LatexCommand \index{-\/-std-sdcc99}
-\end_inset
+\end_inset
-\series default
+\series default
Follow the C99 standard and disable SDCC features that conflict with the
standard (incomplete support).
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-codeseg
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-codeseg }
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
The name to be used for the code
\begin_inset LatexCommand \index{code}
-\end_inset
+\end_inset
segment, default CSEG.
This is useful if you need to tell the compiler to put the code in a special
@@ -8738,33 +9821,37 @@ status Collapsed
place in memory.
Can be used for instance when using bank switching to put the code in a
bank.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-constseg
-\series default
+\series default
\begin_inset LatexCommand \index{-\/-constseg }
-\end_inset
+\end_inset
-\SpecialChar ~
+\InsetSpace ~
The name to be used for the const
\begin_inset LatexCommand \index{code}
-\end_inset
+\end_inset
segment, default CONST.
This is useful if you need to tell the compiler to put the const data in
@@ -8772,901 +9859,1009 @@ status Collapsed
in a special place in memory.
Can be used for instance when using bank switching to put the const data
in a bank.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-fdollars-in-identifiers
\begin_inset LatexCommand \index{-\/-fdollars-in-identifiers}
-\end_inset
+\end_inset
-\series default
+\series default
Permit '$' as an identifier character
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
more-pedantic
-\series default
+\series default
Actually this is
-\series bold
-\emph on
+\series bold
+\emph on
not
-\series default
-\emph default
+\series default
+\emph default
a SDCC compiler option but if you want
-\emph on
+\emph on
more
-\emph default
+\emph default
warnings you can use a separate tool dedicated to syntax checking like
splint
\begin_inset LatexCommand \label{lyx:more-pedantic-SPLINT}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{lint (syntax checking tool)}
-\end_inset
+\end_inset
\begin_inset LatexCommand \url{http://www.splint.org}
-\end_inset
+\end_inset
.
To make your source files parseable by splint you will have to include
-\family sans
+\family sans
lint.h
-\family default
+\family default
\begin_inset LatexCommand \index{splint (syntax checking tool)}
-\end_inset
+\end_inset
in your source file and add brackets around extended keywords (like
-\family sans
+\family sans
\begin_inset Quotes sld
-\end_inset
+\end_inset
-__at\SpecialChar ~
+__at\InsetSpace ~
-\series bold
+\series bold
(
-\series default
+\series default
0xab
-\series bold
+\series bold
)
-\series default
+\series default
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\family default
+\family default
and
-\family sans
+\family sans
\begin_inset Quotes sld
-\end_inset
+\end_inset
-__interrupt\SpecialChar ~
+__interrupt\InsetSpace ~
(2)
\begin_inset Quotes srd
-\end_inset
+\end_inset
-\family default
+\family default
).
-\newline
+\newline
Splint has an excellent on line manual at
\begin_inset LatexCommand \url{http://www.splint.org/manual/}
-\end_inset
+\end_inset
and it's capabilities go beyond pure syntax checking.
You'll need to tell splint the location of SDCC's include files so a typical
command line could look like this:
-\newline
+\newline
-\family sans
-splint\SpecialChar ~
--I\SpecialChar ~
-/usr/local/share/sdcc/include/mcs51/\SpecialChar ~
-\SpecialChar ~
+\family sans
+splint\InsetSpace ~
+-I\InsetSpace ~
+/usr/local/share/sdcc/include/mcs51/\InsetSpace ~
+\InsetSpace ~
myprogram.c
-\layout Subsection
+\end_layout
+
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
+
+\end_layout
+
+\begin_layout Subsection
Intermediate Dump Options
\begin_inset LatexCommand \label{sub:Intermediate-Dump-Options}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Options intermediate dump}
-\end_inset
+\end_inset
\begin_inset LatexCommand \index{Intermediate dump options}
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
+\begin_layout Standard
The following options are provided for the purpose of retargetting and debugging
the compiler.
They provide a means to dump the intermediate code (iCode
\begin_inset LatexCommand \index{iCode}
-\end_inset
+\end_inset
) generated by the compiler in human readable form at various stages of
the compilation process.
More on iCodes see chapter
\begin_inset LatexCommand \ref{sub:The-anatomy-of}
-\end_inset
+\end_inset
\begin_inset Quotes srd
-\end_inset
+\end_inset
The anatomy of the compiler
\begin_inset Quotes srd
-\end_inset
+\end_inset
.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+
+\end_inset
-dumpraw
\begin_inset LatexCommand \index{-\/-dumpraw}
-\end_inset
+\end_inset
-\series default
+\series default
This option will cause the compiler to dump the intermediate code into
a file of named
-\emph on
+\emph on