X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=doc%2Fsdccman.lyx;h=6dccfe527bb66ee2b59f7cc56f4ec566aebe4d42;hb=80972b2e54c9b88f11c27b878874fd2a6a681391;hp=86817c15dfbaaa6884ab018ba571741d414e4eb1;hpb=48f3534d77a08a1a8307a51ccb3e65c3bb656a08;p=fw%2Fsdcc
diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx
index 86817c15..6dccfe52 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.5.7 created this file. For more info see http://www.lyx.org/
+\lyxformat 276
+\begin_document
+\begin_header
\textclass book
\begin_preamble
\pdfoptionpdfminorversion=3
@@ -7,7 +9,7 @@
pdftitle={SDCC Compiler User Guide},
pdfauthor={SDCC development team},
pdfsubject={installation, user manual},
- pdfkeywords={68hc08 8032 8051 ansi c compiler assembler CPU DS390 embedded development free Floating Point Arithmetic Freescale GPL HC08 inline Intel ISO/IEC 9899:1990 Linux MAC OS X manual Maxim mcs51 Microchip microcontroller open source PIC Unix Windows Z80 Zilog},
+ pdfkeywords={68hc08 8032 8051 ansi c compiler assembler CPU DS390 embedded development free Floating Point Arithmetic Freescale GPL HC08 inline Intel ISO/IEC 9899:1990 Linux MAC OS X manual Maxim mcs51 Microchip microcontroller open source PIC Unix Windows Z80 Zilog},
pdfpagemode=UseOutlines,
colorlinks=true,
linkcolor=blue] {hyperref}
@@ -20,16 +22,23 @@
\end_preamble
\language english
\inputencoding default
-\fontscheme pslatex
+\font_roman times
+\font_sans helvet
+\font_typewriter courier
+\font_default_family default
+\font_sc false
+\font_osf false
+\font_sf_scale 100
+\font_tt_scale 100
\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
+\use_esint 0
+\cite_engine basic
+\use_bibtopic false
\paperorientation portrait
\leftmargin 30mm
\topmargin 20mm
@@ -40,105 +49,142 @@
\paragraph_separation indent
\defskip medskip
\quotes_language swedish
-\quotes_times 2
\papercolumns 1
\papersides 1
\paperpagestyle fancy
+\tracking_changes false
+\output_changes false
+\author ""
+\author ""
+\end_header
-\layout Comment
+\begin_body
+\begin_layout Standard
+\begin_inset Note Note
+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.
+ three consecutive dashes would otherwise 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
-into seperate sections/chapters/appendices (it is hard to document PIC or
+\begin_layout Standard
+into separate 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
-SDCC 2.6.2
-\size footnotesize
+\size normal
+SDCC 2.8.7
+\size footnotesize
-\newline
-$Date$
-\newline
-$Revision$
-\layout Comment
+\newline
+$Date: 2008-11-16#$
+\newline
+$Revision: 5272$
+\end_layout
+\begin_layout Standard
+\begin_inset Note Note
+status collapsed
+
+\begin_layout Standard
The above strings enclosed in $ are automatically updated by Subversion
-\layout Standard
+\end_layout
+
+\end_inset
+
+\end_layout
-\begin_inset LatexCommand \tableofcontents{}
+\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
-ompiler) is an open source, retargettable, optimizing ANSI-C compiler by
-
-\series bold
+\emph default
+ompiler) is free open source, retargettable, optimizing ANSI-C compiler
+ by
+\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}
+\begin_inset LatexCommand index
+name "8031, 8032, 8051, 8052, mcs51 CPU"
-\end_inset
+\end_inset
, etc.), Dallas DS80C390 variants, Freescale (formerly Motorola) HC08 and
Zilog Z80 based MCUs.
@@ -146,66 +192,75 @@ Sandeep Dutta
Atmel AVR is under development.
The entire source code for the compiler is distributed under GPL.
SDCC uses ASXXXX
-\begin_inset LatexCommand \index{asXXXX (as-gbz80, as-hc08, asx8051, as-z80)}
+\begin_inset LatexCommand index
+name "asXXXX (as-gbz80, as-hc08, asx8051, as-z80)"
-\end_inset
+\end_inset
& ASLINK
-\begin_inset LatexCommand \index{aslink}
+\begin_inset LatexCommand index
+name "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,441 +272,495 @@ 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_inset
+\end_layout
+
+\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
-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
+SDCC also comes with a companion source level debugger SDCDB.
+ The debugger currently uses ucSim, a free open source simulator for 8051
+ and other micro-controllers.
+\newline
-\newline
-The latest version can be downloaded from
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
+\newline
+The latest SDCC version can be downloaded from
+
+\begin_inset LatexCommand url
+target "http://sdcc.sourceforge.net/snap.php"
-\end_inset
+\end_inset
.
-
-\series bold
-\series default
-\emph on
+\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}
+\begin_inset LatexCommand index
+name "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
-\begin_inset LatexCommand \index{GNU General Public License, GPL}
+ etc.) is distributed with the package.
+ This documentation is maintained using a free open source 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
+\begin_inset LatexCommand index
+name "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.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty
-\begin_inset LatexCommand \index{warranty}
+\begin_inset LatexCommand index
+name "warranty"
-\end_inset
+\end_inset
of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
See the GNU General Public License for more details.
@@ -662,28870 +771,37924 @@ 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}
+\begin_inset LatexCommand index
+name "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}
+\begin_inset LatexCommand label
+name "sec:Compatibility-with-previous"
-\end_inset
+\end_inset
with previous versions
-\begin_inset LatexCommand \index{Compatibility with previous versions}
+\begin_inset LatexCommand index
+name "Compatibility with previous versions"
-\end_inset
+\end_inset
-\layout Standard
+\end_layout
-This version has numerous bug fixes compared with the previous version.
- But we also introduced some incompatibilities with older versions.
+\begin_layout Standard
+Newer versions have usually numerous bug fixes compared with the previous
+ version.
+ But we also sometimes introduce 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}
+\begin_inset LatexCommand index
+name "ANSI-compliance"
-\end_inset
+\end_inset
(see section
-\begin_inset LatexCommand \ref{sub:ANSI-Compliance}
+\begin_inset LatexCommand ref
+reference "sub:ANSI-Compliance"
-\end_inset
+\end_inset
for ANSI-Compliance).
-\newline
+\begin_inset Note Note
+status collapsed
-\layout Itemize
+\begin_layout Standard
+It would be fine to add to each item, in which version was it changed.
+\end_layout
-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_inset
-the default directory for gcc-builds where include, library and documentation
- files are stored is now in /usr/local/share.
-\layout Itemize
-char type parameters to vararg
-\begin_inset LatexCommand \index{vararg, va\_arg}
+\newline
-\end_inset
+\end_layout
- functions are casted to int unless explicitly casted
-\begin_inset Marginal
-collapsed true
+\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.
+ To maintain compatibility, old programs may be compiled using the -
+\begin_inset ERT
+status collapsed
-\layout Standard
+\begin_layout Standard
-\series bold
-\SpecialChar ~
-!
-\end_inset
+\backslash
+/
+\end_layout
-, e.g.:
-\newline
+\end_inset
-\family typewriter
-\SpecialChar ~
-\SpecialChar ~
-char a=3;
-\newline
-\SpecialChar ~
-\SpecialChar ~
-printf ("%d %c
-\backslash
-n", a, (char)a);
-\family default
+-short-is-8bits commandline option (see
+\begin_inset LatexCommand vref
+reference "lyx:--short-is-8bits"
-\newline
- will push a as an int and as a char resp.
-\layout Itemize
+\end_inset
-option -
-\begin_inset ERT
-status Collapsed
+).
+\end_layout
-\layout Standard
+\begin_layout Itemize
+the default directory for gcc-builds where include, library and documentation
+ files are stored is now in /usr/local/share.
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Itemize
+char type parameters to vararg
+\begin_inset LatexCommand index
+name "vararg, va\\_arg"
--regextend has been removed.
-\layout Itemize
+\end_inset
-option -
+ functions are casted to int unless explicitly casted and
+\series bold
+-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--noregparms has been removed.
-\layout Itemize
+status collapsed
-option -
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
--stack-after-data has been removed.
-\layout Itemize
+\end_inset
-bit
-\begin_inset LatexCommand \index{bit}
+-std-c89
+\begin_inset LatexCommand index
+name "-\\/-std-c89"
-\end_inset
+\end_inset
- and sbit
-\begin_inset LatexCommand \index{sbit}
-\end_inset
+\series default
+ and
+\series bold
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\begin_inset LatexCommand \index{\_\_sbit}
-\end_inset
+\backslash
+/
+\end_layout
- types now consistently behave like the C99 _Bool type with respect to type
- conversion
-\begin_inset LatexCommand \index{type conversion}
+\end_inset
-\end_inset
+-std-c99
+\begin_inset LatexCommand index
+name "-\\/-std-c99"
+\end_inset
-\begin_inset LatexCommand \index{type promotion}
-\end_inset
+\series default
+ command line option are not defined
+\begin_inset Marginal
+status collapsed
-.
- The most common incompatibility resulting from this change is related to
- bit toggling
-\begin_inset LatexCommand \index{Bit toggling}
+\begin_layout Standard
-\end_inset
+\series bold
+\InsetSpace ~
+!
+\end_layout
- idioms, e.g.:
-\newline
+\end_inset
-\family typewriter
-\SpecialChar ~
-\SpecialChar ~
-bit b;
-\newline
-\SpecialChar ~
-\SpecialChar ~
-b = ~
-\begin_inset LatexCommand \index{\~\/ Operator}
+, e.g.:
+\newline
-\end_inset
-
-b; /* equivalent to b=1 instead of toggling b */
-\begin_inset Marginal
-collapsed true
-
-\layout Standard
-
-
-\series bold
-\SpecialChar ~
-!
-\end_inset
-
-
-\newline
-\SpecialChar ~
-\SpecialChar ~
-b = !b; /* toggles b */
-\newline
+\family typewriter
+\InsetSpace ~
+\InsetSpace ~
+char a=3;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+printf ("%d %c
+\backslash
+n", a, (char)a);
+\family default
-\family default
-In previous versions, both forms would have toggled the bit.
-\layout Standard
+\newline
+ will push a as an int and as a char resp if
+\series bold
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\emph on
-
-\layout Section
-System Requirements
-\layout Standard
+\backslash
+/
+\end_layout
-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
- GNU gcc and make.
- 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_inset
-Other Resources
-\layout Standard
+-std-c89
+\begin_inset LatexCommand index
+name "-\\/-std-c89"
-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
- SDCC with other SDCC users.
- Web links to other SDCC related sites can also be found here.
- This document can be found in the DOC directory of the source package as
- a text or HTML file.
- A pdf version of this document is available at
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/doc/sdccman.pdf}
+\series default
+ and
+\series bold
+-
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Standard
-.
- Some of the other tools (simulator and assembler) included with SDCC contain
- their own documentation and can be found in the source distribution.
- If you want the latest unreleased software, the complete source package
- is available directly from Subversion on https://svn.sourceforge.net/svnroot/sdcc
-/trunk/sdcc.
-\layout Section
-Wishes for the future
-\layout Standard
+\backslash
+/
+\end_layout
-There are (and always will be) some things that could be done.
- Here are some I can think of:
-\newline
+\end_inset
-\layout Standard
+-std-c99
+\begin_inset LatexCommand index
+name "-\\/-std-c99"
+\end_inset
-\family typewriter
-char KernelFunction3(char p) at 0x340;
-\newline
-\layout Standard
+\series default
+ command line options are not defined,
+\newline
+ will push a as two ints if
+\series bold
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\family typewriter
-better code banking
-\begin_inset LatexCommand \index{code banking (limited support)}
-\end_inset
+\backslash
+/
+\end_layout
- support for mcs51
-\newline
+\end_inset
-\newline
+-std-c89
+\begin_inset LatexCommand index
+name "-\\/-std-c89"
-\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}
+\series default
+ or
+\series bold
+-
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Standard
-\begin_inset LatexCommand \index{Feature request}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
-.
-\newline
+-std-c99
+\begin_inset LatexCommand index
+name "-\\/-std-c99"
-\layout Chapter
+\end_inset
-Installing SDCC
-\begin_inset LatexCommand \index{Installation}
-\end_inset
+\series default
+ command line option is defined.
+\end_layout
+\begin_layout Itemize
+option -
+\begin_inset ERT
+status collapsed
-\layout Standard
+\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
+\backslash
+/
+\end_layout
- (Unix) or section
-\begin_inset LatexCommand \ref{sub:Windows-Install}
+\end_inset
-\end_inset
+-regextend has been removed.
+\end_layout
- (Windows).
- More detailed instructions follow below.
-\layout Section
+\begin_layout Itemize
+option -
+\begin_inset ERT
+status collapsed
-Configure Options
-\begin_inset LatexCommand \index{Options SDCC configuration}
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
-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
+-noregparms has been removed.
+\end_layout
--
+\begin_layout Itemize
+option -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
-
--prefix see table below
-\layout List
-\labelwidthstring 00.00.0000
--
-\begin_inset ERT
-status Collapsed
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+-stack-after-data has been removed.
+\end_layout
--exec_prefix see table below
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Itemize
+bit
+\begin_inset LatexCommand index
+name "bit"
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+ and sbit
+\begin_inset LatexCommand index
+name "sbit"
-\backslash
-/
-\end_inset
+\end_inset
--bindir see table below
-\layout List
-\labelwidthstring 00.00.0000
--
-\begin_inset ERT
-status Collapsed
+\begin_inset LatexCommand index
+name "\\_\\_sbit"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ types now consistently behave like the C99 _Bool type with respect to type
+ conversion
+\begin_inset LatexCommand index
+name "type conversion"
--datadir see table below
-\newline
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
-\SpecialChar ~
-\SpecialChar ~
-docdir environment variable, see table below
-\layout List
-\labelwidthstring 00.00.0000
+\begin_inset LatexCommand index
+name "type promotion"
-\SpecialChar ~
-\SpecialChar ~
-include_dir_suffix environment variable, see table below
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
-\SpecialChar ~
-\SpecialChar ~
-lib_dir_suffix environment variable, see table below
-\layout List
-\labelwidthstring 00.00.0000
+.
+ The most common incompatibility resulting from this change is related to
+ bit toggling
+\begin_inset LatexCommand index
+name "Bit toggling"
-\SpecialChar ~
-\SpecialChar ~
-sdccconf_h_dir_separator environment variable, either / or
-\backslash
+\end_inset
-\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
+ idioms, e.g.:
+\newline
-\layout List
-\labelwidthstring 00.00.0000
+\family typewriter
+\InsetSpace ~
+\InsetSpace ~
+bit b;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+b = ~
+\begin_inset LatexCommand index
+name "\\~\\/ Operator"
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+b; /* equivalent to b=1 instead of toggling b */
+\begin_inset Marginal
+status collapsed
-\backslash
-/
-\end_inset
+\begin_layout Standard
--disable-mcs51-port Excludes the Intel mcs51 port
-\layout List
-\labelwidthstring 00.00.0000
+\series bold
+\InsetSpace ~
+!
+\end_layout
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\newline
+\InsetSpace ~
+\InsetSpace ~
+b = !b; /* toggles b */
+\newline
--disable-gbz80-port Excludes the Gameboy gbz80 port
-\layout List
-\labelwidthstring 00.00.0000
+\family default
+In previous versions, both forms would have toggled the bit.
+\end_layout
+\begin_layout Itemize
+in older versions, the preprocessor was always called with
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
--disable-z80-port Excludes the z80 port
-\layout List
-\labelwidthstring 00.00.0000
+\backslash
+/
+\end_layout
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+-std-c99
+\begin_inset LatexCommand index
+name "-\\/-std-c99"
-\backslash
-/
-\end_inset
+\end_inset
--disable-avr-port Excludes the AVR port
-\layout List
-\labelwidthstring 00.00.0000
+\series default
+ regardless of the
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
--disable-ds390-port Excludes the DS390 port
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+-std-xxx
+\series default
+ setting.
+ This is no longer true, and can cause compilation failures on code built
+ with
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
--disable-hc08-port Excludes the HC08 port
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
--
-\begin_inset ERT
-status Collapsed
+-std-c89
+\begin_inset LatexCommand index
+name "-\\/-std-c89"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
--disable-pic-port Excludes the PIC port
-\layout List
-\labelwidthstring 00.00.0000
+\series default
+ but using c99 preprocessor features, such as one-line (//) comments
+\end_layout
+
+\begin_layout Itemize
+in versions older then 2.8.4 the pic16 *printf() and printf_tiny() library
+ functions supported undocumented and not standard compliant 'b' binary
+ format specifier ("%b", "%hb" and "%lb").
+ The 'b' specifier is now disabled by default.
+ It can be enabled by defining BINARY_SPECIFIER macro in files device/lib/pic16/
+libc/stdio/vfprintf.c and device/lib/pic16/libc/stdio/printf_tiny.c and recompilin
+g the library.
+\end_layout
+
+\begin_layout Itemize
+in versions older then 2.8.5 the unnamed bitfield structure members participated
+ in initialization, which is not conforming with ISO/IEC 9899:1999 standard
+ (see section Section 6.7.8 Initialization, clause 9)
+\newline
--
-\begin_inset ERT
-status Collapsed
+\newline
+Old behavior, before
+ version 2.8.5:
+\family typewriter
-\layout Standard
+\newline
+\InsetSpace ~
+\InsetSpace ~
+struct {
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+int a : 2;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+char\InsetSpace ~
+ : 2;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+int b : 2;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+} s = {1, 2, 3};
+\family default
-\backslash
-/
-\end_inset
+\newline
--disable-xa51-port Excludes the XA51 port
-\layout List
-\labelwidthstring 00.00.0000
+\family typewriter
+/* s.a = 1, s.b = 3 */
+\family default
--
-\begin_inset ERT
-status Collapsed
+\newline
-\layout Standard
+\newline
+New behavior:
+\family typewriter
-\backslash
-/
-\end_inset
-
--disable-ucsim Disables configuring and building of ucsim
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+\InsetSpace ~
+\InsetSpace ~
+struct {
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+int a : 2;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+char\InsetSpace ~
+ : 2;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+int b : 2;
+\newline
+\InsetSpace ~
+\InsetSpace ~
+} s = {1, 2};
+\family default
--
-\begin_inset ERT
-status Collapsed
+\newline
-\layout Standard
+\family typewriter
+/* s.a = 1, s.b = 2 */
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Section
+System Requirements
+\end_layout
--disable-device-lib Disables automatically building device libraries
-\layout List
-\labelwidthstring 00.00.0000
+\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
+ GNU gcc and make.
+ For Windows some pre-compiled binary distributions are available for your
+ convenience.
+ You should have some experience with command line tools and compiler use.
+\end_layout
--
-\begin_inset ERT
-status Collapsed
+\begin_layout Section
+Other Resources
+\end_layout
-\layout Standard
+\begin_layout Standard
+The SDCC home page at
+\begin_inset LatexCommand url
+target "http://sdcc.sourceforge.net/"
-\backslash
-/
-\end_inset
+\end_inset
--disable-packihx Disables building packihx
-\newline
+ is a great place to find distribution sets.
+ You can also find links to the user mailing lists that offer help or discuss
+ SDCC with other SDCC users.
+ Web links to other SDCC related sites can also be found here.
+ This document can be found in the DOC directory of the source package as
+ a text or HTML file.
+ A pdf version of this document is available at
+\begin_inset LatexCommand url
+target "http://sdcc.sourceforge.net/doc/sdccman.pdf"
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
--
-\begin_inset ERT
-status Collapsed
+.
+ Some of the other tools (simulator and assembler) included with SDCC contain
+ their own documentation and can be found in the source distribution.
+ If you want the latest unreleased software, the complete source package
+ is available directly from Subversion on https://sdcc.svn.sourceforge.net/svnroot/
+sdcc/trunk/sdcc.
+\end_layout
-\layout Standard
+\begin_layout Section
+Wishes for the future
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Standard
+There are (and always will be) some things that could be done.
+ Here are some I can think of:
+\newline
--enable-doc Build pdf, html and txt files from the lyx sources
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
--
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
-\layout Standard
+\family typewriter
+char KernelFunction3(char p) at 0x340;
+\newline
-\backslash
-/
-\end_inset
+\end_layout
--enable-libgc Use the Bohem memory allocator.
- Lower runtime footprint.
-\layout Standard
+\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
+\family typewriter
+better code banking
+\begin_inset LatexCommand index
+name "code banking (limited support)"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ support for mcs51
+\newline
--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.
- At the moment it's not possible to change the default settings (it was
- simply never required).
-\newline
+\family default
+If you can think of some more, please see the section
+\begin_inset LatexCommand ref
+reference "sub:Requesting-Features"
-\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
-italics
-\emph default
- to distinguish them from run time environment variables (see section search
- paths).
-\newline
+\end_inset
-\newline
-The settings for
-\begin_inset Quotes sld
-\end_inset
+ about filing feature requests
+\begin_inset LatexCommand index
+name "Requesting features"
-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
-open source,
-\layout Enumerate
+\begin_inset LatexCommand index
+name "Feature request"
-a gcc compiler and last but not least
-\layout Enumerate
+\end_inset
-the binaries can be built by cross compiling on Sourceforge's compile farm.
-\layout Standard
+.
+\newline
-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
+\end_layout
-\newline
-These defaults are:
-\newline
+\begin_layout Chapter
+Installing SDCC
+\begin_inset LatexCommand index
+name "Installation"
-\layout Standard
-\align center
+\end_inset
-\begin_inset Tabular
-
-
-
-
-
-
-
-\begin_inset Text
-\layout Standard
+\end_layout
-Variable
-\end_inset
-
-
-\begin_inset Text
+\begin_layout Standard
+For most users it is sufficient to skip to either section
+\begin_inset LatexCommand ref
+reference "sub:Building-SDCC-on-Linux"
-\layout Standard
+\end_inset
-default
-\end_inset
-
-
-\begin_inset Text
+ (Unix) or section
+\begin_inset LatexCommand ref
+reference "sub:Windows-Install"
-\layout Standard
+\end_inset
-Win32 builds
-\end_inset
-
-
-
-
-\begin_inset Text
+ (Windows).
+ More detailed instructions follow below.
+\end_layout
-\layout Standard
+\begin_layout Section
+Configure Options
+\begin_inset LatexCommand index
+name "Options SDCC configuration"
+\end_inset
-\emph on
-PREFIX
-\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\end_layout
-/usr/local
-\end_inset
-
-
-\begin_inset Text
+\begin_layout Standard
+The install paths, search paths and other options are defined when running
+ 'configure'.
+ The defaults can be overridden by:
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\backslash
-sdcc
-\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+/
+\end_layout
+\end_inset
-\emph on
-EXEC_PREFIX
-\end_inset
-
-
-\begin_inset Text
+-prefix see table below
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\emph on
-$PREFIX
-\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+/
+\end_layout
+\end_inset
-\emph on
-$PREFIX
-\end_inset
-
-
-
-
-\begin_inset Text
+-exec_prefix see table below
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\emph on
-BINDIR
-\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+/
+\end_layout
+\end_inset
-\emph on
-$EXECPREFIX
-\emph default
-/bin
-\end_inset
-
-
-\begin_inset Text
+-bindir see table below
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\emph on
-$EXECPREFIX
-\emph default
-\backslash
-bin
-\end_inset
-
-
-
-
-\begin_inset Text
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
+-datadir see table below
+\end_layout
-\emph on
-DATADIR
-\end_inset
-
-
-\begin_inset Text
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
-\layout Standard
+\begin_layout Standard
-\emph on
-$PREFIX
-\emph default
-/share
-\end_inset
-
-
-\begin_inset Text
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
+-datarootdir see table below
+\newline
-\emph on
-$PREFIX
-\end_inset
-
-
-
-
-\begin_inset Text
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+\InsetSpace ~
+\InsetSpace ~
+docdir environment variable, see table below
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
+\InsetSpace ~
+\InsetSpace ~
+include_dir_suffix environment variable, see table below
+\end_layout
-\emph on
-DOCDIR
-\end_inset
-
-
-\begin_inset Text
+\begin_layout List
+\labelwidthstring 00.00.0000
+\InsetSpace ~
+\InsetSpace ~
+lib_dir_suffix environment variable, see table below
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+\InsetSpace ~
+\InsetSpace ~
+sdccconf_h_dir_separator environment variable, either / or
+\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
-\emph on
-$DATADIR
-\emph default
-/sdcc/doc
-\end_inset
-
-
-\begin_inset Text
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\emph on
-$DATADIR
-\emph default
-\backslash
-doc
-\end_inset
-
-
-
-
-\begin_inset Text
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
+-disable-mcs51-port Excludes the Intel mcs51 port
+\end_layout
-\emph on
-INCLUDE_DIR_SUFFIX
-\end_inset
-
-
-\begin_inset Text
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
-\layout Standard
+\begin_layout Standard
-sdcc/include
-\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+/
+\end_layout
-include
-\end_inset
-
-
-
-
-\begin_inset Text
+\end_inset
-\layout Standard
+-disable-gbz80-port Excludes the Gameboy gbz80 port
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
-\emph on
-LIB_DIR_SUFFIX
-\end_inset
-
-
-\begin_inset Text
+\begin_layout Standard
-\layout Standard
-sdcc/lib
-\end_inset
-
-
-\begin_inset Text
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
-lib
-\end_inset
-
-
-
+-disable-z80-port Excludes the z80 port
+\end_layout
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\newline
-\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
-
-\layout Standard
-\align center
+\backslash
+/
+\end_layout
-\begin_inset Tabular
-
-
-
-
-
-
-
-\begin_inset Text
+\end_inset
-\layout Standard
+-disable-avr-port Excludes the AVR port
+\end_layout
-Variable (computed)
-\end_inset
-
-
-\begin_inset Text
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
-\layout Standard
+\begin_layout Standard
-default
-\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+/
+\end_layout
-Win32 builds
-\end_inset
-
-
-
-
-\begin_inset Text
+\end_inset
-\layout Standard
+-disable-ds390-port Excludes the DS390 port
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
-\emph on
-BIN2DATA_DIR
-\end_inset
-
-
-\begin_inset Text
+\begin_layout Standard
-\layout Standard
-../share
-\end_inset
-
-
-\begin_inset Text
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
-..
-\end_inset
-
-
-
-
-\begin_inset Text
+-disable-hc08-port Excludes the HC08 port
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\emph on
-PREFIX2BIN_DIR
-\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+/
+\end_layout
-bin
-\end_inset
-
-
-\begin_inset Text
+\end_inset
-\layout Standard
+-disable-pic-port Excludes the PIC14 port
+\end_layout
-bin
-\end_inset
-
-
-
-
-\begin_inset Text
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
-\layout Standard
+\begin_layout Standard
-\emph on
-PREFIX2DATA_DIR
-\end_inset
-
-
-\begin_inset Text
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
-share/sdcc
-\end_inset
-
-
-\begin_inset Text
+-disable-pic16-port Excludes the PIC16 port
+\end_layout
-\layout Standard
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
-\end_inset
-
-
-
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\newline
+\end_inset
-\layout Standard
-\noindent
-Examples:
-\layout LyX-Code
+-disable-xa51-port Excludes the XA51 port
+\end_layout
-./configure
-\newline
-./configure -
+\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
--prefix=
-\begin_inset Quotes srd
-\end_inset
+\end_inset
-/usr/bin
-\begin_inset Quotes srd
-\end_inset
+-disable-ucsim Disables configuring and building of ucsim
+\end_layout
- -
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
--datadir=
-\begin_inset Quotes srd
-\end_inset
+\backslash
+/
+\end_layout
-/usr/share
-\begin_inset Quotes srd
-\end_inset
+\end_inset
+-disable-device-lib Disables automatically building device libraries
+\end_layout
-\newline
-./configure -
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
+status collapsed
--disable-avr-port -
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
-
--disable-xa51-port
-\layout Standard
-
-To cross compile on linux for Mingw32 (see also 'sdcc/support/scripts/sdcc_mingw
-32'):
-\layout LyX-Code
+\end_layout
-./configure
-\backslash
-
-\newline
-CC=
-\begin_inset Quotes srd
-\end_inset
-
-i586-mingw32msvc-gcc
-\begin_inset Quotes srd
-\end_inset
+\end_inset
- CXX=
-\begin_inset Quotes srd
-\end_inset
+-disable-packihx Disables building packihx
+\newline
-i586-mingw32msvc-g++
-\begin_inset Quotes srd
-\end_inset
+\end_layout
-
-\backslash
-
-\newline
-RANLIB=
-\begin_inset Quotes srd
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status collapsed
-i586-mingw32msvc-ranlib
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Standard
-
-\backslash
-\newline
-STRIP=
-\begin_inset Quotes srd
-\end_inset
+\backslash
+/
+\end_layout
-i586-mingw32msvc-strip
-\begin_inset Quotes srd
-\end_inset
+\end_inset
-
-\backslash
+-enable-doc Build pdf, html and txt files from the lyx sources
+\end_layout
-\newline
+\begin_layout List
+\labelwidthstring 00.00.0000
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
--prefix=
-\begin_inset Quotes srd
-\end_inset
+\backslash
+/
+\end_layout
-/sdcc
-\begin_inset Quotes srd
-\end_inset
+\end_inset
-
-\backslash
+-enable-libgc Use the Bohem memory allocator.
+ Lower runtime footprint.
+\end_layout
-\newline
+\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
--datadir=
-\begin_inset Quotes srd
-\end_inset
+\end_inset
-/sdcc
-\begin_inset Quotes srd
-\end_inset
+-without-ccache Do not use ccache even if available
+\end_layout
-
-\backslash
+\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
-\newline
-docdir=
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Standard
-/sdcc/doc
-\begin_inset Quotes srd
-\end_inset
-
-\backslash
+\backslash
+/
+\end_layout
-\newline
-include_dir_suffix=
-\begin_inset Quotes srd
-\end_inset
+\end_inset
-include
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
-lib_dir_suffix=
-\begin_inset Quotes srd
-\end_inset
-
-lib
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
-sdccconf_h_dir_separator=
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\backslash
-
-\backslash
-
-\backslash
-
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--disable-device-lib
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--host=i586-mingw32msvc
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+-help' and the man/info pages of `configure' for details.
+\newline
-\backslash
-/
-\end_inset
+\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
--build=unknown-unknown-linux-gnu
-\layout Standard
+\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
+italics
+\emph default
+ to distinguish them from run time environment variables (see section search
+ paths).
+\newline
-To
+\newline
+The settings for
\begin_inset Quotes sld
-\end_inset
-
-cross
-\begin_inset Quotes srd
-\end_inset
-
-compile on Cygwin for Mingw32 (see also sdcc/support/scripts/sdcc_cygwin_mingw32
-):
-\layout LyX-Code
-
-./configure -C
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--prefix=
-\begin_inset Quotes srd
-\end_inset
-
-/sdcc
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--datadir=
-\begin_inset Quotes srd
-\end_inset
-
-/sdcc
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
-docdir=
-\begin_inset Quotes srd
-\end_inset
-
-/sdcc/doc
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
-include_dir_suffix=
-\begin_inset Quotes srd
-\end_inset
-
-include
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
-lib_dir_suffix=
-\begin_inset Quotes srd
-\end_inset
-
-lib
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
-sdccconf_h_dir_separator=
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\backslash
-
-\backslash
-
-\backslash
-
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
-CC=
-\begin_inset Quotes srd
-\end_inset
-
-gcc -mno-cygwin
-\begin_inset Quotes srd
-\end_inset
-
-
-\backslash
-
-\newline
-CXX=
-\begin_inset Quotes srd
-\end_inset
+\end_inset
-g++ -mno-cygwin
+Win32 builds
\begin_inset Quotes srd
-\end_inset
-
-
-\layout Standard
-
-'configure' is quite slow on Cygwin (at least on windows before Win2000/XP).
- The option '-
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\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_inset
-Install paths
-\begin_inset LatexCommand \label{sub:Install-paths}
+ 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
+\end_layout
-\end_inset
+\begin_layout Enumerate
+open source,
+\end_layout
+\begin_layout Enumerate
+a gcc compiler and last but not least
+\end_layout
-\begin_inset LatexCommand \index{Install paths}
+\begin_layout Enumerate
+the binaries can be built by cross compiling on SDCC Distributed Compile
+ Farm.
+\end_layout
-\end_inset
+\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
+These defaults are:
+\newline
-\layout Standard
-\added_space_top medskip \align center
+\end_layout
-\begin_inset Tabular
-
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+
-
-
-
-
+
+
+
\begin_inset Text
-\layout Standard
-
-
-\series bold
-Description
-\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
-
+\begin_layout Standard
+Variable
+\end_layout
-\series bold
-Path
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
-
+\begin_layout Standard
+default
+\end_layout
-\series bold
-Default
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
-
-
-\series bold
+\begin_layout Standard
Win32 builds
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
-Binary files*
-\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
+\begin_layout Standard
+\emph on
+PREFIX
+\end_layout
-\emph on
-$EXEC_PREFIX
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+/usr/local
+\end_layout
-/usr/local/bin
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-
-\backslash
+\backslash
sdcc
-\backslash
-bin
-\end_inset
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
-
-Include files
-\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
+\begin_layout Standard
+\emph on
+EXEC_PREFIX
+\end_layout
-\emph on
-$DATADIR/ $INCLUDE_DIR_SUFFIX
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-/usr/local/share/sdcc/include
-\end_inset
+\emph on
+$PREFIX
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+\emph on
+$PREFIX
+\end_layout
-\backslash
-sdcc
-\backslash
-include
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
-
-Library file**
-\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
+\begin_layout Standard
+\emph on
+BINDIR
+\end_layout
-\emph on
-$DATADIR/$LIB_DIR_SUFFIX
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-/usr/local/share/sdcc/lib
-\end_inset
+\emph on
+$EXEC_PREFIX
+\emph default
+/bin
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+\emph on
+$EXEC_PREFIX
+\emph default
-\backslash
-sdcc
-\backslash
-lib
-\end_inset
-
-
-
-
-\begin_inset Text
-
-\layout Standard
+\backslash
+bin
+\end_layout
-Documentation
-\end_inset
+\end_inset
+
+
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+\emph on
+DATADIR
+\end_layout
-\emph on
-$DOCDIR
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-/usr/local/share/sdcc/doc
-\end_inset
+\emph on
+$DATAROOTDIR
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+\emph on
+$DATAROOTDIR
+\end_layout
-\backslash
-sdcc
-\backslash
-doc
-\end_inset
+\end_inset
-
-
-\end_inset
-
-
-\layout Verse
-
-
-\size footnotesize
-*compiler, preprocessor, assembler, and linker
-\newline
-**the
-\shape italic
-model
-\shape default
- is auto-appended by the compiler, e.g.
- small, large, z80, ds390 etc
-\layout Standard
-\noindent
-The install paths can still be changed during `make install` with e.g.:
-\layout LyX-Code
-
-make install prefix=$(HOME)/local/sdcc
-\layout Standard
-
-Of course this doesn't change the search paths compiled into the binaries.
-\newline
-
-\newline
-Moreover the install path can be changed by defining DESTDIR
-\begin_inset LatexCommand \index{DESTDIR}
-
-\end_inset
-
-:
-\layout LyX-Code
-
-make install DESTDIR=$(HOME)/sdcc.rpm/
-\layout Standard
-
-Please note that DESTDIR must have a trailing slash!
-\layout Section
-
-Search Paths
-\begin_inset LatexCommand \label{sub:Search-Paths}
-
-\end_inset
-
-
-\begin_inset LatexCommand \index{Search path}
-
-\end_inset
-
-
-\layout Standard
-
-Some search paths or parts of them are determined by configure variables
- (in
-\emph on
-italics
-\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
-1.
- Binary files (preprocessor, assembler and linker)
-\newline
-
-\layout Standard
-\align center
-
-\begin_inset Tabular
-
-
-
-
-
-
+
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-Search path
-\end_inset
+\emph on
+DATAROOTDIR
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-default
-\end_inset
+\emph on
+$PREFIX
+\emph default
+/share
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-Win32 builds
-\end_inset
+\emph on
+$PREFIX
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-$SDCC_HOME/
-\emph on
-$PPREFIX2BIN_DIR
-\end_inset
+\emph on
+DOCDIR
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-$SDCC_HOME/bin
-\end_inset
+\emph on
+$DATAROOTDIR
+\emph default
+/sdcc/doc
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-$SDCC_HOME
-\backslash
-bin
-\end_inset
+\emph on
+$DATAROOTDIR
+\emph default
+
+\backslash
+doc
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-Path of argv[0] (if available)
-\end_inset
+\emph on
+INCLUDE_DIR_SUFFIX
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+sdcc/include
+\end_layout
-Path of argv[0]
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+include
+\end_layout
-Path of argv[0]
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-$PATH
-\end_inset
+\emph on
+LIB_DIR_SUFFIX
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+sdcc/lib
+\end_layout
-$PATH
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+lib
+\end_layout
-$PATH
-\end_inset
+\end_inset
-\end_inset
+\end_inset
-
-\newline
-\layout Standard
-\noindent
-2.
- Include files
-\newline
+\newline
-\layout Standard
-\align center
+\end_layout
-\begin_inset Tabular
-
+\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
+
+\end_layout
+
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+
-
-
+
+
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+Variable (computed)
+\end_layout
-Search path
-\end_inset
+\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_inset ERT
-status Collapsed
-
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
+\emph on
+BIN2DATA_DIR
+\end_layout
--I dir
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
-
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
+\begin_layout Standard
+../share
+\end_layout
--I dir
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
-
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
+\begin_layout Standard
+..
+\end_layout
--I dir
-\end_inset
+\end_inset
-
-
+
+
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-$SDCC_INCLUDE
-\end_inset
+\emph on
+PREFIX2BIN_DIR
+\end_layout
+
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+bin
+\end_layout
-$SDCC_INCLUDE
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+bin
+\end_layout
-$SDCC_INCLUDE
-\end_inset
+\end_inset
-
-
+
+
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-$SDCC_HOME/
-\newline
+\emph on
+PREFIX2DATA_DIR
+\end_layout
-\emph on
-$PREFIX2DATA_DIR/
-\newline
-$INCLUDE_DIR_SUFFIX
-\end_inset
+\end_inset
-
+
\begin_inset Text
-\layout Standard
+\begin_layout Standard
+share/sdcc
+\end_layout
-$SDCC_ HOME/
-\newline
-share/sdcc/
-\newline
-include
-\end_inset
+\end_inset
\begin_inset Text
-\layout Standard
+\begin_layout Standard
-$SDCC_HOME
-\backslash
-include
-\end_inset
+\end_layout
+
+\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
+
-path(argv[0])/
-\newline
+\end_inset
-\emph on
-$BIN2DATADIR/
-\emph default
-\newline
+\newline
-\emph on
-$INCLUDE_DIR_SUFFIX
-\end_inset
-
-
-\begin_inset Text
+\end_layout
-\layout Standard
+\begin_layout Standard
+\noindent
+Examples:
+\end_layout
-path(argv[0])/
-\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
+\begin_layout LyX-Code
+./configure
+\newline
+./configure -
+\begin_inset ERT
+status collapsed
-path(argv[0])
-\backslash
-..
-\backslash
-include
-\end_inset
-
-
-
-
-\begin_inset Text
+\begin_layout Standard
-\layout Standard
+\backslash
+/
+\end_layout
-\emph on
-$DATADIR/
-\emph default
+\end_inset
-\newline
+-prefix=
+\begin_inset Quotes srd
+\end_inset
-\emph on
-$INCLUDE_DIR_SUFFIX
-\end_inset
-
-
-\begin_inset Text
+/usr/bin
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+ -
+\begin_inset ERT
+status collapsed
-/usr/local/share/sdcc/
-\newline
-include
-\end_inset
-
-
-\begin_inset Text
+\begin_layout Standard
-\layout Standard
-(not on Win32)
-\end_inset
-
-
-
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
-
-\newline
+-datarootdir=
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
-\noindent
-The option -
-\begin_inset ERT
-status Collapsed
+/usr/share
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\newline
+./configure -
+\begin_inset ERT
+status collapsed
--nostdinc disables the last two search paths.
-\newline
+\begin_layout Standard
-\newline
-3.
- Library files
-\newline
-\layout Standard
+\backslash
+/
+\end_layout
-With the exception of
-\begin_inset Quotes sld
-\end_inset
+\end_inset
--
+-disable-avr-port -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
--L dir
-\begin_inset Quotes srd
-\end_inset
+\end_inset
- the
-\shape italic
-model
-\shape default
- is auto-appended by the compiler (e.g.
- small, large, z80, ds390 etc.).
-
-\newline
+-disable-xa51-port
+\end_layout
-\layout Standard
-\align center
+\begin_layout Standard
+To cross compile on linux for Mingw32 (see also 'sdcc/support/scripts/sdcc_mingw
+32'):
+\end_layout
-\begin_inset Tabular
-
-
-
-
-
-
-
-\begin_inset Text
+\begin_layout LyX-Code
+./configure
+\backslash
+
+\newline
+CC=
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+i586-mingw32msvc-gcc
+\begin_inset Quotes srd
+\end_inset
-Search path
-\end_inset
-
-
-\begin_inset Text
+ CXX=
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+i586-mingw32msvc-g++
+\begin_inset Quotes srd
+\end_inset
-default
-\end_inset
-
-
-\begin_inset Text
+
+\backslash
+
+\newline
+RANLIB=
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+i586-mingw32msvc-ranlib
+\begin_inset Quotes srd
+\end_inset
-Win32 builds
-\end_inset
-
-
-
-
-\begin_inset Text
+
+\backslash
+
+\newline
+STRIP=
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+i586-mingw32msvc-strip
+\begin_inset Quotes srd
+\end_inset
+
+
+\backslash
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
--L dir
-\end_inset
-
-
-\begin_inset Text
+\end_inset
+
+-prefix=
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+/sdcc
+\begin_inset Quotes srd
+\end_inset
+
+
+\backslash
+\newline
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
--L dir
-\end_inset
-
-
-\begin_inset Text
+\end_inset
-\layout Standard
+-datarootdir=
+\begin_inset Quotes srd
+\end_inset
--
-\begin_inset ERT
-status Collapsed
+/sdcc
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+
+\backslash
-\backslash
-/
-\end_inset
+\newline
+docdir=
+\begin_inset Quotes srd
+\end_inset
--L dir
-\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+${datarootdir}/doc
+\begin_inset Quotes srd
+\end_inset
-$SDCC_LIB/
-\newline
+
+\backslash
-\emph on
-
-\end_inset
-
-
-\begin_inset Text
+\newline
+include_dir_suffix=
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+include
+\begin_inset Quotes srd
+\end_inset
-$SDCC_LIB/
-\newline
+
+\backslash
-\emph on
-
-\end_inset
-
-
-\begin_inset Text
+\newline
+lib_dir_suffix=
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+lib
+\begin_inset Quotes srd
+\end_inset
-$SDCC_LIB
-\backslash
+
+\backslash
-\newline
+\newline
+sdccconf_h_dir_separator=
+\begin_inset Quotes srd
+\end_inset
-\emph on
-
-\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+\backslash
-$SDCC_HOME/
-\newline
+\backslash
-\emph on
-$PREFIX2DATA_DIR/
-\newline
-$LIB_DIR_SUFFIX/
-\end_inset
-
-
-\begin_inset Text
+\backslash
-\layout Standard
+\backslash
-$SDCC_HOME/
-\newline
-share/sdcc/
-\newline
-lib/
-\emph on
-
-\end_inset
-
-
-\begin_inset Text
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+
+\backslash
-$SDCC_HOME
-\backslash
-lib
-\backslash
+\newline
+-
+\begin_inset ERT
+status collapsed
-\emph on
+\begin_layout Standard
-\newline
-
-\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+/
+\end_layout
-path(argv[0])/
-\newline
+\end_inset
-\emph on
-$BIN2DATADIR/
-\emph default
+-disable-device-lib
+\backslash
-\newline
+\newline
+-
+\begin_inset ERT
+status collapsed
-\emph on
-$LIB_DIR_SUFFIX/
-\end_inset
-
-
-\begin_inset Text
+\begin_layout Standard
-\layout Standard
-path(argv[0])/
-\newline
-../sdcc/lib/
-\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
+\backslash
+/
+\end_layout
-path(argv[0])
-\backslash
+\end_inset
-\newline
-..
-\backslash
-lib
-\backslash
+-host=i586-mingw32msvc
+\backslash
-\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
-
-
-
-
-\begin_inset Text
+\newline
+-
+\begin_inset ERT
+status collapsed
-\layout Standard
+\begin_layout Standard
-\emph on
-$DATADIR/
-\newline
-$LIB_DIR_SUFFIX/
-\end_inset
-
-
-\begin_inset Text
+\backslash
+/
+\end_layout
-\layout Standard
-
-/usr/local/share/sdcc/
-\newline
-lib/
-\emph on
-
-\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
-
-(not on Win32)
-\end_inset
-
-
-
-
-\end_inset
+\end_inset
+-build=unknown-unknown-linux-gnu
+\end_layout
-\newline
+\begin_layout Standard
+To
+\begin_inset Quotes sld
+\end_inset
-\layout Comment
+cross
+\begin_inset Quotes srd
+\end_inset
-Don't delete any of the stray spaces in the table above without checking
- the HTML output (last line)!
-\layout Standard
+compile on Cygwin for Mingw32 (see also sdcc/support/scripts/sdcc_cygwin_mingw32
+):
+\end_layout
-\SpecialChar ~
+\begin_layout LyX-Code
+./configure -C
+\backslash
-\newline
-The option -
+\newline
+-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
--nostdlib disables the last two search paths.
-\layout Section
+\end_inset
-Building SDCC
-\begin_inset LatexCommand \index{Building SDCC}
+-prefix=
+\begin_inset Quotes srd
+\end_inset
-\end_inset
+/sdcc
+\begin_inset Quotes srd
+\end_inset
+
+\backslash
-\layout Subsection
+\newline
+-
+\begin_inset ERT
+status collapsed
-Building SDCC on Linux
-\begin_inset LatexCommand \label{sub:Building-SDCC-on-Linux}
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\layout Enumerate
+\end_inset
+-datarootdir=
+\begin_inset Quotes srd
+\end_inset
+
+/sdcc
+\begin_inset Quotes srd
+\end_inset
-\series medium
-Download the source package
-\series default
- either from the SDCC Subversion repository or from the nightly snapshots
-\series medium
-, it will be named something like sdcc
-\series default
-.src
-\series medium
-.t
-\series default
-ar.
-\series medium
-gz
-\series default
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
+\backslash
-\end_inset
+\newline
+docdir=
+\begin_inset Quotes srd
+\end_inset
-.
-\layout Enumerate
+\backslash
+${datarootdir}/doc
+\begin_inset Quotes srd
+\end_inset
-\series medium
-Bring up a command line terminal, such as xterm.
-\layout Enumerate
+
+\backslash
+
+\newline
+include_dir_suffix=
+\begin_inset Quotes srd
+\end_inset
+include
+\begin_inset Quotes srd
+\end_inset
-\series medium
-Unpack the file using a command like:
-\family sans
-\series bold
-"tar -xvzf sdcc.src.tar.gz
-\family default
-\series default
-"
-\series medium
-, this will create a sub-directory called sdcc with all of the sources.
-\layout Enumerate
+
+\backslash
-Change directory into the main SDCC directory, for example type:
-\family sans
-\series bold
-"cd sdcc
-\series default
-".
-\layout Enumerate
+\newline
+lib_dir_suffix=
+\begin_inset Quotes srd
+\end_inset
+lib
+\begin_inset Quotes srd
+\end_inset
-\series medium
-Type
-\family sans
-\series bold
-"./configure
-\family default
-\series default
-".
- This configures the package for compilation on your system.
-\layout Enumerate
+
+\backslash
+\newline
+sdccconf_h_dir_separator=
+\begin_inset Quotes srd
+\end_inset
-\series medium
-Type
-\family sans
-\series bold
-"make
-\family default
-\series default
-"
-\series medium
-.
-\series default
- All of the source packages will compile, this can take a while.
-\layout Enumerate
+\backslash
+\backslash
-\series medium
-Type
-\family sans
-\series bold
-"make install"
-\family default
-\series default
- as root
-\series medium
-.
+\backslash
-\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}
+\backslash
-\end_inset
+\begin_inset Quotes srd
+\end_inset
-.
-\layout Subsection
+
+\backslash
-Building SDCC on OSX 2.x
-\layout Standard
+\newline
+CC=
+\begin_inset Quotes srd
+\end_inset
-Follow the instruction for Linux.
-\newline
+gcc -mno-cygwin
+\begin_inset Quotes srd
+\end_inset
-\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
+
+\backslash
-./configure CC=gcc2 CXX=g++2
-\layout Subsection
+\newline
+CXX=
+\begin_inset Quotes srd
+\end_inset
-Cross compiling SDCC on Linux for Windows
-\layout Standard
+g++ -mno-cygwin
+\begin_inset Quotes srd
+\end_inset
-With the Mingw32 gcc cross compiler it's easy to compile SDCC for Win32.
- See section 'Configure Options'.
-\layout Subsection
+
+\end_layout
-Building SDCC using Cygwin and Mingw32
-\layout Standard
+\begin_layout Standard
+'configure' is quite slow on Cygwin (at least on windows before Win2000/XP).
+ The option '-
+\begin_inset ERT
+status collapsed
-For building and installing a Cygwin executable follow the instructions
- for Linux.
-\newline
+\begin_layout Standard
-\newline
-On Cygwin a
-\begin_inset Quotes sld
-\end_inset
-native
-\begin_inset Quotes srd
-\end_inset
+\backslash
+/
+\end_layout
- 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
+\end_inset
-\newline
-In order to install Cygwin on Windows download setup.exe from
-\begin_inset LatexCommand \url[www.cygwin.com]{http://www.cygwin.com/}
+-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.
+\end_layout
-\end_inset
+\begin_layout Section
+Install paths
+\begin_inset LatexCommand label
+name "sub:Install-paths"
-.
- Run it, set the
-\begin_inset Quotes sld
-\end_inset
+\end_inset
-default text file type
-\begin_inset Quotes srd
-\end_inset
- to
-\begin_inset Quotes sld
-\end_inset
+\begin_inset LatexCommand index
+name "Install paths"
-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
-flex
-\layout Itemize
+\end_layout
-bison
-\layout Itemize
+\begin_layout Standard
+\begin_inset VSpace medskip
+\end_inset
-gcc ; version 3.x is fine, no need to use the old 2.9x
-\layout Itemize
-binutils ; selected with gcc
-\layout Itemize
+\end_layout
-make
-\layout Itemize
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+
+
+
+
+
+
+
+
+\begin_inset Text
-rxvt ; a nice console, which makes life much easier under windoze (see below)
-\layout Itemize
+\begin_layout Standard
-man ; not really needed for building SDCC, but you'll miss it sooner or
- later
-\layout Itemize
+\series bold
+Description
+\end_layout
-less ; not really needed for building SDCC, but you'll miss it sooner or
- later
-\layout Itemize
+\end_inset
+
+
+\begin_inset Text
-svn ; only if you use Subversion access
-\layout Standard
+\begin_layout Standard
-If you want to develop something you'll need:
-\layout Itemize
+\series bold
+Path
+\end_layout
-python ; for the regression tests
-\layout Itemize
+\end_inset
+
+
+\begin_inset Text
-gdb ; the gnu debugger, together with the nice GUI
-\begin_inset Quotes sld
-\end_inset
+\begin_layout Standard
-insight
-\begin_inset Quotes srd
-\end_inset
+\series bold
+Default
+\end_layout
+\end_inset
+
+
+\begin_inset Text
-\layout Itemize
+\begin_layout Standard
-openssh ; to access the CF or commit changes
-\layout Itemize
+\series bold
+Win32 builds
+\end_layout
-autoconf and autoconf-devel ; if you want to fight with 'configure', don't
- use autoconf-stable!
-\layout Standard
+\end_inset
+
+
+
+
+\begin_inset Text
-rxvt is a nice console with history.
- Replace in your cygwin.bat the line
-\layout LyX-Code
+\begin_layout Standard
+Binary files*
+\end_layout
-bash -
-\begin_inset ERT
-status Collapsed
+\end_inset
+
+
+\begin_inset Text
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
+\emph on
+$EXEC_PREFIX
+\end_layout
--login -i
-\layout Standard
+\end_inset
+
+
+\begin_inset Text
-with (one line):
-\layout LyX-Code
+\begin_layout Standard
+/usr/local/bin
+\end_layout
-rxvt -sl 1000 -fn "Lucida Console-12" -sr -cr red
-\layout LyX-Code
+\end_inset
+
+
+\begin_inset Text
- -bg black -fg white -geometry 100x65 -e bash -
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
-\layout Standard
+\backslash
+sdcc
+\backslash
+bin
+\end_layout
-\backslash
-/
-\end_inset
+\end_inset
+
+
+
+
+\begin_inset Text
--login
-\layout Standard
+\begin_layout Standard
+Include files
+\end_layout
-Text selected with the mouse is automatically copied to the clipboard, pasting
- works with shift-insert.
-\newline
+\end_inset
+
+
+\begin_inset Text
-\newline
-The other good tip is to make sure you have no //c/-style paths anywhere,
- use /cygdrive/c/ instead.
- Using // invokes a network lookup which is very slow.
- If you think
-\begin_inset Quotes sld
-\end_inset
+\begin_layout Standard
-cygdrive
-\begin_inset Quotes srd
-\end_inset
+\emph on
+$DATADIR/ $INCLUDE_DIR_SUFFIX
+\end_layout
- is too long, you can change it with e.g.
-\layout LyX-Code
+\end_inset
+
+
+\begin_inset Text
-mount -s -u -c /mnt
-\layout Standard
+\begin_layout Standard
+/usr/local/share/sdcc/include
+\end_layout
-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.
- And use an editor which can handle LF-only line endings.
- Make sure not to commit files with windows line endings.
- The tabulator spacing
-\begin_inset LatexCommand \index{tabulator spacing (8 columns)}
+\end_inset
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
- 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
+\backslash
+sdcc
+\backslash
+include
+\end_layout
-Building SDCC Using Microsoft Visual C++ 6.0/NET (MSVC)
-\layout Standard
+\end_inset
+
+
+
+
+\begin_inset Text
+\begin_layout Standard
+Library file**
+\end_layout
-\series medium
-Download the source package
-\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
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+\emph on
+$DATADIR/$LIB_DIR_SUFFIX
+\end_layout
-\series medium
-, it will be named something like sdcc
-\series default
-.src
-\series medium
-.tgz.
+\end_inset
+
+
+\begin_inset Text
-\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
-bin_vc.
- Once built you need to copy the executables from sdcc
-\backslash
-bin_vc to sdcc
-\backslash
-bin before running SDCC.
-
-\newline
+\begin_layout Standard
+/usr/local/share/sdcc/lib
+\end_layout
-\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
- client to convert automatically for you.
- If however you are getting a message such as "This makefile was not generated
- by Developer Studio etc.
- etc.
-\begin_inset Quotes srd
-\end_inset
+\end_inset
+
+
+\begin_inset Text
- 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
+\begin_layout Standard
-unix2dos
-\begin_inset Quotes srd
-\end_inset
+\backslash
+sdcc
+\backslash
+lib
+\end_layout
- utility freely available on the internet.
- Doug Hawkins reported in the sdcc-user list that this works:
-\newline
+\end_inset
+
+
+
+
+\begin_inset Text
-\newline
-C:
-\backslash
-Programming
-\backslash
-SDCC> unix2dos sdcc.dsw
-\newline
-C:
-\backslash
-Programming
-\backslash
-SDCC> for /R %I in (*.dsp) do @unix2dos "%I"
-\newline
+\begin_layout Standard
+Documentation
+\end_layout
-\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
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+\emph on
+$DOCDIR
+\end_layout
-\newline
+\end_inset
+
+
+\begin_inset Text
-\newline
-Download the file UnxUtils
-\begin_inset LatexCommand \index{UnxUtils}
+\begin_layout Standard
+/usr/local/share/sdcc/doc
+\end_layout
-\end_inset
+\end_inset
+
+
+\begin_inset Text
-.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
+\begin_layout Standard
-The easy way:
-\newline
+\backslash
+sdcc
+\backslash
+doc
+\end_layout
-\newline
-a) Extract UnxUtils.zip to your C:
-\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
+\end_inset
+
+
+
-\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
-user
-\backslash
-local
-\backslash
-wbin', click ok.
-\newline
+\end_inset
-\newline
-(As a side effect, you get a bunch of Unix utilities that could be useful,
- such as diff and patch.)
-\layout Enumerate
-A more compact way:
-\newline
+\end_layout
-\newline
-This one avoids extracting a bunch of files you may not use, but requires
- some extra work:
-\newline
+\begin_layout Verse
-\newline
-a) Create a directory were to put the tools needed, or use a directory already
- present.
- Say for example 'C:
-\backslash
-util'.
-\newline
+\size footnotesize
+*compiler, preprocessor, assembler, and linker
+\newline
+**the
+\shape italic
+model
+\shape default
+ is auto-appended by the compiler, e.g.
+ small, large, z80, ds390 etc
+\end_layout
-\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
+\begin_layout Standard
+\noindent
+The install paths can still be changed during `make install' with e.g.:
+\end_layout
-\newline
-c) Rename bison.exe to '_bison.exe'.
-\newline
+\begin_layout LyX-Code
+make install prefix=$(HOME)/local/sdcc
+\end_layout
-\newline
-d) Create a batch file 'bison.bat' in 'C:
-\backslash
-util
-\backslash
-' and add these lines:
-\newline
-\SpecialChar ~
-\SpecialChar ~
-set BISON_SIMPLE=C:
-\backslash
-util
-\backslash
-bison.simple
-\newline
-\SpecialChar ~
-\SpecialChar ~
-set BISON_HAIRY=C:
-\backslash
-util
-\backslash
-bison.hairy
-\newline
-\SpecialChar ~
-\SpecialChar ~
-_bison %1 %2 %3 %4 %5 %6 %7 %8 %9
-\newline
+\begin_layout Standard
+Of course this doesn't change the search paths compiled into the binaries.
+\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.
- 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
+Moreove
+r the install path can be changed by defining DESTDIR
+\begin_inset LatexCommand index
+name "DESTDIR"
-\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
-util', click ok.
- Note that you can use any other path instead of 'c:
-\backslash
-util', even the path where the Visual C++ tools are, probably: 'C:
-\backslash
-Program Files
-\backslash
-Microsoft Visual Studio
-\backslash
-Common
-\backslash
-Tools'.
- So you don't have to execute step 'e' :)
-\layout Standard
+\end_inset
-That is it.
- Open 'sdcc.dsw' in Visual Studio, click 'build all', when it finishes copy
- the executables from sdcc
-\backslash
-bin_vc to sdcc
-\backslash
-bin, and you can compile using SDCC.
-\layout Subsection
+:
+\end_layout
-Building SDCC Using Borland
-\layout Enumerate
+\begin_layout LyX-Code
+make install DESTDIR=$(HOME)/sdcc.rpm/
+\end_layout
-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
+\begin_layout Standard
+Please note that DESTDIR must have a trailing slash!
+\end_layout
-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
+\begin_layout Section
+Search Paths
+\begin_inset LatexCommand label
+name "sub:Search-Paths"
-\newline
+\end_inset
-\family sans
-\series bold
-find .
-
-\backslash
-( -name '*.obj' -o -name '*.lib' -o -name '*.rul'
-\backslash
-) -print -exec rm {}
-\backslash
-;
-\family default
-\series default
-\newline
+\begin_inset LatexCommand index
+name "Search path"
-\newline
-or on Windows NT/2000/XP from the command prompt with the command:
-\newline
+\end_inset
-\family sans
-\series bold
-\newline
-del /s *.obj *.lib *.rul
-\family default
-\series default
- from the sdcc directory.
-\layout Subsection
+\end_layout
-Windows Install Using a ZIP Package
-\layout Enumerate
+\begin_layout Standard
+Some search paths or parts of them are determined by configure variables
+ (in
+\emph on
+italics
+\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
-Download the binary zip package from
-\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
+\newline
+1.
+ Binary files (preprocessor, assembler and linker)
+\newline
-\end_inset
+\end_layout
- 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
-sdcc
-\backslash
-bin for the executables, c:
-\backslash
-sdcc
-\backslash
-include and c:
-\backslash
-sdcc
-\backslash
-lib for the include and libraries.
-\layout Enumerate
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+
+
+
+
+
+
+
+\begin_inset Text
-Adjust your environment variable PATH to include the location of the bin
- directory or start sdcc using the full path.
-\layout Subsection
+\begin_layout Standard
+Search path
+\end_layout
-Windows Install Using the Setup Program
-\begin_inset LatexCommand \label{sub:Windows-Install}
+\end_inset
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+default
+\end_layout
+\end_inset
+
+
+\begin_inset Text
-\layout Standard
+\begin_layout Standard
+Win32 builds
+\end_layout
-Download the setup program
-\emph on
-sdcc-x.y.z-setup.exe
-\emph default
- for an official release from
-\newline
+\end_inset
+
+
+
+
+\begin_inset Text
-\begin_inset LatexCommand \url{http://sf.net/project/showfiles.php?group_id=599}
+\begin_layout Standard
+$SDCC_HOME/
+\emph on
+$PPREFIX2BIN_DIR
+\end_layout
-\end_inset
+\end_inset
+
+
+\begin_inset Text
- or a setup program for one of the snapshots
-\emph on
-sdcc-yyyymmdd-xxxx-setup.exe
-\emph default
- from
-\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
+\begin_layout Standard
+$SDCC_HOME/bin
+\end_layout
-\end_inset
+\end_inset
+
+
+\begin_inset Text
- and execute it.
- A windows typical installer will guide you through the installation process.
-\layout Subsection
+\begin_layout Standard
+$SDCC_HOME
+\backslash
+bin
+\end_layout
-VPATH
-\begin_inset LatexCommand \index{VPATH}
+\end_inset
+
+
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+Path of argv[0] (if available)
+\end_layout
- feature
-\layout Standard
+\end_inset
+
+
+\begin_inset Text
-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 ~
-# cd $HOME
-\layout Standard
+\begin_layout Standard
+Path of argv[0]
+\end_layout
+\end_inset
+
+
+\begin_inset Text
-\family typewriter
-tar -xzf sdcc.src.tar.gz\SpecialChar ~
-# extract source to directory sdcc
-\layout Standard
-
-
-\family typewriter
-mkdir sdcc.build\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-# put output in sdcc.build
-\layout Standard
+\begin_layout Standard
+Path of argv[0]
+\end_layout
+\end_inset
+
+
+
+
+\begin_inset Text
-\family typewriter
-cd sdcc.build
-\layout Standard
-
-
-\family typewriter
-../sdcc/configure\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-# configure is doing all the magic!
-\layout Standard
+\begin_layout Standard
+$PATH
+\end_layout
+\end_inset
+
+
+\begin_inset Text
-\family typewriter
-make
-\layout Standard
-\noindent
-That's it!
-\series bold
-configure
-\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
-make
-\series default
- the generated files will be in ~/sdcc.build, while the source files stay
- in ~/sdcc.
-\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
- generated files are not scattered between the source files.
- And the best thing is: if you want to change a file you can leave the original
- file untouched in the source directory.
- Simply copy it to the build directory, edit it, enter `make clean`, `rm
- Makefile.dep` and `make`.
-
-\series bold
-make
-\series default
- will do the rest for you!
-\layout Section
+\begin_layout Standard
+$PATH
+\end_layout
-Building the Documentation
-\layout Standard
+\end_inset
+
+
+\begin_inset Text
-Add -
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
+$PATH
+\end_layout
-\layout Standard
+\end_inset
+
+
+
-\backslash
-/
-\end_inset
+\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
+
+\newline
-\begin_inset Quotes srd
-\end_inset
+\end_layout
-make
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Standard
+\noindent
+2.
+ Include files
+\newline
+\end_layout
-\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}
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+
+
+
+
+
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+Search path
+\end_layout
- 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
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+default
+\end_layout
-.
-\layout Section
+\end_inset
+
+
+\begin_inset Text
-Reading the Documentation
-\begin_inset LatexCommand \index{Documentation}
+\begin_layout Standard
+Win32 builds
+\end_layout
-\end_inset
+\end_inset
+
+
+
+
+\begin_inset Text
+\begin_layout Standard
+-
+\begin_inset ERT
+status collapsed
-\layout Standard
+\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
+\backslash
+/
+\end_layout
-If you should know why please drop us a note
-\end_inset
+\end_inset
-.
-
-\newline
-You'll find the pdf version
-\begin_inset LatexCommand \index{PDF version of this document}
+-I dir
+\end_layout
-\end_inset
+\end_inset
+
+
+\begin_inset Text
- at
-\begin_inset LatexCommand \url{http://sdcc.sf.net/doc/sdccman.pdf}
+\begin_layout Standard
+-
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Standard
-.
-
-\newline
-A html version
-\begin_inset LatexCommand \index{HTML version of this document}
-\end_inset
+\backslash
+/
+\end_layout
- should be online at
-\begin_inset LatexCommand \url{http://sdcc.sf.net/doc/sdccman.html/index.html}
+\end_inset
-\end_inset
+-I dir
+\end_layout
-.
-\newline
-This documentation is in some aspects different from a commercial documentation:
-
-\layout Itemize
+\end_inset
+
+
+\begin_inset Text
-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}
+\begin_layout Standard
+-
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Standard
- 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
-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}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
- together with a statement
-\begin_inset Quotes sld
-\end_inset
+-I dir
+\end_layout
-some processors which are targetted by SDCC can be implemented in a
-\emph on
-f
-\emph default
-ield
-\emph on
-p
-\emph default
-rogrammable
-\emph on
-g
-\emph default
-ate
-\emph on
-a
-\emph default
-rray
-\begin_inset LatexCommand \index{FPGA (field programmable gate array)}
+\end_inset
+
+
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+$SDCC_INCLUDE
+\end_layout
+\end_inset
+
+
+\begin_inset Text
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Standard
+$SDCC_INCLUDE
+\end_layout
- or
-\begin_inset LatexCommand \url{http://sf.net/projects/fpgac}
+\end_inset
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+$SDCC_INCLUDE
+\end_layout
+\end_inset
+
+
+
+
+\begin_inset Text
-\begin_inset LatexCommand \index{FpgaC ((subset of) C to FPGA compiler)}
+\begin_layout Standard
+$SDCC_HOME/
+\newline
-\end_inset
+\emph on
+$PREFIX2DATA_DIR/
+\newline
+$INCLUDE_DIR_SUFFIX
+\end_layout
-
-\begin_inset Quotes sld
-\end_inset
+\end_inset
+
+
+\begin_inset Text
-have you ever heard of an open source compiler that compiles a subset of
- C for an FPGA?
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Standard
+$SDCC_ HOME/
+\newline
+share/sdcc/
+\newline
+include
+\end_layout
- 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_inset
+
+
+\begin_inset Text
-Some sections attribute more space to problems, restrictions and warnings
- than to the solution.
-\layout Itemize
-
-The installation section and the section about the debugger is intimidating.
-\layout Itemize
+\begin_layout Standard
+$SDCC_HOME
+\backslash
+include
+\end_layout
-There are still lots of typos and there are more different writing styles
- than pictures.
-\layout Section
+\end_inset
+
+
+
+
+\begin_inset Text
-Testing the SDCC Compiler
-\begin_inset LatexCommand \label{sec:Testing-the-SDCC}
+\begin_layout Standard
+path(argv[0])/
+\newline
-\end_inset
+\emph on
+$BIN2DATADIR/
+\emph default
+\newline
-\layout Standard
+\emph on
+$INCLUDE_DIR_SUFFIX
+\end_layout
-The first thing you should do after installing your SDCC compiler is to
- see if it runs.
- Type
-\family sans
-\series bold
-"sdcc -
-\begin_inset ERT
-status Collapsed
+\end_inset
+
+
+\begin_inset Text
-\layout Standard
+\begin_layout Standard
+path(argv[0])/
+\newline
+../sdcc/include
+\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 ~
-\backslash
-/
-\end_inset
+\end_layout
--version"
-\begin_inset LatexCommand \index{version}
+\end_inset
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+path(argv[0])
+\backslash
+..
+\backslash
+include
+\end_layout
+\end_inset
+
+
+
+
+\begin_inset Text
-\family default
-\series default
- at the prompt, and the program should run and output its version like:
-
-\newline
+\begin_layout Standard
-\family typewriter
-SDCC : mcs51/z80/avr/ds390/pic16/pic14/ds400/hc08 2.5.6 #4169 (May 8 2006)
- (UNIX)
-\layout Standard
+\emph on
+$DATADIR/
+\emph default
-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
-see
-\series default
-section
-\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
+\newline
-\end_inset
+\emph on
+$INCLUDE_DIR_SUFFIX
+\end_layout
-\SpecialChar ~
+\end_inset
+
+
+\begin_inset Text
-\series medium
-Install trouble-shooting for suggestions
-\series default
-).
- Make sure that the sdcc program is in the bin folder, if not perhaps something
- did not install correctly.
-\newline
+\begin_layout Standard
+/usr/local/share/sdcc/
+\newline
+include
+\end_layout
-\newline
+\end_inset
+
+
+\begin_inset Text
-\series medium
-SDCC
-\series default
-is commonly installed as described in section
-\begin_inset Quotes sld
-\end_inset
+\begin_layout Standard
+(not on Win32)
+\end_layout
-Install and search paths
-\begin_inset Quotes srd
-\end_inset
+\end_inset
+
+
+
-.
-\newline
+\end_inset
-\newline
+
+\newline
-\series medium
-Make sure the compiler works on a very simple example.
- Type in the following test.c program using your favorite
-\series default
-ASCII
-\series medium
-editor:
-\layout Verse
+\end_layout
+\begin_layout Standard
+\noindent
+The option -
+\begin_inset ERT
+status collapsed
-\family typewriter
-char test;
-\newline
+\begin_layout Standard
-\newline
-void main(void) {
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-test=0;
-\newline
-}
-\layout Standard
+\backslash
+/
+\end_layout
-\series medium
-Compile this using the following command:
-\family sans
-\series bold
-"sdcc -c test.c".
+\end_inset
-\family default
-\series default
-
-\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
+-nostdinc disables the last two search paths.
+\newline
-\newline
+\newline
+3.
+ Library files
+\newline
-\newline
+\end_layout
-\series medium
-The next step is to try it with the linker.
- Type in
-\family sans
-\series bold
-"sdcc test.c
-\family default
-\series default
-"
-\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 medium
-(no test.ihx, and the linker generates warnings), then the problem is most
- likely that
-\series default
-SDCC
-\series medium
- cannot find the
-\series default
-/
-\series medium
-usr/local/share/sdcc/lib directory
-\series default
-
-\series medium
-(see
-\series default
-section
-\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
+\begin_layout Standard
+With the exception of
+\begin_inset Quotes sld
+\end_inset
-\end_inset
+-
+\begin_inset ERT
+status collapsed
-\SpecialChar ~
+\begin_layout Standard
-\series medium
-Install trouble-shooting for suggestions).
-\series default
-\newline
+\backslash
+/
+\end_layout
-\newline
+\end_inset
-\series medium
-The final test is to ensure
-\series default
-SDCC
-\series medium
- can use the
-\series default
-standard
-\series medium
- header files and libraries.
- Edit test.c and change it to the following:
-\layout Verse
+-L dir
+\begin_inset Quotes srd
+\end_inset
+ the
+\shape italic
+model
+\shape default
+ is auto-appended by the compiler (e.g.
+ small, large, z80, ds390 etc.).
+
+\newline
-\family typewriter
-#include
-\newline
+\end_layout
-\newline
-char str1[10];
-\newline
+\begin_layout Standard
+\align center
+\begin_inset Tabular
+
+
+
+
+
+
+
+\begin_inset Text
-\newline
-void main(void) {
-\newline
-\SpecialChar ~
-\SpecialChar ~
-strcpy(str1, "testing");
-\newline
-}
-\layout Standard
+\begin_layout Standard
+Search path
+\end_layout
+\end_inset
+
+
+\begin_inset Text
-\series medium
-Compile this by typing
-\family sans
-\series bold
-"sdcc test.c"
-\family default
-\series medium
-.
- This should generate a test.ihx output file, and it should give no warnings
- such as not finding the string.h file.
- If it cannot find the string.h file, then the problem is that
-\series default
-SDCC
-\series medium
- cannot find the /usr/local/share/sdcc/include directory
-\series default
-
-\series medium
-(see the
-\series default
-section
-\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
+\begin_layout Standard
+default
+\end_layout
-\end_inset
+\end_inset
+
+
+\begin_inset Text
-\SpecialChar ~
+\begin_layout Standard
+Win32 builds
+\end_layout
-\series medium
-Install trouble-shooting section for suggestions).
+\end_inset
+
+
+
+
+\begin_inset Text
-\series default
- Use option
-\series bold
+\begin_layout Standard
-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
+status collapsed
--print-search-dirs
-\series default
-
-\begin_inset LatexCommand \index{-\/-print-search-dirs}
+\begin_layout Standard
-\end_inset
- to find exactly where SDCC is looking for the include and lib files.
-\layout Section
+\backslash
+/
+\end_layout
-Install Trouble-shooting
-\begin_inset LatexCommand \label{sub:Install-Trouble-shooting}
+\end_inset
-\end_inset
+-L dir
+\end_layout
+\end_inset
+
+
+\begin_inset Text
-\begin_inset LatexCommand \index{Install trouble-shooting}
+\begin_layout Standard
+-
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Standard
-\layout Subsection
+\backslash
+/
+\end_layout
-If SDCC does not build correctly
-\layout Standard
+\end_inset
-A thing to try is starting from scratch by unpacking the .tgz source package
- again in an empty directory.
- Configure it like:
-\newline
+-L dir
+\end_layout
-\newline
+\end_inset
+
+
+\begin_inset Text
-\family sans
-\series bold
-./configure 2>&1 | tee configure.log
-\family default
-\series default
+\begin_layout Standard
+-
+\begin_inset ERT
+status collapsed
-\newline
+\begin_layout Standard
-\newline
-and build it like:
-\newline
-\newline
+\backslash
+/
+\end_layout
-\family sans
-\series bold
-make 2>&1 | tee make.log
-\family default
-\series default
+\end_inset
-\newline
+-L dir
+\end_layout
-\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
-
-What the
-\begin_inset Quotes sld
-\end_inset
+\end_inset
+
+
+
+
+\begin_inset Text
-./configure
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Standard
+$SDCC_LIB/
+\newline
- does
-\layout Standard
+\emph on
+
+\end_layout
-The
-\begin_inset Quotes sld
-\end_inset
+\end_inset
+
+
+\begin_inset Text
-./configure
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Standard
+$SDCC_LIB/
+\newline
- 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
+\emph on
+
+\end_layout
-What the
-\begin_inset Quotes sld
-\end_inset
+\end_inset
+
+
+\begin_inset Text
-make
-\begin_inset Quotes srd
-\end_inset
+\begin_layout Standard
+$SDCC_LIB
+\backslash
- does
-\layout Standard
+\newline
-This runs the GNU make tool, which automatically compiles all the source
- packages into the final installed binary executables.
-\layout Subsection
+\emph on
+
+\end_layout
-What the
-\begin_inset Quotes sld
-\end_inset
+\end_inset
+
+
+
+
+\begin_inset Text
-make install
-\begin_inset Quotes erd
-\end_inset
+\begin_layout Standard
+$SDCC_HOME/
+\newline
- command does.
-\layout Standard
+\emph on
+$PREFIX2DATA_DIR/
+\newline
+$LIB_DIR_SUFFIX/
+\end_layout
-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
+
+
+\begin_inset Text
-\end_inset
+\begin_layout Standard
+$SDCC_HOME/
+\newline
+share/sdcc/
+\newline
+lib/
+\emph on
+
+\end_layout
-,\SpecialChar ~
+\end_inset
+
+
+\begin_inset Text
-\begin_inset LatexCommand \ref{sub:Search-Paths}
+\begin_layout Standard
+$SDCC_HOME
+\backslash
+lib
+\backslash
-\end_inset
+\emph on
-\SpecialChar ~
-about install and search paths.
-\newline
-On most systems you will need super-user privileges to do this.
-\layout Section
+\newline
+
+\end_layout
-Components of SDCC
-\layout Standard
+\end_inset
+
+
+
+
+\begin_inset Text
-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.
- Note that the included simulator and assembler have separate documentation
- 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
+\begin_layout Standard
+path(argv[0])/
+\newline
-\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
-In /bin:
-\layout Itemize
+\emph on
+$BIN2DATADIR/
+\emph default
-sdcc - The compiler.
-\layout Itemize
+\newline
-sdcpp - The C preprocessor.
-\layout Itemize
+\emph on
+$LIB_DIR_SUFFIX/
+\end_layout
-asx8051 - The assembler for 8051 type processors.
-\layout Itemize
+\end_inset
+
+
+\begin_inset Text
-as-z80
-\series bold
-,
-\series default
-as-gbz80 - The Z80 and GameBoy Z80 assemblers.
-\layout Itemize
+\begin_layout Standard
+path(argv[0])/
+\newline
+../sdcc/lib/
+\emph on
+
+\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 ~
-aslink -The linker for 8051 type processors.
-\layout Itemize
+\end_layout
-link-z80
-\series bold
-,
-\series default
-link-gbz80 - The Z80 and GameBoy Z80 linkers.
-\layout Itemize
+\end_inset
+
+
+\begin_inset Text
-s51 - The ucSim 8051 simulator.
-\layout Itemize
+\begin_layout Standard
+path(argv[0])
+\backslash
-sdcdb - The source debugger.
-\layout Itemize
+\newline
+..
+\backslash
+lib
+\backslash
-packihx - A tool to pack (compress) Intel hex files.
-\layout Standard
+\emph on
+
+\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 ~
-In /share/sdcc/include
-\layout Itemize
+\end_layout
-the include files
-\layout Standard
+\end_inset
+
+
+
+
+\begin_inset Text
-In /share/sdcc/lib
-\layout Itemize
+\begin_layout Standard
-the subdirs src and small, large, z80, gbz80 and ds390 with the precompiled
- relocatables.
-\layout Standard
+\emph on
+$DATADIR/
+\newline
+$LIB_DIR_SUFFIX/
+\end_layout
-In /share/sdcc/doc
-\layout Itemize
+\end_inset
+
+
+\begin_inset Text
-the documentation
-\layout Standard
+\begin_layout Standard
+/usr/local/share/sdcc/
+\newline
+lib/
+\emph on
+
+\end_layout
-As development for other processors proceeds, this list will expand to include
- executables to support processors like AVR, PIC, etc.
-\layout Subsection
+\end_inset
+
+
+\begin_inset Text
-sdcc - The Compiler
-\layout Standard
+\begin_layout Standard
+(not on Win32)
+\end_layout
-This is the actual compiler, it in turn uses the c-preprocessor and invokes
- the assembler and linkage editor.
-\layout Subsection
+\end_inset
+
+
+
-sdcpp - The C-Preprocessor
-\layout Standard
+\end_inset
-The preprocessor
-\begin_inset LatexCommand \index{sdcpp (preprocessor)}
-\end_inset
+\newline
- is a modified version of the GNU cpp
-\begin_inset LatexCommand \index{cpp|see{sdcpp}}
+\end_layout
-\end_inset
+\begin_layout Standard
+\begin_inset Note Note
+status collapsed
- preprocessor
-\begin_inset LatexCommand \url{http://gcc.gnu.org/}
+\begin_layout Standard
+Don't delete any of the stray spaces in the table above without checking
+ the HTML output (last line)!
+\end_layout
-\end_inset
+\end_inset
-.
- The C preprocessor is used to pull in #include sources, process #ifdef
- statements, #defines and so on.
-\layout Subsection
-as
-\emph on
-xxxx
-\emph default
-, aslink, link-
-\emph on
-xxx
-\emph default
- - The Assemblers and Linkage Editors
-\layout Standard
+\end_layout
-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
+\begin_layout Standard
+\InsetSpace ~
-s51 - The Simulator
-\layout Standard
+\newline
+The option -
+\begin_inset ERT
+status collapsed
-S51
-\begin_inset LatexCommand \index{s51}
+\begin_layout Standard
-\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}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
-.
- It currently supports the core mcs51, the Dallas DS80C390 and the Phillips
- XA51 family.
-\layout Subsection
+-nostdlib disables the last two search paths.
+\end_layout
-sdcdb - Source Level Debugger
-\layout Standard
+\begin_layout Section
+Building SDCC
+\begin_inset LatexCommand index
+name "Building SDCC"
-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_layout
-\end_inset
+\begin_layout Subsection
+Building SDCC on Linux
+\begin_inset LatexCommand label
+name "sub:Building-SDCC-on-Linux"
-.
- 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
-Using SDCC
-\layout Section
+\begin_layout Enumerate
-Compiling
-\layout Subsection
+\series medium
+Download the source package
+\series default
+ either from the SDCC Subversion repository or from snapshot builds
+\series medium
+, it will be named something like sdcc
+\series default
+-src
+\series medium
+-yyyymmdd-rrrr.t
+\series default
+ar.
+\series medium
+bz2
+\series default
+
+\begin_inset LatexCommand url
+target "http://sdcc.sourceforge.net/snap.php"
-Single Source File Projects
-\layout Standard
+\end_inset
-For single source file 8051 projects the process is very simple.
- Compile your programs with the following command
-\family sans
-\series bold
-"sdcc sourcefile.c".
+.
+\end_layout
-\family default
-\series default
- This will compile, assemble and link your source file.
- Output files are as follows:
-\layout Itemize
+\begin_layout Enumerate
-sourcefile.asm
-\begin_inset LatexCommand \index{.asm}
+\series medium
+Bring up a command line terminal, such as xterm.
+\end_layout
-\end_inset
+\begin_layout Enumerate
- - Assembler source
-\begin_inset LatexCommand \index{Assembler source}
+\series medium
+Unpack the file using a command like:
+\series default
+
+\family sans
+\series bold
+"tar -xvzf sdcc-src-yyyymmdd-rrrr.tar.bz2
+\begin_inset Quotes srd
+\end_inset
-\end_inset
- file created by the compiler
-\layout Itemize
+\family default
+\series medium
+, this will create a sub-directory called sdcc with all of the sources.
+\end_layout
-sourcefile.lst
-\begin_inset LatexCommand \index{.lst}
+\begin_layout Enumerate
+Change directory into the main SDCC directory, for example type:
+\family sans
+\series bold
+"cd sdcc
+\series default
+".
+\end_layout
-\end_inset
+\begin_layout Enumerate
- - Assembler listing
-\begin_inset LatexCommand \index{Assembler listing}
+\series medium
+Type
+\series default
+
+\family sans
+\series bold
+"./configure
+\family default
+\series default
+".
+ This configures the package for compilation on your system.
+\end_layout
-\end_inset
+\begin_layout Enumerate
- file created by the Assembler
-\layout Itemize
+\series medium
+Type
+\series default
+
+\family sans
+\series bold
+"make
+\family default
+\series default
+"
+\series medium
+.
-sourcefile.rst
-\begin_inset LatexCommand \index{.rst}
+\series default
+ All of the source packages will compile, this can take a while.
+\end_layout
-\end_inset
+\begin_layout Enumerate
- - Assembler listing
-\begin_inset LatexCommand \index{Assembler listing}
+\series medium
+Type
+\series default
+
+\family sans
+\series bold
+"make install"
+\family default
+\series default
+ as root
+\series medium
+.
-\end_inset
+\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
+reference "sec:Testing-the-SDCC"
- file updated with linkedit information, created by linkage editor
-\layout Itemize
+\end_inset
-sourcefile.sym
-\begin_inset LatexCommand \index{.sym}
+.
+\end_layout
-\end_inset
+\begin_layout Subsection
+Building SDCC on Mac OS X
+\end_layout
- - symbol listing
-\begin_inset LatexCommand \index{Symbol listing}
+\begin_layout Standard
+Follow the instruction for Linux.
+\newline
-\end_inset
+\newline
+On Mac OS X 10.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:
+\end_layout
- for the sourcefile, created by the assembler
-\layout Itemize
+\begin_layout LyX-Code
+./configure CC=gcc2 CXX=g++2
+\end_layout
-sourcefile.rel
-\begin_inset LatexCommand \index{.rel}
+\begin_layout Standard
+Universal (ppc and i386) binaries can be produced on Mac OS X 10.4.x with
+ Xcode.
+ Run 'configure' with:
+\end_layout
-\end_inset
+\begin_layout LyX-Code
+./configure
+\backslash
- or sourcefile.o
-\begin_inset LatexCommand \index{.o}
+\end_layout
-\end_inset
+\begin_layout LyX-Code
+LDFLAGS="-Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch
+ ppc"
+\backslash
- - Object file
-\begin_inset LatexCommand \index{Object file}
+\end_layout
-\end_inset
+\begin_layout LyX-Code
+CXXFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch
+ ppc"
+\backslash
- created by the assembler, input to Linkage editor
-\layout Itemize
+\end_layout
-sourcefile.map
-\begin_inset LatexCommand \index{.map}
+\begin_layout LyX-Code
+CFLAGS = "-O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch i386 -arch ppc"
+\end_layout
-\end_inset
+\begin_layout Subsection
+Cross compiling SDCC on Linux for Windows
+\end_layout
- - The memory map
-\begin_inset LatexCommand \index{Memory map}
+\begin_layout Standard
+With the Mingw32 gcc cross compiler it's easy to compile SDCC for Win32.
+ See section 'Configure Options'.
+\end_layout
-\end_inset
+\begin_layout Subsection
+Building SDCC using Cygwin and Mingw32
+\end_layout
- for the load module, created by the Linker
-\layout Itemize
+\begin_layout Standard
+For building and installing a Cygwin executable follow the instructions
+ for Linux.
+\newline
-sourcefile.mem
-\begin_inset LatexCommand \index{.mem}
+\newline
+On Cygwin a
+\begin_inset Quotes sld
+\end_inset
-\end_inset
+native
+\begin_inset Quotes srd
+\end_inset
- - A file with a summary of the memory usage
-\layout Itemize
+ 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
-sourcefile.ihx
-\begin_inset LatexCommand \index{.ihx}
+\newline
+In order to install
+ Cygwin on Windows download setup.exe from
+\begin_inset LatexCommand url
+name "www.cygwin.com"
+target "http://www.cygwin.com/"
-\end_inset
+\end_inset
- - The load module in Intel hex format
-\begin_inset LatexCommand \index{Intel hex format}
+.
+ Run it, set the
+\begin_inset Quotes sld
+\end_inset
-\end_inset
+default text file type
+\begin_inset Quotes srd
+\end_inset
- (you can select the Motorola S19 format
-\begin_inset LatexCommand \index{Motorola S19 format}
+ to
+\begin_inset Quotes sld
+\end_inset
-\end_inset
+unix
+\begin_inset Quotes srd
+\end_inset
- with -
-\begin_inset ERT
-status Collapsed
+ 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!
+\end_layout
-\layout Standard
+\begin_layout Itemize
+flex
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Itemize
+bison
+\end_layout
--out-fmt-s19
-\begin_inset LatexCommand \index{-\/-out-fmt-s19}
+\begin_layout Itemize
+gcc ; version 3.x is fine, no need to use the old 2.9x
+\end_layout
-\end_inset
+\begin_layout Itemize
+binutils ; selected with gcc
+\end_layout
-.
- If you need another format you might want to use
-\family sans
-\shape italic
-objdump
-\family default
-\shape default
+\begin_layout Itemize
+make
+\end_layout
+
+\begin_layout Itemize
+rxvt ; a nice console, which makes life much easier under windoze (see below)
+\end_layout
-\begin_inset LatexCommand \index{objdump (tool)}
+\begin_layout Itemize
+man ; not really needed for building SDCC, but you'll miss it sooner or
+ later
+\end_layout
-\end_inset
+\begin_layout Itemize
+less ; not really needed for building SDCC, but you'll miss it sooner or
+ later
+\end_layout
- or
-\family sans
-\shape italic
- srecord
-\family default
-\shape default
+\begin_layout Itemize
+svn ; only if you use Subversion access
+\end_layout
-\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
+\begin_layout Standard
+If you want to develop something you'll need:
+\end_layout
-\end_inset
+\begin_layout Itemize
+python ; for the regression tests
+\end_layout
-).
- Both formats are documented in the documentation of srecord
-\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
+\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
-\layout Itemize
+\end_layout
-sourcefile.adb
-\begin_inset LatexCommand \index{.adb}
+\begin_layout Itemize
+openssh ; to access the CF or commit changes
+\end_layout
-\end_inset
+\begin_layout Itemize
+autoconf and autoconf-devel ; if you want to fight with 'configure', don't
+ use autoconf-stable!
+\end_layout
- - An intermediate file containing debug information needed to create the
- .cdb file (with -
+\begin_layout Standard
+rxvt is a nice console with history.
+ Replace in your cygwin.bat the line
+\end_layout
+
+\begin_layout LyX-Code
+bash -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
--debug
-\begin_inset LatexCommand \index{-\/-debug}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
-)
-\layout Itemize
+-login -i
+\end_layout
-sourcefile.cdb
-\begin_inset LatexCommand \index{.cdb}
+\begin_layout Standard
+with (one line):
+\end_layout
-\end_inset
+\begin_layout LyX-Code
+rxvt -sl 1000 -fn "Lucida Console-12" -sr -cr red
+\end_layout
- - An optional file (with -
+\begin_layout LyX-Code
+ -bg black -fg white -geometry 100x65 -e bash -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--debug) containing debug information.
- The format is documented in cdbfileformat.pdf
-\layout Itemize
+\begin_layout Standard
-sourcefile.
- - (no extension)
-\begin_inset LatexCommand \index{ (no extension)}
-\end_inset
+\backslash
+/
+\end_layout
- An optional AOMF or AOMF51
-\begin_inset LatexCommand \index{AOMF, AOMF51}
+\end_inset
-\end_inset
+-login
+\end_layout
-
-\begin_inset LatexCommand \label{OMF file}
+\begin_layout Standard
+Text selected with the mouse is automatically copied to the clipboard, pasting
+ works with shift-insert.
+\newline
-\end_inset
+\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
-file containing debug information (generated with option -
-\begin_inset ERT
-status Collapsed
+cygdrive
+\begin_inset Quotes srd
+\end_inset
-\layout Standard
+ is too long, you can change it with e.g.
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout LyX-Code
+mount -s -u -c /mnt
+\end_layout
--debug).
- The (Intel)
-\emph on
- a
-\emph default
-bsolute
-\emph on
-o
-\emph default
-bject
-\emph on
-m
-\emph default
-odule
-\emph on
-f
-\emph default
-ormat is commonly used by third party tools (debuggers
-\begin_inset LatexCommand \index{Debugger}
-
-\end_inset
-
-, simulators, emulators)
-\layout Itemize
+\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.
+ And use an editor which can handle LF-only line endings.
+ Make sure not to commit files with windows line endings.
+ The tabulator spacing
+\begin_inset LatexCommand index
+name "tabulator spacing (8 columns)"
-sourcefile.dump*
-\begin_inset LatexCommand \index{.dump*}
+\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.
+\end_layout
- - Dump file to debug the compiler it self (generated with option -
-\begin_inset ERT
-status Collapsed
+\begin_layout Subsection
+Building SDCC Using Microsoft Visual C++ 6.0/NET (MSVC)
+\end_layout
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
+\series medium
+Download the source package
+\series default
+ either from the SDCC Subversion repository or from the
+\begin_inset LatexCommand url
+name "snapshot builds"
+target "http://sdcc.sourceforge.net/snap.php"
--dumpall) (see section
-\begin_inset LatexCommand \ref{sub:Intermediate-Dump-Options}
+\end_inset
-\end_inset
-\SpecialChar ~
- and section
-\begin_inset LatexCommand \ref{sub:The-anatomy-of}
+\series medium
+, it will be named something like sdcc
+\series default
+-src
+\series medium
+-yyyymmdd-rrrr.tar.bz2.
-\end_inset
+\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
+bin_vc.
+ Once built you need to copy the executables from sdcc
+\backslash
+bin_vc to sdcc
+\backslash
+bin before running SDCC.
+
+\newline
-\SpecialChar ~
+\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
+ client to convert automatically for you.
+ If however you are getting a message such as "This makefile was not generated
+ by Developer Studio etc.
+ etc.
+\begin_inset Quotes srd
+\end_inset
+ 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
-Anatomy of the compiler
+unix2dos
\begin_inset Quotes srd
-\end_inset
+\end_inset
-).
-\layout Subsection
+ utility freely available on the internet.
+ Doug Hawkins reported in the sdcc-user list that this works:
+\newline
-Postprocessing the Intel Hex
-\begin_inset LatexCommand \index{Intel hex format}
+\newline
+C:
+\backslash
+Programming
+\backslash
+SDCC> unix2dos sdcc.dsw
+\newline
+C:
+\backslash
+Programming
+\backslash
+SDCC> for /R %I in (*.dsp) do @unix2dos "%I"
+\newline
-\end_inset
+\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
+name "here"
+target "http://unxutils.sourceforge.net"
- file
-\layout Standard
+\end_inset
-In most cases this won't be needed but the Intel Hex file
-\begin_inset LatexCommand \index{.ihx}
-\end_inset
+\newline
- 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
-packihx
-\family default
+\newline
+Download the file UnxUtils
+\begin_inset LatexCommand index
+name "UnxUtils"
-\begin_inset LatexCommand \index{packihx (tool)}
+\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!):
+\end_layout
- which is part of the SDCC distribution:
-\newline
+\begin_layout Enumerate
+The easy way:
+\newline
-\newline
+\newline
+a) Extract UnxUtils.zip to your C:
+\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
-\family sans
-\series bold
- packihx sourcefile.ihx >sourcefile.hex
-\family default
-\series default
+\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
+user
+\backslash
+local
+\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.)
+\end_layout
-\newline
-The separately available
-\emph on
- srecord
-\emph default
+\begin_layout Enumerate
+A more compact way:
+\newline
-\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
+\newline
+This one avoids extracting a bunch of files you may not
+ use, but requires some extra work:
+\newline
-\end_inset
+\newline
+a) Create a directory were to put the
+ tools needed, or use a directory already present.
+ Say for example 'C:
+\backslash
+util'.
+\newline
- package additionally allows to set undefined locations to a predefined
- value, to insert checksums
-\begin_inset LatexCommand \index{checksum}
+\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
-\end_inset
+\newline
+c
+) Rename bison.exe to '_bison.exe'.
+\newline
- of various flavours (crc, add, xor) and to perform other manipulations
- (convert, split, crop, offset, ...).
-
-\newline
+\newline
+d) Create a batch file 'bison.bat' in 'C:
+\backslash
+util
+\backslash
+' and add these lines:
+\newline
+\InsetSpace ~
+\InsetSpace ~
+set BISON_SIMPLE=C:
+\backslash
+util
+\backslash
+bison.simple
+\newline
+\InsetSpace ~
+\InsetSpace ~
+set BISON_HAIRY=C:
+\backslash
+util
+\backslash
+bison.hairy
+\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.
+ 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
-\family sans
-\series bold
-srec_cat\SpecialChar ~
-\SpecialChar ~
-sourcefile.ihx -intel\SpecialChar ~
-\SpecialChar ~
--o sourcefile.hex -intel
-\newline
+\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
+util', click ok.
+ Note that you can use any other path instead of 'c:
+\backslash
+util', even the path where the Visual C++ tools are, probably: 'C:
+\backslash
+Program Files
+\backslash
+Microsoft Visual Studio
+\backslash
+Common
+\backslash
+Tools'.
+ So you don't have to execute step 'e' :)
+\end_layout
-\newline
+\begin_layout Standard
+That is it.
+ Open 'sdcc.dsw' in Visual Studio, click 'build all', when it finishes copy
+ the executables from sdcc
+\backslash
+bin_vc to sdcc
+\backslash
+bin, and you can compile using SDCC.
+\end_layout
-\family default
-\series default
-An example for a more complex command line
-\begin_inset Foot
-collapsed false
+\begin_layout Subsection
+Building SDCC Using Borland
+\end_layout
-\layout Standard
+\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.
+\end_layout
-the command backfills
-\begin_inset LatexCommand \index{backfill unused memory}
+\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
-\end_inset
+\newline
- 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
-lcall
-\family default
- to address
-\family typewriter
-0x1212
-\family default
- (where an emergency routine could sit).
-\end_inset
+\family sans
+\series bold
+find .
+
+\backslash
+( -name '*.obj' -o -name '*.lib' -o -name '*.rul'
+\backslash
+) -print -exec rm {}
+\backslash
+;
+\family default
+\series default
- could look like:
-\newline
+\newline
-\newline
+\newline
+or on Windows NT/2000/XP from the command prompt with the command:
+\newline
-\family sans
-\series bold
-\size footnotesize
-srec_cat\SpecialChar ~
-sourcefile.ihx -intel\SpecialChar ~
-\SpecialChar ~
--fill 0x12 0x0000 0xfffe\SpecialChar ~
--little-endian-checksum-nega
-tive 0xfffe 0x02 0x02\SpecialChar ~
-\SpecialChar ~
--o sourcefile.hex -intel
-\size default
+\family sans
+\series bold
-\newline
+\newline
+del /s *.obj *.lib *.rul
+\family default
+\series default
+ from the sdcc directory.
+\end_layout
-\newline
+\begin_layout Subsection
+Windows Install Using a ZIP Package
+\end_layout
-\family default
-\series default
-The srecord package is available at
-\begin_inset LatexCommand \url{http://sf.net/projects/srecord}
+\begin_layout Enumerate
+Download the binary zip package from
+\begin_inset LatexCommand url
+target "http://sdcc.sf.net/snap.php"
-\end_inset
+\end_inset
- .
-\layout Subsection
+ 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
+sdcc
+\backslash
+bin for the executables, c:
+\backslash
+sdcc
+\backslash
+include and c:
+\backslash
+sdcc
+\backslash
+lib for the include and libraries.
+\end_layout
-Projects with Multiple Source Files
-\layout Standard
+\begin_layout Enumerate
+Adjust your environment variable PATH to include the location of the bin
+ directory or start sdcc using the full path.
+\end_layout
-SDCC can compile only ONE file at a time.
- Let us for example assume that you have a project containing the following
- files:
-\newline
+\begin_layout Subsection
+Windows Install Using the Setup Program
+\begin_inset LatexCommand label
+name "sub:Windows-Install"
-\newline
-foo1.c (contains some functions)
-\newline
-foo2.c (contains some more functions)
-\newline
-foomain.c (contains more functions and the function main)
-\newline
+\end_inset
-\size footnotesize
-\newline
+\end_layout
-\size default
-The first two files will need to be compiled separately with the commands:
-\size footnotesize
-
-\size default
+\begin_layout Standard
+Download the setup program
+\emph on
+sdcc-x.y.z-setup.exe
+\emph default
+ for an official release from
+\newline
-\newline
+\begin_inset LatexCommand url
+target "http://sf.net/project/showfiles.php?group_id=599"
-\newline
+\end_inset
-\family sans
-\series bold
-sdcc\SpecialChar ~
--c\SpecialChar ~
-foo1.c
-\family default
-\series default
-\size footnotesize
+ or a setup program for one of the snapshots
+\emph on
+sdcc-yyyymmdd-xxxx-setup.exe
+\emph default
+ from
+\begin_inset LatexCommand url
+target "http://sdcc.sf.net/snap.php"
-\newline
+\end_inset
-\family sans
-\series bold
-\size default
-sdcc\SpecialChar ~
--c\SpecialChar ~
-foo2.c
-\family default
-\series default
+ and execute it.
+ A windows typical installer will guide you through the installation process.
+\end_layout
-\newline
+\begin_layout Subsection
+VPATH
+\begin_inset LatexCommand index
+name "VPATH"
-\newline
-Then compile the source file containing the
-\emph on
-main()
-\emph default
- function and link
-\begin_inset LatexCommand \index{Linker}
+\end_inset
-\end_inset
+ feature
+\end_layout
- the files together with the following command:
-\newline
+\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:
+\end_layout
-\newline
+\begin_layout Standard
-\family sans
-\series bold
-sdcc\SpecialChar ~
-foomain.c\SpecialChar ~
-foo1.rel\SpecialChar ~
-foo2.rel
-\family default
-\series default
+\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
+\end_layout
-\begin_inset LatexCommand \index{.rel}
+\begin_layout Standard
-\end_inset
+\family typewriter
+tar -xzf sdcc.src.tar.gz\InsetSpace ~
+# extract source to directory sdcc
+\end_layout
+\begin_layout Standard
-\newline
+\family typewriter
+mkdir sdcc.build\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+# put output in sdcc.build
+\end_layout
-\newline
-Alternatively,
-\emph on
-foomain.c
-\emph default
-can be separately compiled as well:
-\family sans
-\series bold
-
-\newline
-
-\newline
-sdcc\SpecialChar ~
--c\SpecialChar ~
-foomain.c
-\newline
-sdcc foomain.rel foo1.rel foo2.rel
-\newline
+\begin_layout Standard
-\newline
+\family typewriter
+cd sdcc.build
+\end_layout
-\family default
-\series default
-The file containing the
-\emph on
-main()
-\emph default
- function
-\emph on
-
-\emph default
-\noun on
-must
-\noun default
- be the
-\noun on
-first
-\noun default
- file specified in the command line, since the linkage editor processes
- file in the order they are presented to it.
- The linker is invoked from SDCC using a script file with extension .lnk
-\begin_inset LatexCommand \index{.lnk}
+\begin_layout Standard
-\end_inset
+\family typewriter
+../sdcc/configure\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+# configure is doing all the magic!
+\end_layout
-.
- You can view this file to troubleshoot linking problems such as those arising
- from missing libraries.
-\layout Subsection
+\begin_layout Standard
-Projects with Additional Libraries
-\begin_inset LatexCommand \index{Libraries}
+\family typewriter
+make
+\end_layout
-\end_inset
+\begin_layout Standard
+\noindent
+That's it!
+\series bold
+configure
+\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
+make
+\series default
+ the generated files will be in ~/sdcc.build, while the source files stay
+ in ~/sdcc.
+\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
+ generated files are not scattered between the source files.
+ And the best thing is: if you want to change a file you can leave the original
+ file untouched in the source directory.
+ Simply copy it to the build directory, edit it, enter `make clean', `rm
+ Makefile.dep' and `make'.
+
+\series bold
+make
+\series default
+ will do the rest for you!
+\end_layout
+\begin_layout Section
+Building the Documentation
+\end_layout
-\layout Standard
+\begin_layout Standard
+Add -
+\begin_inset ERT
+status collapsed
-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
-.lib
-\begin_inset LatexCommand \index{.lib}
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\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
-foomain.c
-\emph default
- and a library
-\emph on
- foolib.lib
-\emph default
- in the directory
-\emph on
-mylib
-\emph default
- (if that is not the same as your current project):
-\newline
+\end_inset
-\newline
+-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
-sdcc foomain.c foolib.lib -L mylib
-\newline
+\begin_inset Quotes srd
+\end_inset
-\newline
+make
+\begin_inset Quotes srd
+\end_inset
-\family default
-\series default
-Note here that
-\emph on
- mylib
-\emph default
- must be an absolute path name.
-\newline
-\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}
+\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
+target "http://www.lyx.org"
-\end_inset
+\end_inset
- files.
- For an example see the standard library file
-\emph on
-libsdcc.lib
-\emph default
- in the directory /share/lib/small.
-\layout Subsection
+ as editor is straightforward.
+ Prebuilt documentation in html and pdf format is available from
+\begin_inset LatexCommand url
+target "http://sdcc.sf.net/snap.php"
-Using sdcclib to Create and Manage Libraries
-\begin_inset LatexCommand \index{sdcclib}
+\end_inset
-\end_inset
+.
+\end_layout
+\begin_layout Section
+Reading the Documentation
+\begin_inset LatexCommand index
+name "Documentation"
-\layout Standard
+\end_inset
-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.
- This results in a larger library file, but it greatly reduces the number
- of disk files accessed by the linker.
- 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
-\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
+status open
-\family sans
-\series bold
-sdcclib -?
-\begin_inset LatexCommand \index{sdcclib}
+\begin_layout Standard
+If you should know why please drop us a note
+\end_layout
-\end_inset
+\end_inset
+.
+
+\newline
+You'll find the pdf version
+\begin_inset LatexCommand index
+name "PDF version of this document"
-\newline
+\end_inset
-\newline
+ at
+\begin_inset LatexCommand url
+target "http://sdcc.sf.net/doc/sdccman.pdf"
-\family default
-\series default
-To create a new library file, start by compiling all the required modules.
- For example:
-\newline
+\end_inset
-\layout Standard
+.
+
+\newline
+A html version
+\begin_inset LatexCommand index
+name "HTML version of this document"
+\end_inset
-\family sans
-\series bold
-sdcc -c _divsint.c
-\layout Standard
+ should be online at
+\begin_inset LatexCommand url
+target "http://sdcc.sf.net/doc/sdccman.html/index.html"
+\end_inset
-\family sans
-\series bold
-sdcc -c _divuint.c
-\layout Standard
+.
+\newline
+This documentation is in some aspects different from a commercial documentation:
+
+\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
+name "Status of documentation"
-\family sans
-\series bold
-sdcc -c _modsint.c
-\layout Standard
+\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.
+\end_layout
-\family sans
-\series bold
-sdcc -c _moduint.c
-\layout Standard
+\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
+target "http://www.opencores.org"
+\end_inset
-\family sans
-\series bold
-sdcc -c _mulint.c
-\newline
+ together with a statement
+\begin_inset Quotes sld
+\end_inset
-\layout Standard
+some processors which are targetted by SDCC can be implemented in a
+\emph on
+f
+\emph default
+ield
+\emph on
+p
+\emph default
+rogrammable
+\emph on
+g
+\emph default
+ate
+\emph on
+a
+\emph default
+rray
+\begin_inset LatexCommand index
+name "FPGA (field programmable gate array)"
-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
+\end_inset
-\layout Standard
+\begin_inset Quotes srd
+\end_inset
-\family sans
-\series bold
-sdcclib libint.lib _divsint.rel
-\family default
+ or
+\begin_inset LatexCommand url
+target "http://sf.net/projects/fpgac"
-\begin_inset LatexCommand \index{sdcclib}
+\end_inset
-\end_inset
+\begin_inset LatexCommand index
+name "FpgaC ((subset of) C to FPGA compiler)"
-\layout Standard
+\end_inset
+
+\begin_inset Quotes sld
+\end_inset
-\family sans
-\series bold
-sdcclib libint.lib _divuint.rel
-\layout Standard
+have you ever heard of an open source compiler that compiles a subset of
+ C for an FPGA?
+\begin_inset Quotes srd
+\end_inset
+ we expect you to have a quick look there and come back.
+ If you read this you are on the right track.
+\end_layout
-\family sans
-\series bold
-sdcclib libint.lib _modsint.rel
-\layout Standard
+\begin_layout Itemize
+Some sections attribute more space to problems, restrictions and warnings
+ than to the solution.
+\end_layout
+\begin_layout Itemize
+The installation section and the section about the debugger is intimidating.
+\end_layout
-\family sans
-\series bold
-sdcclib libint.lib _moduint.rel
-\layout Standard
+\begin_layout Itemize
+There are still lots of typos and there are more different writing styles
+ than pictures.
+\end_layout
+\begin_layout Section
+Testing the SDCC Compiler
+\begin_inset LatexCommand label
+name "sec:Testing-the-SDCC"
-\family sans
-\series bold
-sdcclib libint.lib _mulint.rel
-\series default
+\end_inset
-\newline
-\layout Standard
+\end_layout
-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
+\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
+"sdcc -
+\begin_inset ERT
+status collapsed
-\newline
+\begin_layout Standard
-\family sans
-\series bold
-sdcclib -s libint.lib
-\family default
-\begin_inset LatexCommand \index{sdcclib}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
+-version"
+\begin_inset LatexCommand index
+name "version"
-\newline
+\end_inset
-\family typewriter
-\series default
-_divsint.rel:
-\layout Standard
+\family default
+\series default
+ at the prompt, and the program should run and output its version like:
+
+\newline
-\family typewriter
-__divsint_a_1_1
-\layout Standard
+\family typewriter
+SDCC : mcs51/z80/avr/ds390/pic16/pic14/ds400/hc08 2.5.6 #4169 (May 8 2006)
+ (UNIX)
+\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
+see
+\series default
+ section
+\begin_inset LatexCommand ref
+reference "sub:Install-Trouble-shooting"
-\family typewriter
-__divsint_PARM_2
-\layout Standard
+\end_inset
+\InsetSpace ~
-\family typewriter
-__divsint
-\newline
-_divuint.rel:
-\layout Standard
+\series medium
+Install trouble-shooting for suggestions
+\series default
+).
+ Make sure that the sdcc program is in the bin folder, if not perhaps something
+ did not install correctly.
+\newline
+\newline
-\family typewriter
-__divuint_a_1_1
-\layout Standard
+\series medium
+SDCC
+\series default
+ is commonly installed as described in section
+\begin_inset Quotes sld
+\end_inset
+Install and search paths
+\begin_inset Quotes srd
+\end_inset
-\family typewriter
-__divuint_PARM_2
-\layout Standard
+.
+\newline
+\newline
-\family typewriter
-__divuint_reste_1_1
-\layout Standard
+\series medium
+Make sure the compiler works on a very simple example.
+ Type in the following test.c program using your favorite
+\series default
+ ASCII
+\series medium
+editor:
+\end_layout
+\begin_layout Verse
-\family typewriter
-__divuint_count_1_1
-\layout Standard
+\family typewriter
+char test;
+\newline
+\newline
+void main(void) {
+\newline
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+\InsetSpace ~
+test=0;
+\newline
+}
+\end_layout
-\family typewriter
-__divuint
-\newline
-_modsint.rel:
-\layout Standard
+\begin_layout Standard
+\series medium
+Compile this using the following command:
+\series default
+
+\family sans
+\series bold
+"sdcc -c test.c".
-\family typewriter
-__modsint_a_1_1
-\layout Standard
+\family default
+\series default
+
+\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
+\newline
-\family typewriter
-__modsint_PARM_2
-\layout Standard
+\newline
+
+\series medium
+The next step is to try it with the linker.
+ Type in
+\series default
+
+\family sans
+\series bold
+"sdcc test.c
+\family default
+\series default
+"
+\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 medium
+(no test.ihx, and the linker generates warnings), then the problem is most
+ likely that
+\series default
+ SDCC
+\series medium
+cannot find the
+\series default
+ /
+\series medium
+usr/local/share/sdcc/lib directory
+\series default
+
+\series medium
+(see
+\series default
+ section
+\begin_inset LatexCommand ref
+reference "sub:Install-Trouble-shooting"
+\end_inset
-\family typewriter
-__modsint
-\newline
-_moduint.rel:
-\layout Standard
+\InsetSpace ~
+\series medium
+Install trouble-shooting for suggestions).
+\series default
-\family typewriter
-__moduint_a_1_1
-\layout Standard
+\newline
+\newline
-\family typewriter
-__moduint_PARM_2
-\layout Standard
+\series medium
+The final test is to ensure
+\series default
+ SDCC
+\series medium
+can use the
+\series default
+ standard
+\series medium
+header files and libraries.
+ Edit test.c and change it to the following:
+\end_layout
+\begin_layout Verse
-\family typewriter
-__moduint_count_1_1
-\layout Standard
+\family typewriter
+#include
+\newline
+\newline
+char str1[10];
+\newline
-\family typewriter
-__moduint
-\newline
-_mulint.rel:
-\layout Standard
+\newline
+void main(void) {
+\newline
+\InsetSpace ~
+\InsetSpace ~
+strcpy(str1, "testing");
+\newline
+}
+\end_layout
+\begin_layout Standard
-\family typewriter
-__mulint_PARM_2
-\layout Standard
+\series medium
+Compile this by typing
+\series default
+
+\family sans
+\series bold
+"sdcc test.c"
+\family default
+\series medium
+.
+ This should generate a test.ihx output file, and it should give no warnings
+ such as not finding the string.h file.
+ If it cannot find the string.h file, then the problem is that
+\series default
+ SDCC
+\series medium
+cannot find the /usr/local/share/sdcc/include directory
+\series default
+
+\series medium
+(see the
+\series default
+ section
+\begin_inset LatexCommand ref
+reference "sub:Install-Trouble-shooting"
+\end_inset
-\family typewriter
-__mulint
-\family default
-\series bold
+\InsetSpace ~
-\newline
+\series medium
+Install trouble-shooting section for suggestions).
-\layout Standard
-\added_space_bottom bigskip
-If the source files are compiled using -
+\series default
+ Use option
+\series bold
+-
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
--debug
-\begin_inset LatexCommand \index{-\/-debug}
+\end_inset
-\end_inset
+-print-search-dirs
+\series default
-, the corresponding debug information file .adb will be include in the library
- file as well.
- The library files created with sdcclib are plain text files, so they can
- be viewed with a text editor.
- It is not recomended to modify a library file created with sdcclib using
- a text editor, as there are file indexes numbers located accross the file
- used by the linker to quickly locate the required module to link.
- Once a .rel file (as well as a .adb file) is added to a library using sdcclib,
- it can be safely deleted, since all the information required for linking
- is embedded in the library file itself.
- Library files created using sdcclib are used as described in the preceding
- sections.
-\layout Section
+\begin_inset LatexCommand index
+name "-\\/-print-search-dirs"
-Command Line Options
-\begin_inset LatexCommand \index{Command Line Options}
+\end_inset
-\end_inset
+ to find exactly where SDCC is looking for the include and lib files.
+\end_layout
+\begin_layout Section
+Install Trouble-shooting
+\begin_inset LatexCommand label
+name "sub:Install-Trouble-shooting"
-\layout Subsection
+\end_inset
-Processor Selection Options
-\begin_inset LatexCommand \index{Options processor selection}
-\end_inset
+\begin_inset LatexCommand index
+name "Install trouble-shooting"
+\end_inset
-\begin_inset LatexCommand \index{Processor selection options}
-\end_inset
+\end_layout
+\begin_layout Subsection
+If SDCC does not build correctly
+\end_layout
-\layout List
-\labelwidthstring 00.00.0000
+\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
-\series bold
--mmcs51
-\begin_inset LatexCommand \index{-mmcs51}
+\family sans
+\series bold
+./configure 2>&1 | tee configure.log
+\family default
+\series default
-\end_inset
+\newline
+\newline
+and build it like:
+\newline
-\series default
- Generate code for the Intel MCS51
-\begin_inset LatexCommand \index{MCS51}
+\newline
-\end_inset
+\family sans
+\series bold
+make 2>&1 | tee make.log
+\family default
+\series default
- family of processors.
- This is the default processor target.
-\layout List
-\labelwidthstring 00.00.0000
+\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.
+\end_layout
-\series bold
--mds390
-\begin_inset LatexCommand \index{-mds390}
+\begin_layout Subsection
+What the
+\begin_inset Quotes sld
+\end_inset
-\end_inset
+./configure
+\begin_inset Quotes srd
+\end_inset
+ does
+\end_layout
-\series default
- Generate code for the Dallas DS80C390
-\begin_inset LatexCommand \index{DS80C390}
+\begin_layout Standard
+The
+\begin_inset Quotes sld
+\end_inset
-\end_inset
+./configure
+\begin_inset Quotes srd
+\end_inset
- processor.
-\layout List
-\labelwidthstring 00.00.0000
+ 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.
+\end_layout
+\begin_layout Subsection
+What the
+\begin_inset Quotes sld
+\end_inset
-\series bold
--mds400
-\begin_inset LatexCommand \index{-mds400}
+make
+\begin_inset Quotes srd
+\end_inset
-\end_inset
+ does
+\end_layout
+\begin_layout Standard
+This runs the GNU make tool, which automatically compiles all the source
+ packages into the final installed binary executables.
+\end_layout
-\series default
- Generate code for the Dallas DS80C400
-\begin_inset LatexCommand \index{DS80C400}
+\begin_layout Subsection
+What the
+\begin_inset Quotes sld
+\end_inset
-\end_inset
+make install
+\begin_inset Quotes erd
+\end_inset
- processor.
-\layout List
-\labelwidthstring 00.00.0000
+ command does.
+\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
+reference "sub:Install-paths"
-\series bold
--mhc08
-\begin_inset LatexCommand \index{-mhc08}
+\end_inset
-\end_inset
+,\InsetSpace ~
+\begin_inset LatexCommand ref
+reference "sub:Search-Paths"
-\series default
- Generate code for the Freescale/Motorola HC08
-\begin_inset LatexCommand \index{HC08}
+\end_inset
-\end_inset
+\InsetSpace ~
+about install and search paths.
+\newline
+On most systems you will need super-user privilege
+s to do this.
+\end_layout
- family of processors.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Section
+Components of SDCC
+\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.
+ Note that the included simulator and assembler have separate documentation
+ 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
-\series bold
--mz80
-\begin_inset LatexCommand \index{-mz80}
+\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
-\end_inset
+
+\newline
+In /bin:
+\end_layout
+\begin_layout Itemize
+sdcc - The compiler.
+\end_layout
-\series default
- Generate code for the Zilog Z80
-\begin_inset LatexCommand \index{Z80}
+\begin_layout Itemize
+sdcpp - The C preprocessor.
+\end_layout
-\end_inset
+\begin_layout Itemize
+asx8051 - The assembler for 8051 type processors.
+\end_layout
- family of processors.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Itemize
+as-z80
+\series bold
+,
+\series default
+ as-gbz80 - The Z80 and GameBoy Z80 assemblers.
+\end_layout
+\begin_layout Itemize
+aslink -The linker for 8051 type processors.
+\end_layout
-\series bold
--mgbz80
-\begin_inset LatexCommand \index{-mgbz80}
+\begin_layout Itemize
+link-z80
+\series bold
+,
+\series default
+ link-gbz80 - The Z80 and GameBoy Z80 linkers.
+\end_layout
-\end_inset
+\begin_layout Itemize
+s51 - The ucSim 8051 simulator.
+\end_layout
+\begin_layout Itemize
+sdcdb - The source debugger.
+\end_layout
-\series default
- Generate code for the GameBoy Z80
-\begin_inset LatexCommand \index{gbz80 (GameBoy Z80)}
+\begin_layout Itemize
+packihx - A tool to pack (compress) Intel hex files.
+\end_layout
-\end_inset
+\begin_layout Standard
+In /share/sdcc/include
+\end_layout
- processor (Not actively maintained).
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Itemize
+the include files
+\end_layout
+\begin_layout Standard
+In /share/sdcc/lib
+\end_layout
-\series bold
--mavr
-\begin_inset LatexCommand \index{-mavr}
+\begin_layout Itemize
+the subdirs src and small, large, z80, gbz80 and ds390 with the precompiled
+ relocatables.
+\end_layout
-\end_inset
+\begin_layout Standard
+In /share/sdcc/doc
+\end_layout
+\begin_layout Itemize
+the documentation
+\end_layout
-\series default
- Generate code for the Atmel AVR
-\begin_inset LatexCommand \index{AVR}
+\begin_layout Standard
+As development for other processors proceeds, this list will expand to include
+ executables to support processors like AVR, PIC, etc.
+\end_layout
-\end_inset
+\begin_layout Subsection
+sdcc - The Compiler
+\end_layout
- processor (Not maintained, not complete).
- AVR users should probably have a look at winavr
-\begin_inset LatexCommand \url{http://sourceforge.net/projects/winavr}
+\begin_layout Standard
+This is the actual compiler, it in turn uses the c-preprocessor and invokes
+ the assembler and linkage editor.
+\end_layout
-\end_inset
+\begin_layout Subsection
+sdcpp - The C-Preprocessor
+\end_layout
- or
-\begin_inset LatexCommand \url{http://www.avrfreaks.net/index.php?name=PNphpBB2&file=index}
+\begin_layout Standard
+The preprocessor
+\begin_inset LatexCommand index
+name "sdcpp (preprocessor)"
-\end_inset
+\end_inset
-.
-\layout Comment
+ is a modified version of the GNU cpp
+\begin_inset LatexCommand index
+name "cpp|see{sdcpp}"
-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_inset
+ preprocessor
+\begin_inset LatexCommand url
+target "http://gcc.gnu.org/"
-\series bold
--mpic14
-\begin_inset LatexCommand \index{-mpic14}
+\end_inset
-\end_inset
+.
+ The C preprocessor is used to pull in #include sources, process #ifdef
+ statements, #defines and so on.
+\end_layout
+\begin_layout Subsection
+as
+\emph on
+xxxx
+\emph default
+, aslink, link-
+\emph on
+xxx
+\emph default
+ - The Assemblers and Linkage Editors
+\end_layout
-\series default
- Generate code for the Microchip PIC 14
-\begin_inset LatexCommand \index{PIC14}
+\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.
+\end_layout
-\end_inset
+\begin_layout Subsection
+s51 - The Simulator
+\end_layout
--bit processors (p16f84 and variants.
- In development, not complete).
-\layout Comment
+\begin_layout Standard
+S51
+\begin_inset LatexCommand index
+name "s51"
-p16f627 p16f628 p16f84 p16f873 p16f877?
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+ is a free open source 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
+target "http://mazsola.iit.uni-miskolc.hu/~drdani/embedded/s51"
-\series bold
--mpic16
-\begin_inset LatexCommand \index{-mpic16}
+\end_inset
-\end_inset
+.
+ It currently supports the core mcs51, the Dallas DS80C390 and the Phillips
+ XA51 family.
+\end_layout
+\begin_layout Subsection
+sdcdb - Source Level Debugger
+\end_layout
-\series default
- Generate code for the Microchip PIC 16
-\begin_inset LatexCommand \index{PIC16}
+\begin_layout Standard
+SDCDB
+\begin_inset LatexCommand index
+name "SDCDB (debugger)"
-\end_inset
+\end_inset
--bit processors (p18f452 and variants.
- In development, not complete).
-\layout List
-\labelwidthstring 00.00.0000
+ is the companion source level debugger.
+ More about SDCDB in section
+\begin_inset LatexCommand ref
+reference "cha:Debugging-with-SDCDB"
+\end_inset
-\series bold
--mtlcs900h
-\series default
- Generate code for the Toshiba TLCS-900H
-\begin_inset LatexCommand \index{TLCS-900H}
+.
+ The current version of the debugger uses Daniel's Simulator S51
+\begin_inset LatexCommand index
+name "s51"
-\end_inset
+\end_inset
- processor (Not maintained, not complete).
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+, but can be easily changed to use other simulators.
+\end_layout
+\begin_layout Chapter
+Using SDCC
+\end_layout
-\series bold
--mxa51
-\begin_inset LatexCommand \index{-mxa51}
+\begin_layout Section
+Compiling
+\end_layout
-\end_inset
+\begin_layout Subsection
+Single Source File Projects
+\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
+"sdcc sourcefile.c".
-\series default
- Generate code for the Phillips XA51
-\begin_inset LatexCommand \index{XA51}
+\family default
+\series default
+ This will compile, assemble and link your source file.
+ Output files are as follows:
+\end_layout
-\end_inset
+\begin_layout Itemize
+sourcefile.asm
+\begin_inset LatexCommand index
+name ".asm"
- processor (Not maintained, not complete).
-\layout Subsection
+\end_inset
-Preprocessor Options
-\begin_inset LatexCommand \index{Options preprocessor}
+ - Assembler source
+\begin_inset LatexCommand index
+name "Assembler source"
-\end_inset
+\end_inset
+ file created by the compiler
+\end_layout
-\begin_inset LatexCommand \index{Preprocessor options}
+\begin_layout Itemize
+sourcefile.lst
+\begin_inset LatexCommand index
+name ".lst"
-\end_inset
+\end_inset
+ - Assembler listing
+\begin_inset LatexCommand index
+name "Assembler listing"
-\begin_inset LatexCommand \index{sdcpp (preprocessor)}
+\end_inset
-\end_inset
+ file created by the Assembler
+\end_layout
+\begin_layout Itemize
+sourcefile.rst
+\begin_inset LatexCommand index
+name ".rst"
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+ - Assembler listing
+\begin_inset LatexCommand index
+name "Assembler listing"
-\series bold
--I
-\begin_inset LatexCommand \index{-I}
+\end_inset
-\end_inset
+ file updated with linkedit information, created by linkage editor
+\end_layout
+\begin_layout Itemize
+sourcefile.sym
+\begin_inset LatexCommand index
+name ".sym"
-\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
+ - symbol listing
+\begin_inset LatexCommand index
+name "Symbol listing"
- files.
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+ for the sourcefile, created by the assembler
+\end_layout
-\series bold
--D
-\begin_inset LatexCommand \index{-D}
+\begin_layout Itemize
+sourcefile.rel
+\begin_inset LatexCommand index
+name ".rel"
-\end_inset
+\end_inset
+ or sourcefile.o
+\begin_inset LatexCommand index
+name ".o"
-\series default
- Command line definition of macros.
- Passed to the preprocessor.
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+ - Object file
+\begin_inset LatexCommand index
+name "Object file"
-\series bold
--M
-\begin_inset LatexCommand \index{-M}
+\end_inset
-\end_inset
+ created by the assembler, input to Linkage editor
+\end_layout
+\begin_layout Itemize
+sourcefile.map
+\begin_inset LatexCommand index
+name ".map"
-\series default
- Tell the preprocessor to output a rule suitable for make describing the
- dependencies of each object file.
- For each source file, the preprocessor outputs one make-rule whose target
- is the object file name for that source file and whose dependencies are
- all the files `#include'd in it.
- This rule may be a single line or may be continued with `
-\backslash
-'-newline if it is long.
- The list of rules is printed on standard output instead of the preprocessed
- C program.
- `-M' implies `-E
-\begin_inset LatexCommand \index{-E}
+\end_inset
-\end_inset
+ - The memory map
+\begin_inset LatexCommand index
+name "Memory map"
-'.
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+ for the load module, created by the Linker
+\end_layout
-\series bold
--C
-\begin_inset LatexCommand \index{-C}
+\begin_layout Itemize
+sourcefile.mem
+\begin_inset LatexCommand index
+name ".mem"
-\end_inset
+\end_inset
+ - A file with a summary of the memory usage
+\end_layout
-\series default
- Tell the preprocessor not to discard comments.
- Used with the `-E' option.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Itemize
+sourcefile.ihx
+\begin_inset LatexCommand index
+name ".ihx"
+\end_inset
-\series bold
--MM
-\begin_inset LatexCommand \index{-MM}
+ - The load module in Intel hex format
+\begin_inset LatexCommand index
+name "Intel hex format"
-\end_inset
+\end_inset
+ (you can select the Motorola S19 format
+\begin_inset LatexCommand index
+name "Motorola S19 format"
-\size large
-\bar under
-
-\series default
-\size default
-\bar default
-Like `-M' but the output mentions only the user header files included with
- `#include
-\begin_inset Quotes eld
-\end_inset
+\end_inset
-file"'.
- System header files included with `#include ' are omitted.
-\layout List
-\labelwidthstring 00.00.0000
+ with -
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\series bold
--Aquestion(answer)
-\begin_inset LatexCommand \index{-Aquestion(answer)}
-\end_inset
+\backslash
+/
+\end_layout
+\end_inset
-\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
+-out-fmt-s19
+\begin_inset LatexCommand index
+name "-\\/-out-fmt-s19"
+\end_inset
-\series bold
--Umacro
-\begin_inset LatexCommand \index{-Umacro}
+.
+ If you need another format you might want to use
+\family sans
+\shape italic
+objdump
+\family default
+\shape default
-\end_inset
+\begin_inset LatexCommand index
+name "objdump (tool)"
+\end_inset
-\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
+ or
+\family sans
+\shape italic
+srecord
+\family default
+\shape default
+\begin_inset LatexCommand index
+name "srecord (bin, hex, ... tool)"
-\series bold
--dM
-\begin_inset LatexCommand \index{-dM}
+\end_inset
-\end_inset
+\begin_inset Note Note
+status collapsed
-\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
+\begin_layout Standard
+hyperlinks needed
+\end_layout
+\end_inset
-\series bold
--dD
-\begin_inset LatexCommand \index{-dD}
+ - see also section
+\begin_inset LatexCommand vref
+reference "sub:Postprocessing-the-Intel"
-\end_inset
+\end_inset
+).
+ Both formats are documented in the documentation of srecord
+\begin_inset LatexCommand index
+name "srecord (bin, hex, ... tool)"
-\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_inset
-\series bold
--dN
-\begin_inset LatexCommand \index{-dN}
+\end_layout
-\end_inset
+\begin_layout Itemize
+sourcefile.adb
+\begin_inset LatexCommand index
+name ".adb"
+\end_inset
-\size large
-\bar under
-
-\series default
-\size default
-\bar default
-Like `-dD' except that the macro arguments and contents are omitted.
- Only `#define name' is included in the output.
-\layout List
-\labelwidthstring 00.00.0000
+ - An intermediate file containing debug information needed to create the
+ .cdb file (with -
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\series bold
--pedantic-parse-number
-\begin_inset LatexCommand \index{-pedantic-parse-number}
-\end_inset
+\backslash
+/
+\end_layout
+\end_inset
-\size large
-\bar under
-
-\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}
+-debug
+\begin_inset LatexCommand index
+name "-\\/-debug"
-\end_inset
+\end_inset
-
-\emph on
-Note: this functionality is not in conformance with standard!
+)
+\end_layout
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\begin_layout Itemize
+sourcefile.cdb
+\begin_inset LatexCommand index
+name ".cdb"
+\end_inset
-\series bold
--Wp\SpecialChar ~
-preprocessorOption[,preprocessorOption]
-\series default
+ - An optional file (with -
+\begin_inset ERT
+status collapsed
-\begin_inset LatexCommand \index{-Wp preprocessorOption[,preprocessorOption]}
+\begin_layout Standard
-\end_inset
-...
- Pass the preprocessorOption to the preprocessor
-\family typewriter
-sdcpp
-\family default
+\backslash
+/
+\end_layout
-\begin_inset LatexCommand \index{sdcpp (preprocessor)}
+\end_inset
-\end_inset
+-debug) containing debug information.
+ The format is documented in cdbfileformat.pdf
+\end_layout
-.
- SDCC uses an adapted version of the preprocessor
-\emph on
-cpp
-\emph default
- of the GNU Compiler Collection
-\begin_inset LatexCommand \index{gcc (GNU Compiler Collection)}
+\begin_layout Itemize
+sourcefile.
+ - (no extension)
+\begin_inset LatexCommand index
+name " (no extension)"
-\end_inset
+\end_inset
- (
-\emph on
-gcc
-\emph default
-
-\begin_inset LatexCommand \url{http://gcc.gnu.org/}
+ An optional AOMF or AOMF51
+\begin_inset LatexCommand index
+name "AOMF, AOMF51"
-\end_inset
+\end_inset
-), if you need more dedicated options please refer to the GCC\SpecialChar ~
-3.3.6\SpecialChar ~
-CPP\SpecialChar ~
-Manual
- at
-\begin_inset LatexCommand \htmlurl{http://www.gnu.org/software/gcc/onlinedocs/}
+
+\begin_inset LatexCommand label
+name "OMF file"
-\end_inset
+\end_inset
-.
-\layout Subsection
+file containing debug information (generated with option -
+\begin_inset ERT
+status collapsed
-Linker Options
-\begin_inset LatexCommand \index{Options linker}
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\begin_inset LatexCommand \index{Linker options}
+\end_inset
-\end_inset
+-debug).
+ The (Intel)
+\emph on
+a
+\emph default
+bsolute
+\emph on
+o
+\emph default
+bject
+\emph on
+m
+\emph default
+odule
+\emph on
+f
+\emph default
+ormat is a subformat of the OMF51 format and is commonly used by third party
+ tools (debuggers
+\begin_inset LatexCommand index
+name "Debugger"
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+, simulators, emulators).
+\end_layout
+\begin_layout Itemize
+sourcefile.dump*
+\begin_inset LatexCommand index
+name ".dump*"
-\series bold
--L\SpecialChar ~
--
-\series default
+\end_inset
+ - Dump file to debug the compiler it self (generated with option -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
-
-\backslash
-/
-\end_inset
+\begin_layout Standard
-\series bold
--lib-path
-\begin_inset LatexCommand \index{-\/-lib-path }
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
+-dumpall) (see section
+\begin_inset LatexCommand ref
+reference "sub:Intermediate-Dump-Options"
-\begin_inset LatexCommand \index{-L -\/-lib-path}
+\end_inset
-\end_inset
+\InsetSpace ~
+ and section
+\begin_inset LatexCommand ref
+reference "sub:The-anatomy-of"
+\end_inset
-\series default
-\SpecialChar ~
- This option is passed to the linkage
- editor's additional libraries
-\begin_inset LatexCommand \index{Libraries}
+\InsetSpace ~
-\end_inset
+\begin_inset Quotes sld
+\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
+Anatomy of the compiler
+\begin_inset Quotes srd
+\end_inset
+).
+\end_layout
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_layout Subsection
+Postprocessing the Intel Hex
+\begin_inset LatexCommand index
+name "Intel hex format"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ file
+\begin_inset LatexCommand label
+name "sub:Postprocessing-the-Intel"
--xram-loc
-\series default
+\end_inset
-\begin_inset LatexCommand \index{-\/-xram-loc }
-\end_inset
+\end_layout
-\SpecialChar ~
- The start location of the external ram
-\begin_inset LatexCommand \index{xdata (mcs51, ds390 storage class)}
+\begin_layout Standard
+In most cases this won't be needed but the Intel Hex file
+\begin_inset LatexCommand index
+name ".ihx"
-\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
+ 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
+packihx
+\family default
-\layout Standard
+\begin_inset LatexCommand index
+name "packihx (tool)"
-\backslash
-/
-\end_inset
+\end_inset
--xram-loc 0x8000 or -
-\begin_inset ERT
-status Collapsed
+ which is part of the SDCC distribution:
+\newline
-\layout Standard
+\newline
+
+\family sans
+\series bold
+packihx sourcefile.ihx >sourcefile.hex
+\family default
+\series default
-\backslash
-/
-\end_inset
+\newline
--xram-loc 32768.
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+The separately available
+\emph on
+srecord
+\emph default
+\begin_inset LatexCommand index
+name "srecord (bin, hex, ... tool)"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+ package additionally allows to set undefined locations to a predefined
+ value, to insert checksums
+\begin_inset LatexCommand index
+name "checksum"
-\backslash
-/
-\end_inset
+\end_inset
--code-loc
-\series default
+ of various flavours (crc, add, xor) and to perform other manipulations
+ (convert, split, crop, offset, ...).
+
+\newline
-\begin_inset LatexCommand \index{-\/-code-loc }
+\newline
-\end_inset
+\family sans
+\series bold
+srec_cat\InsetSpace ~
+\InsetSpace ~
+sourcefile.ihx -intel\InsetSpace ~
+\InsetSpace ~
+-o sourcefile.hex -intel
+\newline
-\SpecialChar ~
- The start location of the code
-\begin_inset LatexCommand \index{code}
+\newline
-\end_inset
+\family default
+\series default
+An example for a more complex command line
+\begin_inset Foot
+status open
- segment, default value 0.
- Note when this option is used the interrupt vector table
-\begin_inset LatexCommand \index{interrupt vector table}
+\begin_layout Standard
+the command backfills
+\begin_inset LatexCommand index
+name "backfill unused memory"
-\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
+ 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
+lcall
+\family default
+ to address
+\family typewriter
+0x1212
+\family default
+ (where an emergency routine could sit).
+\end_layout
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ could look like:
+\newline
--code-loc 0x8000 or -
-\begin_inset ERT
-status Collapsed
+\newline
-\layout Standard
+\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\InsetSpace ~
+\InsetSpace ~
+-o sourcefile.hex -intel
+\size default
-\backslash
-/
-\end_inset
+\newline
--code-loc 32768.
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+\family default
+\series default
+The srecord package is available at
+\begin_inset LatexCommand url
+target "http://sf.net/projects/srecord"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+ .
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Subsection
+Projects with Multiple Source Files
+\end_layout
--stack-loc
-\series default
+\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
-\begin_inset LatexCommand \index{-\/-stack-loc }
+\newline
+foo1.c (contains some functions)
+\newline
+foo2.c (contains some more functions)
+\newline
+foomai
+n.c (contains more functions and the function main)
+\newline
-\end_inset
+\size footnotesize
-\SpecialChar ~
- By default the stack
-\begin_inset LatexCommand \index{stack}
+\newline
-\end_inset
+\size default
+The first two files will need to be compiled separately with the commands:
+\size footnotesize
+
+\size default
- is placed after the data segment.
- Using this option the stack can be placed anywhere in the internal memory
- space of the 8051.
- The value entered can be in Hexadecimal or Decimal format, e.g.
- -
-\begin_inset ERT
-status Collapsed
+\newline
-\layout Standard
+\newline
-\backslash
-/
-\end_inset
+\family sans
+\series bold
+sdcc\InsetSpace ~
+-c\InsetSpace ~
+foo1.c
+\family default
+\series default
+\size footnotesize
--stack-loc 0x20 or -
-\begin_inset ERT
-status Collapsed
+\newline
-\layout Standard
+\family sans
+\series bold
+\size default
+sdcc\InsetSpace ~
+-c\InsetSpace ~
+foo2.c
+\family default
+\series default
-\backslash
-/
-\end_inset
+\newline
--stack-loc 32.
- Since the sp register is incremented before a push or call, the initial
- sp will be set to one byte prior the provided value.
- The provided value should not overlap any other memory areas such as used
- register banks or the data segment and with enough space for the current
- application.
- The
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\newline
+Then compile the source file containing the
+\emph on
+main()
+\emph default
+ function and link
+\begin_inset LatexCommand index
+name "Linker"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ the files together with the following command:
+\newline
--pack-iram
-\series default
-\SpecialChar ~
+\newline
-\begin_inset LatexCommand \index{-\/-pack-iram}
+\family sans
+\series bold
+sdcc\InsetSpace ~
+foomain.c\InsetSpace ~
+foo1.rel\InsetSpace ~
+foo2.rel
+\family default
+\series default
-\end_inset
+\begin_inset LatexCommand index
+name ".rel"
- option (which is now a default setting) will override this setting, so
- you should also specify the
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\newline
--no-pack-iram
-\series default
-\SpecialChar ~
+\newline
+Alternatively,
+\emph on
+foomain.c
+\emph default
+ can be separately compiled as well:
+\family sans
+\series bold
-\begin_inset LatexCommand \index{-\/-no-pack-iram}
+\newline
-\end_inset
+\newline
+sdcc\InsetSpace ~
+-c\InsetSpace ~
+foomain.c
+\newline
+sdcc foomain.rel foo1.rel foo2.rel
+\newline
- option if you need to manually place the stack.
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+\family default
+\series default
+The file containing the
+\emph on
+main()
+\emph default
+ function
+\noun on
+must
+\noun default
+ be the
+\noun on
+first
+\noun default
+ file specified in the command line, since the linkage editor processes
+ file in the order they are presented to it.
+ The linker is invoked from SDCC using a script file with extension .lnk
+\begin_inset LatexCommand index
+name ".lnk"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+.
+ You can view this file to troubleshoot linking problems such as those arising
+ from missing libraries.
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Subsection
+Projects with Additional Libraries
+\begin_inset LatexCommand index
+name "Libraries"
--xstack-loc
-\series default
+\end_inset
-\begin_inset LatexCommand \index{-\/-xstack-loc }
-\end_inset
+\end_layout
-\SpecialChar ~
- By default the external stack
-\begin_inset LatexCommand \index{xstack}
+\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
+.lib
+\begin_inset LatexCommand index
+name ".lib"
-\end_inset
+\end_inset
- is placed after the pdata
-\begin_inset LatexCommand \index{pdata (mcs51, ds390 storage class)}
-\end_inset
+\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
+foomain.c
+\emph default
+ and a library
+\emph on
+foolib.lib
+\emph default
+ in the directory
+\emph on
+mylib
+\emph default
+ (if that is not the same as your current project):
+\newline
- segment.
- Using this option the xstack can be placed anywhere in the external memory
- space of the 8051.
- The value entered can be in Hexadecimal or Decimal format, e.g.
- -
-\begin_inset ERT
-status Collapsed
+\newline
-\layout Standard
+\family sans
+\series bold
+sdcc foomain.c foolib.lib -L mylib
+\newline
-\backslash
-/
-\end_inset
+\newline
--xstack-loc 0x8000 or -
-\begin_inset ERT
-status Collapsed
+\family default
+\series default
+Note here that
+\emph on
+mylib
+\emph default
+ must be an absolute path name.
+\newline
-\layout Standard
+\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
+name ".rel"
-\backslash
-/
-\end_inset
+\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
+ files.
+ For an example see the standard library file
+\emph on
+libsdcc.lib
+\emph default
+ in the directory /share/lib/small.
+\end_layout
+\begin_layout Subsection
+Using sdcclib to Create and Manage Libraries
+\begin_inset LatexCommand index
+name "sdcclib"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\end_layout
--data-loc
-\series default
+\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.
+ This results in a larger library file, but it greatly reduces the number
+ of disk files accessed by the linker.
+ 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
-\begin_inset LatexCommand \index{-\/-data-loc }
+\end_layout
-\end_inset
+\begin_layout Standard
-\SpecialChar ~
- The start location of the internal ram data
-\begin_inset LatexCommand \index{data (mcs51, ds390 storage class)}
+\family sans
+\series bold
+sdcclib -?
+\begin_inset LatexCommand index
+name "sdcclib"
-\end_inset
+\end_inset
- segment.
- The value entered can be in Hexadecimal or Decimal format, eg.
- -
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\newline
-\backslash
-/
-\end_inset
+\newline
--data-loc 0x20 or -
-\begin_inset ERT
-status Collapsed
+\family default
+\series default
+To create a new library file, start by compiling all the required modules.
+ For example:
+\newline
-\layout Standard
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Standard
--data-loc 32.
- (By default, the start location of the internal ram data segment is set
- as low as possible in memory, taking into account the used register banks
- and the bit segment at address 0x20.
- 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
+\family sans
+\series bold
+sdcc -c _divsint.c
+\end_layout
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
+\family sans
+\series bold
+sdcc -c _divuint.c
+\end_layout
--data-loc is not used, to location 0x10.)
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Standard
+\family sans
+\series bold
+sdcc -c _modsint.c
+\end_layout
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
-\layout Standard
+\family sans
+\series bold
+sdcc -c _moduint.c
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Standard
--idata-loc
-\series default
+\family sans
+\series bold
+sdcc -c _mulint.c
+\newline
-\begin_inset LatexCommand \index{-\/-idata-loc }
+\end_layout
-\end_inset
+\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
-\SpecialChar ~
- The start location of the indirectly addressable internal ram
-\begin_inset LatexCommand \index{idata (mcs51, ds390 storage class)}
+\end_layout
-\end_inset
+\begin_layout Standard
- of the 8051, default value is 0x80.
- The value entered can be in Hexadecimal or Decimal format, eg.
- -
-\begin_inset ERT
-status Collapsed
+\family sans
+\series bold
+sdcclib libint.lib _divsint.rel
+\family default
-\layout Standard
+\begin_inset LatexCommand index
+name "sdcclib"
-\backslash
-/
-\end_inset
+\end_inset
--idata-loc 0x88 or -
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Standard
--idata-loc 136.
-\layout List
-\labelwidthstring 00.00.0000
+\family sans
+\series bold
+sdcclib libint.lib _divuint.rel
+\end_layout
+\begin_layout Standard
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\family sans
+\series bold
+sdcclib libint.lib _modsint.rel
+\end_layout
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
+\family sans
+\series bold
+sdcclib libint.lib _moduint.rel
+\end_layout
--bit-loc
-\series default
-\SpecialChar ~
- The start location of the bit
-\begin_inset LatexCommand \index{bit}
+\begin_layout Standard
-\end_inset
+\family sans
+\series bold
+sdcclib libint.lib _mulint.rel
+\family default
+\series default
- addressable internal ram of the 8051.
- This is
-\emph on
-not
-\emph default
- implemented yet.
- Instead an option can be passed directly to the linker: -Wl\SpecialChar ~
--bBSEG=.
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+\end_layout
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
+Or, if you preffer:
+\family sans
+\series bold
-\layout Standard
+\newline
-\backslash
-/
-\end_inset
+\end_layout
--out-fmt-ihx
-\begin_inset LatexCommand \index{-\/-out-fmt-ihx}
+\begin_layout Standard
-\end_inset
+\family sans
+\series bold
+sdcclib libint.lib _divsint.rel _divuint.rel _modsint.rel _moduint.rel _mulint.rel
+\family default
+\series default
+\newline
-\bar under
-
-\series default
-\bar default
-The linker output (final object code) is in Intel Hex format.
-\begin_inset LatexCommand \index{Intel hex format}
+\end_layout
-\end_inset
+\begin_layout Standard
+If the file already exists in the library, it will be replaced.
+ If a list of .rel files is available, you can tell sdcclib to add those
+ files to a library.
+ For example, if the file 'myliblist.txt' contains
+\family sans
+\series bold
- This is the default option.
- The format itself is documented in the documentation of srecord
-\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
+\newline
-\end_inset
+\end_layout
-.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Standard
+\family sans
+\series bold
+_divsint.rel
+\end_layout
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
-\layout Standard
+\family sans
+\series bold
+_divuint.rel
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Standard
--out-fmt-s19
-\begin_inset LatexCommand \index{-\/-out-fmt-s19}
+\family sans
+\series bold
+_modsint.rel
+\end_layout
-\end_inset
+\begin_layout Standard
+\family sans
+\series bold
+_moduint.rel
+\end_layout
-\bar under
-
-\series default
-\bar default
-The linker output (final object code) is in Motorola S19 format
-\begin_inset LatexCommand \index{Motorola S19 format}
+\begin_layout Standard
-\end_inset
+\family sans
+\series bold
+_mulint.rel
+\family default
+\series default
-.
- The format itself is documented in the documentation of srecord.
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+\end_layout
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_layout Standard
+Use
+\family sans
+\series bold
-\layout Standard
+\newline
-\backslash
-/
-\end_inset
+\end_layout
--out-fmt-elf
-\begin_inset LatexCommand \index{-\/-out-fmt-s19}
+\begin_layout Standard
-\end_inset
+\family sans
+\series bold
+sdcclib -l libint.lib myliblist.txt
+\family default
+\series default
+\newline
-\begin_inset LatexCommand \index{HC08!Options!-\/-out-fmt-elf}
+\end_layout
-\end_inset
+\begin_layout Standard
+Additionally, you can instruct sdcclib to compiles the files before adding
+ them to the library.
+ This is achieved using the environment variables SDCCLIB_CC and/or SDCCLIB_AS.
+ For example:
+\family sans
+\series bold
+\newline
-\bar under
-
-\series default
-\bar default
-The linker output (final object code) is in ELF format
-\begin_inset LatexCommand \index{ELF format}
+\end_layout
-\end_inset
+\begin_layout Standard
-.
- (Currently only supported for the HC08
-\begin_inset LatexCommand \index{HC08}
+\family sans
+\series bold
+set SDCCLIB_CC=sdcc -c
+\end_layout
-\end_inset
+\begin_layout Standard
- processors)
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\family sans
+\series bold
+sdcclib -l libint.lib myliblist.txt
+\family default
+\series default
+\newline
-\series bold
--Wl\SpecialChar ~
-linkOption[,linkOption]
-\series default
+\end_layout
-\begin_inset LatexCommand \index{-Wl linkOption[,linkOption]}
+\begin_layout Standard
+To see what modules and symbols are included in the library, options -s
+ and -m are available.
+ For example:
+\newline
-\end_inset
+\newline
-...
- Pass the linkOption to the linker.
- If a bootloader is used an option like
-\begin_inset Quotes sld
-\end_inset
+\family sans
+\series bold
+sdcclib -s libint.lib
+\family default
--Wl\SpecialChar ~
--bCSEG=0x1000
-\begin_inset Quotes srd
-\end_inset
+\begin_inset LatexCommand index
+name "sdcclib"
- 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
+\newline
-MCS51 Options
-\begin_inset LatexCommand \index{Options MCS51}
+\family typewriter
+\series default
+_divsint.rel:
+\end_layout
-\end_inset
+\begin_layout Standard
+\family typewriter
+__divsint_a_1_1
+\end_layout
-\begin_inset LatexCommand \index{MCS51 options}
+\begin_layout Standard
-\end_inset
+\family typewriter
+__divsint_PARM_2
+\end_layout
+\begin_layout Standard
-\layout List
-\labelwidthstring 00.00.0000
+\family typewriter
+__divsint
+\newline
+_divuint.rel:
+\end_layout
+\begin_layout Standard
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\family typewriter
+__divuint_a_1_1
+\end_layout
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
+\family typewriter
+__divuint_PARM_2
+\end_layout
--model-small
-\begin_inset LatexCommand \index{-\/-model-small}
+\begin_layout Standard
-\end_inset
+\family typewriter
+__divuint_reste_1_1
+\end_layout
+\begin_layout Standard
-\series default
-\size large
-\emph on
-
-\size default
-\emph default
-Generate code for Small Model programs, see section Memory Models for more
- details.
- This is the default model.
-\layout List
-\labelwidthstring 00.00.0000
+\family typewriter
+__divuint_count_1_1
+\end_layout
+\begin_layout Standard
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\family typewriter
+__divuint
+\newline
+_modsint.rel:
+\end_layout
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
+\family typewriter
+__modsint_a_1_1
+\end_layout
--model-medium
-\begin_inset LatexCommand \index{-\/-model-medium}
+\begin_layout Standard
-\end_inset
+\family typewriter
+__modsint_PARM_2
+\end_layout
+\begin_layout Standard
-\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
+\family typewriter
+__modsint
+\newline
+_moduint.rel:
+\end_layout
+\begin_layout Standard
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\family typewriter
+__moduint_a_1_1
+\end_layout
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
+\family typewriter
+__moduint_PARM_2
+\end_layout
--model-large
-\begin_inset LatexCommand \index{-\/-model-large}
+\begin_layout Standard
-\end_inset
+\family typewriter
+__moduint_count_1_1
+\end_layout
+\begin_layout Standard
-\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
+\family typewriter
+__moduint
+\newline
+_mulint.rel:
+\end_layout
+\begin_layout Standard
-\series bold
--
+\family typewriter
+__mulint_PARM_2
+\end_layout
+
+\begin_layout Standard
+
+\family typewriter
+__mulint
+\family default
+\series bold
+
+\newline
+
+\end_layout
+
+\begin_layout Standard
+If the source files are compiled using -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
--xstack
-\begin_inset LatexCommand \index{-\/-xstack}
+\end_inset
-\end_inset
+-debug
+\begin_inset LatexCommand index
+name "-\\/-debug"
+\end_inset
-\series default
- Uses a pseudo stack in the pdata
-\begin_inset LatexCommand \index{pdata (mcs51, ds390 storage class)}
+, the corresponding debug information file .adb will be include in the library
+ file as well.
+ The library files created with sdcclib are plain text files, so they can
+ be viewed with a text editor.
+ It is not recommended to modify a library file created with sdcclib using
+ a text editor, as there are file indexes numbers located across the file
+ used by the linker to quickly locate the required module to link.
+ Once a .rel file (as well as a .adb file) is added to a library using sdcclib,
+ it can be safely deleted, since all the information required for linking
+ is embedded in the library file itself.
+ Library files created using sdcclib are used as described in the preceding
+ sections.
+\begin_inset VSpace bigskip
+\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_layout
-\end_inset
+\begin_layout Section
+Command Line Options
+\begin_inset LatexCommand index
+name "Command Line Options"
-\SpecialChar ~
- External Stack for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_inset LatexCommand label
+name "sec:Command-Line-Options"
+
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\end_layout
--iram-size
-\series default
-\SpecialChar ~
-
-\begin_inset LatexCommand \index{-\/-iram-size }
+\begin_layout Subsection
+Processor Selection Options
+\begin_inset LatexCommand index
+name "Options processor selection"
-\end_inset
+\end_inset
- Causes the linker to check if the internal ram usage is within limits of
- the given value.
-\layout List
+
+\begin_inset LatexCommand index
+name "Processor selection options"
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-mmcs51
+\begin_inset LatexCommand index
+name "-mmcs51"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\series default
+ Generate code for the Intel MCS51
+\begin_inset LatexCommand index
+name "MCS51"
--xram-size
-\series default
-\SpecialChar ~
-
-\begin_inset LatexCommand \index{-\/-xram-size }
+\end_inset
-\end_inset
+ family of processors.
+ This is the default processor target.
+\end_layout
- Causes the linker to check if the external ram usage is within limits of
- the given value.
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-mds390
+\begin_inset LatexCommand index
+name "-mds390"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\series default
+ Generate code for the Dallas DS80C390
+\begin_inset LatexCommand index
+name "DS80C390"
--code-size
-\series default
-\SpecialChar ~
-
-\begin_inset LatexCommand \index{-\/-code-size }
+\end_inset
-\end_inset
+ processor.
+\end_layout
- Causes the linker to check if the code memory usage is within limits of
- the given value.
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-mds400
+\begin_inset LatexCommand index
+name "-mds400"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\series default
+ Generate code for the Dallas DS80C400
+\begin_inset LatexCommand index
+name "DS80C400"
--stack-size
-\series default
-\SpecialChar ~
-
-\begin_inset LatexCommand \index{-\/-stack-size }
+\end_inset
-\end_inset
+ processor.
+\end_layout
- Causes the linker to check if there is at minimum bytes for stack.
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-mhc08
+\begin_inset LatexCommand index
+name "-mhc08"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\series default
+ Generate code for the Freescale/Motorola HC08
+\begin_inset LatexCommand index
+name "HC08"
--pack-iram
-\series default
-\SpecialChar ~
+\end_inset
-\begin_inset LatexCommand \index{-\/-pack-iram}
+ family of processors.
+\end_layout
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
- 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
+\series bold
+-mz80
+\begin_inset LatexCommand index
+name "-mz80"
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\series default
+ Generate code for the Zilog Z80
+\begin_inset LatexCommand index
+name "Z80"
-\backslash
-/
-\end_inset
+\end_inset
--no-pack-iram
-\series default
-\SpecialChar ~
+ family of processors.
+\end_layout
-\begin_inset LatexCommand \index{-\/-no-pack-iram}
+\begin_layout List
+\labelwidthstring 00.00.0000
-\end_inset
+\series bold
+-mgbz80
+\begin_inset LatexCommand index
+name "-mgbz80"
- Causes the linker to use old style for allocating memory areas.
-\layout Subsection
+\end_inset
-DS390 / DS400 Options
-\begin_inset LatexCommand \index{Options DS390}
-\end_inset
+\series default
+ Generate code for the GameBoy Z80
+\begin_inset LatexCommand index
+name "gbz80 (GameBoy Z80)"
+\end_inset
-\begin_inset LatexCommand \index{DS390}
+ processor (Not actively maintained).
+\end_layout
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
+\series bold
+-mavr
+\begin_inset LatexCommand index
+name "-mavr"
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\series default
+ Generate code for the Atmel AVR
+\begin_inset LatexCommand index
+name "AVR"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ processor (Not maintained, not complete).
+ AVR users should probably have a look at winavr
+\begin_inset LatexCommand url
+target "http://sourceforge.net/projects/winavr"
--model-flat24
-\series default
+\end_inset
-\begin_inset LatexCommand \index{DS390!Options!-\/-model-flat24}
+ or
+\begin_inset LatexCommand url
+target "http://www.avrfreaks.net/index.php?name=PNphpBB2&file=index"
-\end_inset
+\end_inset
+, which is based on AVR-port of the gcc compiler.
+\end_layout
-\size large
-\emph on
-
-\size default
-\emph default
-Generate 24-bit flat mode code.
- This is the one and only that the ds390 code generator supports right now
- and is default when using
-\emph on
--mds390
-\emph default
-.
- See section Memory Models for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Standard
+\begin_inset Note Note
+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.
+\end_layout
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\end_layout
--protect-sp-update
-\begin_inset LatexCommand \index{DS390!Options!-\/-protect-sp-update}
+\begin_layout List
+\labelwidthstring 00.00.0000
-\end_inset
+\series bold
+-mpic14
+\begin_inset LatexCommand index
+name "-mpic14"
+\end_inset
-\series default
- disable interrupts during ESP:SP updates.
-\layout List
-\labelwidthstring 00.00.0000
+\series default
+ Generate code for the Microchip PIC 14
+\begin_inset LatexCommand index
+name "PIC14"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+-bit processors (p16f84 and variants.
+ In development, not complete).
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout Standard
+\begin_inset Note Note
+status collapsed
--stack-10bit
-\series default
+\begin_layout Standard
+p16f627 p16f628 p16f84 p16f873 p16f877?
+\end_layout
-\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
--mds390
-\emph default
-.
- In this mode, the stack is located in the lower 1K of the internal RAM,
- which is mapped to 0x400000.
- Note that the support is incomplete, since it still uses a single byte
- as the stack pointer.
- This means that only the lower 256 bytes of the potential 1K stack space
- will actually be used.
- However, this does allow you to reclaim the precious 256 bytes of low RAM
- for use for the DATA and IDATA segments.
- The compiler will not generate any code to put the processor into 10 bit
- stack mode.
- 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
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--stack-auto
-\begin_inset LatexCommand \index{-\/-stack-auto}
+\end_layout
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
+\series bold
+-mpic16
+\begin_inset LatexCommand index
+name "-mpic16"
-\emph default
- option, but that has not been tested.
- It is incompatible with the
-\emph on
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\series default
+ Generate code for the Microchip PIC 16
+\begin_inset LatexCommand index
+name "PIC16"
--xstack
-\begin_inset LatexCommand \index{-\/-xstack}
+\end_inset
-\end_inset
+-bit processors (p18f452 and variants.
+ In development, not complete).
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\emph default
- option.
- It also only makes sense if the processor is in 24 bit contiguous addressing
- mode (see the
-\emph on
--
-\begin_inset ERT
-status Collapsed
+\series bold
+-mtlcs900h
+\series default
+ Generate code for the Toshiba TLCS-900H
+\begin_inset LatexCommand index
+name "TLCS-900H"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ processor (Not maintained, not complete).
+\end_layout
--model-flat24 option
-\emph default
-).
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-mxa51
+\begin_inset LatexCommand index
+name "-mxa51"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\series default
+ Generate code for the Phillips XA51
+\begin_inset LatexCommand index
+name "XA51"
--stack-probe
-\begin_inset LatexCommand \index{DS390!Options!-\/-stack-probe}
+\end_inset
-\end_inset
+ processor (Not maintained, not complete).
+\end_layout
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
-\series default
- insert call to function __stack_probe at each function prologue.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_layout Subsection
+Preprocessor Options
+\begin_inset LatexCommand index
+name "Options preprocessor"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
--tini-libid
-\begin_inset LatexCommand \index{DS390!Options!-\/-tini-libid}
+\begin_inset LatexCommand index
+name "Preprocessor options"
-\end_inset
+\end_inset
-\series default
- LibraryID used in -mTININative.
-
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\begin_inset LatexCommand index
+name "sdcpp (preprocessor)"
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
--use-accelerator
-\begin_inset LatexCommand \index{DS390!Options!-\/-use-accelerator}
+\series bold
+-I
+\begin_inset LatexCommand index
+name "-I"
-\end_inset
+\end_inset
-\series default
- generate code for DS390 Arithmetic Accelerator.
-
-\layout Subsection
+\series default
+ The additional location where the preprocessor will look for <..h> or
+\begin_inset Quotes eld
+\end_inset
-Z80 Options
-\begin_inset LatexCommand \index{Options Z80}
+..h
+\begin_inset Quotes erd
+\end_inset
-\end_inset
+ files.
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\begin_inset LatexCommand \index{Z80}
+\series bold
+-D
+\begin_inset LatexCommand index
+name "-D"
-\end_inset
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+\series default
+ Command line definition of macros.
+ Passed to the preprocessor.
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\series bold
+-M
+\begin_inset LatexCommand index
+name "-M"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
--callee-saves-bc
-\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
+'-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
+name "-E"
-\begin_inset LatexCommand \index{Z80!Options!-\/-callee-saves-bc}
+\end_inset
-\end_inset
+'.
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\size large
-\emph on
-
-\size default
-\emph default
-Force a called function to always save BC.
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\series bold
+-C
+\begin_inset LatexCommand index
+name "-C"
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\series default
+ Tell the preprocessor not to discard comments.
+ Used with the `-E' option.
+\end_layout
-\backslash
-/
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
--no-std-crt0
-\series default
+\series bold
+-MM
+\begin_inset LatexCommand index
+name "-MM"
-\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.
+\series default
+\size large
-\layout Subsection
+\size default
+Like `-M' but the output mentions only the user header files included with
+ `#include
+\begin_inset Quotes eld
+\end_inset
-Optimization Options
-\begin_inset LatexCommand \index{Options optimization}
+file"'.
+ System header files included with `#include ' are omitted.
+\end_layout
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
+\series bold
+-Aquestion(answer)
+\begin_inset LatexCommand index
+name "-Aquestion(answer)"
-\begin_inset LatexCommand \index{Optimization options}
+\end_inset
-\end_inset
+\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.
+\end_layout
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-Umacro
+\begin_inset LatexCommand index
+name "-Umacro"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\series default
+ Undefine macro macro.
+ `-U' options are evaluated after all `-D' options, but before any `-include'
+ and `-imacros' options.
+\end_layout
--nogcse
-\begin_inset LatexCommand \index{-\/-nogcse}
+\begin_layout List
+\labelwidthstring 00.00.0000
-\end_inset
+\series bold
+-dM
+\begin_inset LatexCommand index
+name "-dM"
+\end_inset
-\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
-s
-\emph default
-pill
-\emph on
-loc
-\emph default
-ations, sloc
-\begin_inset LatexCommand \index{sloc (spill location)}
-\end_inset
+\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.
+\end_layout
-).
- 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 ~
-nogcse
-\begin_inset LatexCommand \index{\#pragma nogcse}
+\begin_layout List
+\labelwidthstring 00.00.0000
-\end_inset
+\series bold
+-dD
+\begin_inset LatexCommand index
+name "-dD"
- 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
+\series default
+ Tell the preprocessor to pass all macro definitions into the output, in
+ their proper sequence in the rest of the output.
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\series bold
+-dN
+\begin_inset LatexCommand index
+name "-dN"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
--noinvariant
-\begin_inset LatexCommand \index{-\/-noinvariant}
+\series default
+\size large
+
+\size default
+Like `-dD' except that the macro arguments and contents are omitted.
+ Only `#define name' is included in the output.
+\end_layout
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
+\series bold
+-pedantic-parse-number
+\begin_inset LatexCommand index
+name "pedantic"
-\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 ~
-noinvariant
-\begin_inset LatexCommand \index{\#pragma noinvariant}
+\begin_inset LatexCommand index
+name "-pedantic-parse-number"
-\end_inset
+\end_inset
- can be used to turn off invariant optimizations for a given function only.
-\layout List
-\labelwidthstring 00.00.0000
+\size large
+\bar under
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_inset LatexCommand label
+name "lyx:-pedantic-parse-number"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
--noinduction
-\begin_inset LatexCommand \index{-\/-noinduction}
+\series default
+\bar default
+
+\size default
+Pedantic parse numbers so that situations like 0xfe-LO_B(3) are parsed properly
+ and the macro LO_B(3) gets expanded.
+ See also #pragma pedantic_parse_number
+\begin_inset LatexCommand vpageref
+reference "ite:pedantic_parse_number"
-\end_inset
+\end_inset
+ in section
+\begin_inset LatexCommand ref
+reference "sec:Pragmas"
-\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 ~
-noinduction
-\begin_inset LatexCommand \index{\#pragma noinduction}
+\end_inset
-\end_inset
+
+\emph on
+Note: this functionality is not in conformance with C99 standard!
+\end_layout
- can be used to turn off induction optimizations for a given function only.
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-Wp\InsetSpace ~
+preprocessorOption[,preprocessorOption]
+\series default
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\begin_inset LatexCommand index
+name "-Wp preprocessorOption[,preprocessorOption]"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+...
+ Pass the preprocessorOption to the preprocessor
+\family typewriter
+sdcpp
+\family default
--nojtbound
-\begin_inset LatexCommand \index{-\/-nojtbound}
+\begin_inset LatexCommand index
+name "sdcpp (preprocessor)"
-\end_inset
+\end_inset
+.
+ SDCC uses an adapted version of the preprocessor
+\emph on
+cpp
+\emph default
+ of the GNU Compiler Collection
+\begin_inset LatexCommand index
+name "gcc (GNU Compiler Collection)"
-\size large
-\bar under
-
-\series default
-\size default
-\bar default
- Will not generate boundary condition check when switch statements
-\begin_inset LatexCommand \index{switch statement}
+\end_inset
-\end_inset
+ (
+\emph on
+gcc
+\emph default
+
+\begin_inset LatexCommand url
+target "http://gcc.gnu.org/"
- are implemented using jump-tables.
- See section
-\begin_inset LatexCommand \ref{sub:'switch'-Statements}
+\end_inset
-\end_inset
+), if you need more dedicated options please refer to the GCC\InsetSpace ~
+4.1.1\InsetSpace ~
+CPP\InsetSpace ~
+Manual
+ at
+\begin_inset LatexCommand htmlurl
+target "http://www.gnu.org/software/gcc/onlinedocs/"
-\SpecialChar ~
-Switch Statements for more details.
- It is recommended that this option is NOT used, #pragma\SpecialChar ~
-nojtbound
-\begin_inset LatexCommand \index{\#pragma nojtbound}
+\end_inset
-\end_inset
+.
+\end_layout
- can be used to turn off boundary checking for jump tables for a given function
- only.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_layout
-\layout Standard
+\begin_layout Subsection
+Linker Options
+\begin_inset LatexCommand index
+name "Options linker"
-\backslash
-/
-\end_inset
+\end_inset
--noloopreverse
-\begin_inset LatexCommand \index{-\/-noloopreverse}
-\end_inset
+\begin_inset LatexCommand index
+name "Linker options"
+\end_inset
-\series default
-\size large
-
-\size default
-Will not do loop reversal
-\begin_inset LatexCommand \index{Loop reversing}
-\end_inset
+\end_layout
-optimization.
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-L\InsetSpace ~
-
+\series default
+
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
--
-\series bold
-nolabelopt
-\series default
-
-\begin_inset LatexCommand \index{-\/-nolabelopt }
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
-Will not optimize labels (makes the dumpfiles more readable).
-\layout List
-\labelwidthstring 00.00.0000
+\series bold
+-lib-path
+\begin_inset LatexCommand index
+name "-\\/-lib-path "
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\begin_inset LatexCommand index
+name "-L -\\/-lib-path"
--no-xinit-opt
-\begin_inset LatexCommand \index{-\/-no-xinit-opt}
+\end_inset
-\end_inset
+\series default
+\InsetSpace ~
+ This option is passed to the linkage
+ editor's additional libraries
+\begin_inset LatexCommand index
+name "Libraries"
-\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
+ 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.
+\end_layout
-.
-\layout List
+\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
--nooverlay
-\begin_inset LatexCommand \index{-\/-nooverlay}
+\end_inset
-\end_inset
+-xram-loc
+\series default
+\begin_inset LatexCommand index
+name "-\\/-xram-loc "
-\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_inset
+
+\InsetSpace ~
+ The start location of the external ram
+\begin_inset LatexCommand index
+name "xdata (mcs51, ds390 storage class)"
+\end_inset
-\series bold
--
+, 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
--no-peep
-\begin_inset LatexCommand \index{-\/-no-peep}
+\end_inset
-\end_inset
+-xram-loc 0x8000 or -
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\series default
- Disable peep-hole optimization with built-in rules.
-\layout List
-\labelwidthstring 00.00.0000
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-xram-loc 32768.
+\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
--peep-file
-\series default
+\end_inset
-\begin_inset LatexCommand \index{-\/-peep-file}
+-code-loc
+\series default
-\end_inset
+\begin_inset LatexCommand index
+name "-\\/-code-loc "
-\SpecialChar ~
- 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
+
+\InsetSpace ~
+ The start location of the code
+\begin_inset LatexCommand index
+name "code"
-\end_inset
+\end_inset
-\SpecialChar ~
-Peep Hole optimizations for details on how to write these rules.
-\layout List
-\labelwidthstring 00.00.0000
+ segment, default value 0.
+ Note when this option is used the interrupt vector table
+\begin_inset LatexCommand index
+name "interrupt vector table"
+\end_inset
-\series bold
--
+ 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
--peep-asm
-\begin_inset LatexCommand \index{-\/-peep-asm}
+\end_inset
-\end_inset
+-code-loc 0x8000 or -
+\begin_inset ERT
+status collapsed
+\begin_layout Standard
-\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
+\backslash
+/
+\end_layout
- rules defined in the source file tree '/peeph.def' before using
- this option.
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+
+-code-loc 32768.
+\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
-/
-\end_inset
--opt-code-speed
-\begin_inset LatexCommand \index{-\/-opt-code-speed}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
+-stack-loc
+\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
+\begin_inset LatexCommand index
+name "-\\/-stack-loc "
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\InsetSpace ~
+ By default the stack
+\begin_inset LatexCommand index
+name "stack"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ is placed after the data segment.
+ Using this option the stack can be placed anywhere in the internal memory
+ space of the 8051.
+ The value entered can be in Hexadecimal or Decimal format, e.g.
+ -
+\begin_inset ERT
+status collapsed
--opt-code-size
-\begin_inset LatexCommand \index{-\/-opt-code-size}
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\series default
- The compiler will optimize code generation towards compact code, possibly
- at the expense of code speed.
-\layout Subsection
+\end_inset
-Other Options
-\begin_inset LatexCommand \index{Options other}
+-stack-loc 0x20 or -
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Standard
-\layout List
-\labelwidthstring 00.00.0000
+\backslash
+/
+\end_layout
+\end_inset
-\series bold
--c\SpecialChar ~
+-stack-loc 32.
+ Since the sp register is incremented before a push or call, the initial
+ sp will be set to one byte prior the provided value.
+ The provided value should not overlap any other memory areas such as used
+ register banks or the data segment and with enough space for the current
+ application.
+ The
+\series bold
-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--compile-only
-\begin_inset LatexCommand \index{-\/-compile-only}
+status collapsed
-\end_inset
+\begin_layout Standard
-\begin_inset LatexCommand \index{-c -\/-compile-only}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
+-pack-iram
+\series default
+\InsetSpace ~
-\series default
- will compile and assemble the source, but will not call the linkage editor.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_inset LatexCommand index
+name "-\\/-pack-iram"
+\end_inset
-\series bold
+ option (which is now a default setting) will override this setting, so
+ you should also specify the
+\series bold
-
-\series default
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
+
+\backslash
/
-\end_inset
+\end_layout
+\end_inset
-\series bold
--c1mode
-\begin_inset LatexCommand \index{-\/-c1mode}
+-no-pack-iram
+\series default
+\InsetSpace ~
-\end_inset
+\begin_inset LatexCommand index
+name "-\\/-no-pack-iram"
+\end_inset
-\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
+ option if you need to manually place the stack.
+\end_layout
+
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-
+\begin_inset ERT
+status collapsed
-\series bold
--E
-\begin_inset LatexCommand \index{-E}
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\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_inset
+-xstack-loc
+\series default
-\series bold
--o\SpecialChar ~
-
-\begin_inset LatexCommand \index{-o }
+\begin_inset LatexCommand index
+name "-\\/-xstack-loc "
-\end_inset
+\end_inset
-
-\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
+\InsetSpace ~
+ By default the external stack
+\begin_inset LatexCommand index
+name "xstack"
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+ is placed after the pdata
+\begin_inset LatexCommand index
+name "pdata (mcs51, ds390 storage class)"
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+ segment.
+ Using this option the xstack can be placed anywhere in the external memory
+ space of the 8051.
+ The value entered can be in Hexadecimal or Decimal format, e.g.
+ -
+\begin_inset ERT
+status collapsed
--stack-auto
-\begin_inset LatexCommand \index{-\/-stack-auto}
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\series default
-\size large
-\emph on
-
-\size default
-\emph default
-All functions in the source file will be compiled as
-\emph on
-reentrant
-\emph default
+\end_inset
-\begin_inset LatexCommand \index{reentrant}
+-xstack-loc 0x8000 or -
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Standard
-, i.e.
- the parameters and local variables will be allocated on the stack
-\begin_inset LatexCommand \index{stack}
-\end_inset
+\backslash
+/
+\end_layout
-.
- See section
-\begin_inset LatexCommand \ref{sec:Parameters-and-Local-Variables}
+\end_inset
-\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.
+\end_layout
- 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
+\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
--callee-saves
-\begin_inset LatexCommand \index{-\/-callee-saves}
+\end_inset
-\end_inset
+-data-loc
+\series default
- function1[,function2][,function3]....
+\begin_inset LatexCommand index
+name "-\\/-data-loc "
-\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.
- This option can be used to switch the register saving convention for the
- function names specified.
- The compiler will not save registers when calling these functions, no extra
- code will be generated at the entry & exit (function prologue
-\series bold
+\end_inset
-\begin_inset LatexCommand \index{function prologue}
+\InsetSpace ~
+ The start location of the internal ram data
+\begin_inset LatexCommand index
+name "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
-\series default
- & epilogue
-\series bold
+\begin_layout Standard
-\begin_inset LatexCommand \index{function epilogue}
-\end_inset
+\backslash
+/
+\end_layout
+\end_inset
-\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.
- In the future the compiler (with inter procedural analysis) will be able
- to determine the appropriate scheme to use for each function call.
- DO NOT use this option for built-in functions such as _mulint..., if this
- option is used for a library function the appropriate library function
- needs to be recompiled with the same option.
- If the project consists of multiple source files then all the source file
- should be compiled with the same -
+-data-loc 0x20 or -
\begin_inset ERT
-status Collapsed
+status collapsed
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
--callee-saves option string.
- Also see #pragma\SpecialChar ~
-callee_saves
-\begin_inset LatexCommand \index{\#pragma callee\_saves}
+\end_inset
+
+-data-loc 32.
+ (By default, the start location of the internal ram data segment is set
+ as low as possible in memory, taking into account the used register banks
+ and the bit segment at address 0x20.
+ 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
-\end_inset
+\begin_layout Standard
-.
-\layout List
-\labelwidthstring 00.00.0000
+\backslash
+/
+\end_layout
+
+\end_inset
+
+-data-loc is not used, to location 0x10.)
+\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
-/
-\end_inset
--debug
-\begin_inset LatexCommand \index{-\/-debug}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
+-idata-loc
+\series default
-\bar under
-
-\series default
-\bar default
-When this option is used the compiler will generate debug information.
- The debug information collected in a file with .cdb extension can be used
- with the SDCDB.
- For more information see documentation for SDCDB.
- Another file with no extension contains debug information in AOMF or AOMF51
-\begin_inset LatexCommand \index{AOMF, AOMF51}
+\begin_inset LatexCommand index
+name "-\\/-idata-loc "
-\end_inset
+\end_inset
- format which is commonly used by third party tools.
-\layout List
-\labelwidthstring 00.00.0000
+\InsetSpace ~
+ The start location of the indirectly addressable internal ram
+\begin_inset LatexCommand index
+name "idata (mcs51, ds390 storage class)"
+\end_inset
-\series bold
--S
-\begin_inset LatexCommand \index{-S}
+ of the 8051, default value is 0x80.
+ The value entered can be in Hexadecimal or Decimal format, eg.
+ -
+\begin_inset ERT
+status collapsed
-\end_inset
+\begin_layout Standard
-\size large
-\bar under
-
-\series default
-\size default
-\bar default
-Stop after the stage of compilation proper; do not assemble.
- The output is an assembler code file for the input file specified.
-\layout List
-\labelwidthstring 00.00.0000
+\backslash
+/
+\end_layout
+\end_inset
-\series bold
--
+-idata-loc 0x88 or -
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
--int-long-reent
-\begin_inset LatexCommand \index{-\/-int-long-reent}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
+-idata-loc 136.
+\end_layout
-\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
+\begin_layout List
\labelwidthstring 00.00.0000
-
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
-
-\backslash
-/
-\end_inset
+\begin_layout Standard
--cyclomatic
-\begin_inset LatexCommand \index{-\/-cyclomatic}
-\end_inset
+\backslash
+/
+\end_layout
+\end_inset
-\bar under
-
-\series default
-\bar default
-This option will cause the compiler to generate an information message for
- each function in the source file.
- The message contains some
-\emph on
-important
-\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
-cyclomatic complexity
-\begin_inset LatexCommand \index{Cyclomatic complexity}
+-bit-loc
+\series default
+\InsetSpace ~
+ The start location of the bit
+\begin_inset LatexCommand index
+name "bit"
-\end_inset
+\end_inset
+ addressable internal ram of the 8051.
+ This is
+\emph on
+not
+\emph default
+ implemented yet.
+ Instead an option can be passed directly to the linker: -Wl\InsetSpace ~
+-bBSEG=.
+\end_layout
-\emph default
- see section on Cyclomatic Complexity for more details.
-\layout List
+\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
--float-reent
-\begin_inset LatexCommand \index{-\/-float-reent}
+\end_inset
-\end_inset
+-out-fmt-ihx
+\begin_inset LatexCommand index
+name "-\\/-out-fmt-ihx"
+\end_inset
-\series default
- Floating point library is compiled as reentrant
-\begin_inset LatexCommand \index{reentrant}
+
+\series default
+The linker output (final object code) is in Intel Hex format.
+\begin_inset LatexCommand index
+name "Intel hex format"
+
+\end_inset
+
+ This is the default option.
+ The format itself is documented in the documentation of srecord
+\begin_inset LatexCommand index
+name "srecord (bin, hex, ... tool)"
-\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
+
+\begin_layout Standard
-\layout Standard
-\backslash
+\backslash
/
-\end_inset
+\end_layout
--main-return
-\begin_inset LatexCommand \index{-\/-main-return}
+\end_inset
-\end_inset
+-out-fmt-s19
+\begin_inset LatexCommand index
+name "-\\/-out-fmt-s19"
+\end_inset
-\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
- space.
- The return from the 'main'
-\begin_inset LatexCommand \index{main return}
+
+\series default
+The linker output (final object code) is in Motorola S19 format
+\begin_inset LatexCommand index
+name "Motorola S19 format"
-\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
-sjmp .
-\family default
-'.
-\layout List
-\labelwidthstring 00.00.0000
+.
+ The format itself is documented in the documentation of srecord.
+\end_layout
+\begin_layout List
+\labelwidthstring 00.00.0000
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
+status collapsed
-\backslash
-/
-\end_inset
+\begin_layout Standard
--nostdinc
-\begin_inset LatexCommand \index{-\/-nostdinc}
-\end_inset
+\backslash
+/
+\end_layout
+\end_inset
-\series default
- This will prevent the compiler from passing on the default include path
- to the preprocessor.
-\layout List
-\labelwidthstring 00.00.0000
+-out-fmt-elf
+\begin_inset LatexCommand index
+name "-\\/-out-fmt-s19"
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\begin_inset LatexCommand index
+name "HC08!Options!-\\/-out-fmt-elf"
-\backslash
-/
-\end_inset
+\end_inset
--nostdlib
-\begin_inset LatexCommand \index{-\/-nostdlib}
+
+\series default
+The linker output (final object code) is in ELF format
+\begin_inset LatexCommand index
+name "ELF format"
-\end_inset
+\end_inset
+.
+ (Currently only supported for the HC08
+\begin_inset LatexCommand index
+name "HC08"
-\series default
- This will prevent the compiler from passing on the default library
-\begin_inset LatexCommand \index{Libraries}
+\end_inset
-\end_inset
+ processors)
+\end_layout
- path to the linker.
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-Wl\InsetSpace ~
+linkOption[,linkOption]
+\series default
+
+\begin_inset LatexCommand index
+name "-Wl linkOption[,linkOption]"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\begin_inset LatexCommand label
+name "lyx:-Wl option"
--verbose
-\begin_inset LatexCommand \index{-\/-verbose}
+\end_inset
-\end_inset
+...
+ Pass the linkOption to the linker.
+ If a bootloader is used an option like
+\begin_inset Quotes sld
+\end_inset
+-Wl\InsetSpace ~
+-bCSEG=0x1000
+\begin_inset Quotes srd
+\end_inset
-\series default
- Shows the various actions the compiler is performing.
-\layout List
-\labelwidthstring 00.00.0000
+ would be typical to set the start of the code segment.
+ Either use the double quotes around this option or use no space (e.g.
+ -Wl-bCSEG=0x1000).
+ See also #pragma constseg and #pragma codeseg in section
+\begin_inset LatexCommand ref
+reference "sec:Pragmas"
+\end_inset
-\series bold
--V
-\begin_inset LatexCommand \index{-V}
+ .
+ File sdcc/as/doc/asxhtm.html has more on linker options.
+\end_layout
-\end_inset
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
-\series default
- Shows the actual commands the compiler is executing.
-\layout List
-\labelwidthstring 00.00.0000
+\end_layout
+\begin_layout Subsection
+MCS51 Options
+\begin_inset LatexCommand index
+name "Options MCS51"
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\begin_inset LatexCommand index
+name "MCS51 options"
--no-c-code-in-asm
-\begin_inset LatexCommand \index{-\/-no-c-code-in-asm}
+\end_inset
-\end_inset
+\end_layout
-\series default
- Hides your ugly and inefficient c-code from the asm file, so you can always
- blame the compiler :)
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
-
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--no-peep-comments
-\begin_inset LatexCommand \index{-\/-no-peep-comments}
-
-\end_inset
+status collapsed
-
-\series default
- Will not include peep-hole comments in the generated files.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Standard
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+-model-small
+\begin_inset LatexCommand index
+name "-\\/-model-small"
--i-code-in-asm
-\begin_inset LatexCommand \index{-\/-i-code-in-asm}
+\end_inset
-\end_inset
+\series default
+\size large
+
+\size default
+Generate code for Small Model programs, see section Memory Models for more
+ details.
+ This is the default model.
+\end_layout
-\series default
- Include i-codes in the asm file.
- Sounds like noise but is most helpful for debugging the compiler itself.
-\layout List
+\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
--less-pedantic
-\begin_inset LatexCommand \index{-\/-less-pedantic}
+\end_inset
-\end_inset
+-model-medium
+\begin_inset LatexCommand index
+name "-\\/-model-medium"
+\end_inset
-\series default
- Disable some of the more pedantic warnings
-\begin_inset LatexCommand \index{Warnings}
-\end_inset
+\series default
+ Generate code for Medium model programs, see section Memory Models for
+ more details.
+ If this option is used all source files in the project have to be compiled
+ with this option.
+ It must also be used when invoking the linker.
+\end_layout
- (jwk burps: please be more specific here, please!).
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
-
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--disable-warning\SpecialChar ~
-
-\begin_inset LatexCommand \index{-\/-disable-warning}
-
-\end_inset
-
+status collapsed
-\series default
- Disable specific warning with number .
-\layout List
-\labelwidthstring 00.00.0000
+\begin_layout Standard
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\backslash
+/
+\end_layout
-\layout Standard
+\end_inset
-\backslash
-/
-\end_inset
+-model-large
+\begin_inset LatexCommand index
+name "-\\/-model-large"
--print-search-dirs
-\begin_inset LatexCommand \index{-\/-print-search-dirs}
+\end_inset
-\end_inset
+\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.
+\end_layout
-\series default
- Display the directories in the compiler's search path
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
-
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--vc
-\begin_inset LatexCommand \index{-\/-vc}
+status collapsed
-\end_inset
+\begin_layout Standard
-\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
-
-.
- With SDCC both offering a GCC-like (the default) and a MSVC-like
-\begin_inset LatexCommand \index{MSVC output style}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
- output style, integration into most programming editors should be straightforwa
-rd.
-\layout List
-\labelwidthstring 00.00.0000
+-xstack
+\begin_inset LatexCommand index
+name "-\\/-xstack"
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\series default
+ Uses a pseudo stack in the pdata
+\begin_inset LatexCommand index
+name "pdata (mcs51, ds390 storage class)"
-\backslash
-/
-\end_inset
+\end_inset
--use-stdout
-\begin_inset LatexCommand \index{-\/-use-stdout}
+ area (usually the first 256 bytes in the external ram) for allocating variables
+ and passing parameters.
+ See section
+\begin_inset LatexCommand ref
+reference "sub:External-Stack"
-\end_inset
+\end_inset
+\InsetSpace ~
+ External Stack for more details.
+\end_layout
-\series default
- Send errors and warnings to stdout instead of stderr.
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
+\series bold
+-
+\begin_inset ERT
+status collapsed
-\series bold
--Wa\SpecialChar ~
-asmOption[,asmOption]
-\series default
-
-\begin_inset LatexCommand \index{-Wa asmOption[,asmOption]}
+\begin_layout Standard
-\end_inset
-...
- Pass the asmOption to the assembler
-\begin_inset LatexCommand \index{Options assembler}
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
+-iram-size
+\series default
+\InsetSpace ~
+
+\begin_inset LatexCommand index
+name "-\\/-iram-size "
-\begin_inset LatexCommand \index{Assembler options}
+\end_inset
-\end_inset
+ Causes the linker to check if the internal ram usage is within limits of
+ the given value.
+\end_layout
-.
- See file sdcc/as/doc/asxhtm.html for assembler options.cd
-\layout List
+\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
--std-sdcc89
-\begin_inset LatexCommand \index{-\/-std-sdcc89}
+\end_inset
-\end_inset
+-xram-size
+\series default
+\InsetSpace ~
+
+\begin_inset LatexCommand index
+name "-\\/-xram-size "
+\end_inset
-\series default
- Generally follow the C89 standard, but allow SDCC features that conflict
- with the standard (default).
-\layout List
-\labelwidthstring 00.00.0000
+ Causes the linker to check if the external ram usage is within limits of
+ the given value.
+\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
--std-c89
-\begin_inset LatexCommand \index{-\/-std-c89}
+\end_inset
-\end_inset
+-code-size
+\series default
+\InsetSpace ~
+
+\begin_inset LatexCommand index
+name "-\\/-code-size "
+\end_inset
-\series default
- Follow the C89 standard and disable SDCC features that conflict with the
- standard.
-\layout List
-\labelwidthstring 00.00.0000
+ Causes the linker to check if the code memory usage is within limits of
+ the given value.
+\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
--std-sdcc99
-\begin_inset LatexCommand \index{-\/-std-sdcc99}
+\end_inset
-\end_inset
+-stack-size
+\series default
+\InsetSpace ~
+
+\begin_inset LatexCommand index
+name "-\\/-stack-size "
+\end_inset
-\series default
- Generally follow the C99 standard, but allow SDCC features that conflict
- with the standard (incomplete support).
-\layout List
-\labelwidthstring 00.00.0000
+ Causes the linker to check if there is at minimum bytes for stack.
+\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
--std-c99
-\begin_inset LatexCommand \index{-\/-std-sdcc99}
+\end_inset
+
+-pack-iram
+\series default
+\InsetSpace ~
-\end_inset
+\begin_inset LatexCommand index
+name "-\\/-pack-iram"
+\end_inset
-\series default
- Follow the C99 standard and disable SDCC features that conflict with the
- standard (incomplete support).
-\layout List
-\labelwidthstring 00.00.0000
+ Causes the linker to use unused register banks for data variables and pack
+ data, idata and stack together.
+ This is the default now.
+\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
--codeseg
-\series default
+\end_inset
-\begin_inset LatexCommand \index{-\/-codeseg }
+-no-pack-iram
+\series default
+\InsetSpace ~
-\end_inset
+\begin_inset LatexCommand index
+name "-\\/-no-pack-iram"
-\SpecialChar ~
- The name to be used for the code
-\begin_inset LatexCommand \index{code}
+\end_inset
-\end_inset
+ Causes the linker to use old style for allocating memory areas.
+\end_layout
- segment, default CSEG.
- This is useful if you need to tell the compiler to put the code in a special
- segment so you can later on tell the linker to put this segment in a special
- place in memory.
- Can be used for instance when using bank switching to put the code in a
- bank.
-\layout List
+\begin_layout List
\labelwidthstring 00.00.0000
-
-\series bold
+\series bold
-
\begin_inset ERT
-status Collapsed
+status collapsed
-\layout Standard
+\begin_layout Standard
-\backslash
-/
-\end_inset
-
--constseg
-\series default
-\begin_inset LatexCommand \index{-\/-constseg }
+\backslash
+/
+\end_layout
-\end_inset
+\end_inset
-\SpecialChar ~
- The name to be used for the const
-\begin_inset LatexCommand \index{code}
+-acall-ajmp
+\series default
+\InsetSpace ~
-\end_inset
+\begin_inset LatexCommand index
+name "-\\/-acall-ajmp"
- segment, default CONST.
- This is useful if you need to tell the compiler to put the const data in
- a special segment so you can later on tell the linker to put this segment
- in a special place in memory.
- Can be used for instance when using bank switching to put the const data
- in a bank.
-\layout List
-\added_space_bottom bigskip \labelwidthstring 00.00.0000
+\end_inset
+ Replaces the three byte instructions lcall/ljmp with the two byte instructions
+ acall/ajmp.
+ Only use this option if your code is in the same 2k block of memory.
+ You may need to use this option for some 8051 derivatives which lack the
+ lcall/ljmp instructions..
+\end_layout
-\series bold
-more-pedantic
-\series default
- Actually this is
-\series bold
-\emph on
-not
-\series default
-\emph default
- a SDCC compiler option but if you want
-\emph on
-more
-\emph default
- warnings you can use a separate tool dedicated to syntax checking like
- splint
-\begin_inset LatexCommand \label{lyx:more-pedantic-SPLINT}
+\begin_layout Standard
+\begin_inset VSpace bigskip
+\end_inset
-\end_inset
+\end_layout
-\begin_inset LatexCommand \index{lint (syntax checking tool)}
+\begin_layout Subsection
+DS390 / DS400 Options
+\begin_inset LatexCommand index
+name "Options DS390"
-\end_inset
+\end_inset
-
-\begin_inset LatexCommand \url{http://www.splint.org}
-\end_inset
+\begin_inset LatexCommand index
+name "DS390"
-.
- To make your source files parseable by splint you will have to include
-
-\family sans
-lint.h
-\family default
+\end_inset
-\begin_inset LatexCommand \index{splint (syntax checking tool)}
-\end_inset
+\end_layout
- in your source file and add brackets around extended keywords (like
-\family sans
+\begin_layout List
+\labelwidthstring 00.00.0000
-\begin_inset Quotes sld
-\end_inset
+\series bold
+-
+\begin_inset ERT
+status collapsed
-__at\SpecialChar ~
+\begin_layout Standard
-\series bold
-(
-\series default
-0xab
-\series bold
-)
-\series default
-\begin_inset Quotes srd
-\end_inset
+\backslash
+/
+\end_layout
+\end_inset
-\family default
- and
-\family sans
+-model-flat24
+\series default
-\begin_inset Quotes sld
-\end_inset
+\begin_inset LatexCommand index
+name "DS390!Options!-\\/-model-flat24"
-__interrupt\SpecialChar ~
-(2)
-\begin_inset Quotes srd
-\end_inset
+\end_inset
-\family default
-).
+\size large
-\newline
-Splint has an excellent on line manual at
-\begin_inset LatexCommand \url{http://www.splint.org/manual/}
+\size 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
+-mds390
+\emph default
+.
+ See section Memory Models for more details.
+\end_layout
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
- 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
+\series bold
+-
+\begin_inset ERT
+status collapsed
-\family sans
-splint\SpecialChar ~
--I\SpecialChar ~
-/usr/local/share/sdcc/include/mcs51/\SpecialChar ~
-\SpecialChar ~
-myprogram.c
-\layout Subsection
+\begin_layout Standard
-Intermediate Dump Options
-\begin_inset LatexCommand \label{sub:Intermediate-Dump-Options}
-\end_inset
+\backslash
+/
+\end_layout
+\end_inset
-\begin_inset LatexCommand \index{Options intermediate dump}
+-protect-sp-update
+\begin_inset LatexCommand index
+name "DS390!Options!-\\/-protect-sp-update"
-\end_inset
+\end_inset
-\begin_inset LatexCommand \index{Intermediate dump options}
+\series default
+ disable interrupts during ESP:SP updates.
+\end_layout
-\end_inset
+\begin_layout List
+\labelwidthstring 00.00.0000
+\series bold
+-
+\begin_inset ERT
+status collapsed
-\layout Standard
+\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
+\backslash
+/
+\end_layout
-) 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
+-stack-10bit
+\series default
-
-\begin_inset Quotes srd
-\end_inset
+\begin_inset LatexCommand index
+name "DS390!Options!-\\/-stack-10bit"
-The anatomy of the compiler
-\begin_inset Quotes srd
-\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
+-mds390
+\emph default
.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
+ In this mode, the stack is located in the lower 1K of the internal RAM,
+ which is mapped to 0x400000.
+ Note that the support is incomplete, since it still uses a single byte
+ as the stack pointer.
+ This means that only the lower 256 bytes of the potential 1K stack space
+ will actually be used.
+ However, this does allow you to reclaim the precious 256 bytes of low RAM
+ for use for the DATA and IDATA segments.
+ The compiler will not generate any code to put the processor into 10 bit
+ stack mode.
+ 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
-
\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
+status collapsed
--dumpraw
-\begin_inset LatexCommand \index{-\/-dumpraw}
+\begin_layout Standard
-\end_inset
+\backslash
+/
+\end_layout
-\series default
- This option will cause the compiler to dump the intermediate code into
- a file of named
-\emph on
-