X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=doc%2Fsdccman.lyx;h=c4ce3eba5665fbec3744787ae389bbd7b950254f;hb=ee76e2f5985c5917392f3f6ea121db57a9e314ce;hp=2cb5753433bdb35c93f5b2fe821843ba2ed8ee62;hpb=97cba45c4a758f4a8632bebc5064c6838536571d;p=fw%2Fsdcc
diff --git a/doc/sdccman.lyx b/doc/sdccman.lyx
index 2cb57534..c4ce3eba 100644
--- a/doc/sdccman.lyx
+++ b/doc/sdccman.lyx
@@ -1,15 +1,21 @@
#LyX 1.3 created this file. For more info see http://www.lyx.org/
\lyxformat 221
-\textclass article
+\textclass book
\begin_preamble
+\pdfoptionpdfminorversion=3
\usepackage[
pdftitle={SDCC Compiler User Guide},
pdfauthor={SDCC development team},
pdfsubject={installation, user manual},
- pdfkeywords={8032, 8051, ansi, c, compiler, CPU, DS390,
- embedded, GPL, manual, mcs51, PIC, small, Z80},
+ 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}
+%
+\sloppy
+\tolerance=500
+\emergencystretch=30pt
+%
\date{}
\end_preamble
\language english
@@ -26,9 +32,9 @@
\use_numerical_citations 0
\paperorientation portrait
\leftmargin 30mm
-\topmargin 10mm
+\topmargin 20mm
\rightmargin 25mm
-\bottommargin 15mm
+\bottommargin 20mm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
@@ -61,30 +67,31 @@ Two resp.
\layout Comment
Architecture specific stuff (like memory models, code examples) should maybe
- go
+ later go
\layout Comment
into seperate sections/chapters/appendices (it is hard to document PIC or
Z80 in
\layout Comment
-a 8051 centered document)
+a 8051 centered document) - for now simply add.
\layout Title
SDCC Compiler User Guide
-\layout Comment
+\layout Date
-The strings enclosed in $ are automatically updated by cvs:
-\layout Standard
-\align center
+\size normal
+SDCC 2.6.2
\size footnotesize
-$Date$
-\layout Standard
-\align center
-\size footnotesize
+\newline
+$Date$
+\newline
$Revision$
+\layout Comment
+
+The above strings enclosed in $ are automatically updated by Subversion
\layout Standard
@@ -93,10 +100,10 @@ $Revision$
\end_inset
-\layout Section
-\pagebreak_top
+\layout Chapter
+
Introduction
-\layout Subsection
+\layout Section
About SDCC
\layout Standard
@@ -105,22 +112,50 @@ About SDCC
\series bold
SDCC
\series default
- is a Freeware, retargettable, optimizing ANSI-C compiler by
+ (
+\emph on
+S
+\emph default
+mall
+\emph on
+D
+\emph default
+evice
+\emph on
+C
+\emph default
+
+\emph on
+C
+\emph default
+ompiler) is an open source, retargettable, optimizing ANSI-C compiler by
+
\series bold
Sandeep Dutta
\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 CPU}
+\begin_inset LatexCommand \index{8031, 8032, 8051, 8052, mcs51 CPU}
\end_inset
-, etc), Zilog Z80 based MCUs, and the Dallas DS80C390 variant.
- It can be retargetted for other microprocessors, support for Microchip
- PIC, Atmel AVR is under development.
+, etc.), Dallas DS80C390 variants, Freescale (formerly Motorola) HC08 and
+ Zilog Z80 based MCUs.
+ It can be retargeted for other microprocessors, support for Microchip PIC,
+ Atmel AVR is under development.
The entire source code for the compiler is distributed under GPL.
- SDCC uses ASXXXX & ASLINK, a Freeware, retargettable assembler & linker.
+ SDCC uses ASXXXX
+\begin_inset LatexCommand \index{asXXXX (as-gbz80, as-hc08, asx8051, as-z80)}
+
+\end_inset
+
+ & ASLINK
+\begin_inset LatexCommand \index{aslink}
+
+\end_inset
+
+, an open source retargetable assembler & linker.
SDCC has extensive language extensions suitable for utilizing various microcont
rollers and underlying hardware effectively.
@@ -167,359 +202,375 @@ The peep hole optimizer uses a rule based substitution mechanism which is
\newline
Supported data-types are:
-\layout Itemize
-
-char (8 bits, 1 byte),
-\layout Itemize
+\layout Standard
-short and int (16 bits, 2 bytes),
-\layout Itemize
-long (32 bit, 4 bytes)
-\layout Itemize
+\begin_inset Tabular
+
+
+
+
+
+
+
+
+
+\begin_inset Text
-float (4 byte IEEE).
-
\layout Standard
-The compiler also allows
-\emph on
-inline assembler code
-\emph default
- to be embedded anywhere in a function.
- In addition, routines developed in assembly can also be called.
-\newline
-
-\newline
-SDCC also provides an option (-
-\begin_inset ERT
-status Collapsed
+type
+\end_inset
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+width
\end_inset
+
+
+\begin_inset Text
--cyclomatic) to report the relative complexity of a function.
- These functions can then be further optimized, or hand coded in assembly
- if needed.
-
-\newline
+\layout Standard
-\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
+default
+\end_inset
+
+
+\begin_inset Text
-\newline
-The latest version can be downloaded from
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
+\layout Standard
+signed range
\end_inset
+
+
+\begin_inset Text
-.
+\layout Standard
-\series bold
-
-\series default
-\emph on
-Please note: the compiler will probably always be some steps ahead of this
- documentation
-\series bold
-\emph default
+unsigned range
+\end_inset
+
+
+
+
+\begin_inset Text
-\begin_inset LatexCommand \index{Status of documentation}
+\layout Standard
+bool
\end_inset
+
+
+\begin_inset Text
+\layout Standard
-\begin_inset Foot
-collapsed false
+1 bit
+\end_inset
+
+
+\begin_inset Text
\layout Standard
-Obviously this has pros and cons
+unsigned
\end_inset
+
+
+\begin_inset Text
-.
-\layout Subsection
-
-Open Source
\layout Standard
-All packages used in this compiler system are
-\emph on
-opensource
-\emph default
- and
-\emph on
-freeware
-\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}
-
+-
\end_inset
+
+
+\begin_inset Text
- 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}
+\layout Standard
+0, 1
\end_inset
+
+
+
+
+\begin_inset Text
- of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
- You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA.
- In other words, you are welcome to use, share and improve this program.
- You are forbidden to forbid anyone else to use, share and improve what
- you give them.
- Help stamp out software-hoarding!
-\layout Subsection
-
-Typographic conventions
-\begin_inset LatexCommand \index{Typographic conventions}
+\layout Standard
+char
\end_inset
-
+
+
+\begin_inset Text
\layout Standard
-Throughout this manual, we will use the following convention.
- Commands you have to type in are printed in
-\family sans
-\series bold
-"sans serif"
-\series default
-.
+8 bits, 1 byte
+\end_inset
+
+
+\begin_inset Text
-\family default
- Code samples are printed in
-\family typewriter
-typewriter font.
+\layout Standard
-\family default
- Interesting items and new terms are printed in
-\emph on
-italic.
-\layout Subsection
+signed
+\end_inset
+
+
+\begin_inset Text
-Compatibility with previous versions
\layout Standard
-This version has numerous bug fixes compared with the previous version.
- But we also introduced some incompatibilities with older versions.
- Not just for the fun of it, but to make the compiler more stable, efficient
- and ANSI compliant
-\begin_inset LatexCommand \index{ANSI-compliance}
-
+-128, +127
\end_inset
+
+
+\begin_inset Text
-.
-
-\newline
+\layout Standard
-\layout Itemize
+0, +255
+\end_inset
+
+
+
+
+\begin_inset Text
-short is now equivalent to int (16 bits), it used to be equivalent to char
- (8 bits) which is not ANSI compliant
-\layout Itemize
+\layout Standard
-the default directory for gcc-builds where include, library and documentation
- files are stored is now in /usr/local/share
-\layout Itemize
+short
+\end_inset
+
+
+\begin_inset Text
-char type parameters to vararg functions are casted to int unless explicitly
- casted, e.g.:
-\newline
+\layout Standard
-\family typewriter
-\SpecialChar ~
-\SpecialChar ~
-char a=3;
-\newline
-\SpecialChar ~
-\SpecialChar ~
-printf ("%d %c
-\backslash
-n", a, (char)a);
-\family default
+16 bits, 2 bytes
+\end_inset
+
+
+\begin_inset Text
-\newline
- will push a as an int and as a char resp.
-\layout Itemize
+\layout Standard
-option -
-\begin_inset ERT
-status Collapsed
+signed
+\end_inset
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+-32.768, +32.767
\end_inset
-
--regextend has been removed
-\layout Itemize
-
-option -
-\begin_inset ERT
-status Collapsed
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+0, +65.535
\end_inset
+
+
+
+
+\begin_inset Text
--noregparms has been removed
-\layout Itemize
+\layout Standard
-option -
-\begin_inset ERT
-status Collapsed
+int
+\end_inset
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+16 bits, 2 bytes
\end_inset
+
+
+\begin_inset Text
--stack-after-data has been removed
\layout Standard
+signed
+\end_inset
+
+
+\begin_inset Text
-\emph on
-
-\layout Subsection
-
-System Requirements
\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.
-\layout Subsection
+-32.768, +32.767
+\end_inset
+
+
+\begin_inset Text
-Other Resources
\layout Standard
-The SDCC home page at
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/}
-
+0, +65.535
\end_inset
+
+
+
+
+\begin_inset Text
- 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.
- Some of the other tools (simulator and assembler) included with SDCC contain
- their own documentation and can be found in the source distribution.
- If you want the latest unreleased software, the complete source package
- is available directly by anonymous CVS on cvs.sdcc.sourceforge.net.
-\layout Subsection
-
-Wishes for the future
\layout Standard
-There are (and always will be) some things that could be done.
- Here are some I can think of:
-\newline
+long
+\end_inset
+
+
+\begin_inset Text
\layout Standard
-
-\family typewriter
-char KernelFunction3(char p) at 0x340;
-\newline
+32 bits, 4 bytes
+\end_inset
+
+
+\begin_inset Text
\layout Standard
+signed
+\end_inset
+
+
+\begin_inset Text
-\family typewriter
-code banking
-\begin_inset LatexCommand \index{code banking (not supported)}
+\layout Standard
+-2.147.483.648, +2.147.483.647
\end_inset
+
+
+\begin_inset Text
- support for mcs51
-\newline
+\layout Standard
-\newline
+0, +4.294.967.295
+\end_inset
+
+
+
+
+\begin_inset Text
-\family default
-If you can think of some more, please see the chapter
-\begin_inset LatexCommand \ref{sub:Requesting-Features}
+\layout Standard
+float
\end_inset
+
+
+\begin_inset Text
- about filing feature requests
-\begin_inset LatexCommand \index{Requesting features}
+\layout Standard
+4 bytes IEEE 754
\end_inset
+
+
+\begin_inset Text
+\layout Standard
-\begin_inset LatexCommand \index{Feature request}
-
+signed
\end_inset
+
+
+\begin_inset Text
-.
-\newline
-
-\layout Section
-\pagebreak_top
-Installing SDCC
-\begin_inset LatexCommand \index{Installation}
+\layout Standard
\end_inset
+
+
+\begin_inset Text
+
+\layout Standard
+1.175494351E-38,
+\family roman
+\series medium
+\shape up
+\size normal
+\emph off
+\bar no
+\noun off
+\color none
+3.402823466E+38
+\end_inset
+
+
+
+
+\begin_inset Text
\layout Standard
-For most users it is sufficient to skip to either section
-\begin_inset LatexCommand \ref{sub:Building-SDCC-on-Linux}
+pointer
+\end_inset
+
+
+\begin_inset Text
+\layout Standard
+
+1, 2, 3 or 4 bytes
\end_inset
+
+
+\begin_inset Text
- or section
-\begin_inset LatexCommand \ref{sub:Windows-Install}
+\layout Standard
+generic
\end_inset
+
+
+\begin_inset Text
-.
- More detailled instructions follow below.
-\layout Subsection
+\layout Standard
-Configure Options
-\begin_inset LatexCommand \index{Options SDCC configuration}
+\end_inset
+
+
+\begin_inset Text
+
+\layout Standard
\end_inset
+
+
+
+\end_inset
-\layout Standard
-The install paths, search paths and other options are defined when running
- 'configure'.
- The defaults can be overridden by:
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+The compiler also allows
+\emph on
+inline assembler code
+\emph default
+ to be embedded anywhere in a function.
+ In addition, routines developed in assembly can also be called.
+\newline
--
+\newline
+SDCC also provides an option (-
\begin_inset ERT
status Collapsed
@@ -529,187 +580,194 @@ status Collapsed
/
\end_inset
--prefix see table below
-\layout List
-\labelwidthstring 00.00.0000
+-cyclomatic) to report the relative complexity of a function.
+ These functions can then be further optimized, or hand coded in assembly
+ if needed.
+
+\newline
--
-\begin_inset ERT
-status Collapsed
+\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
-\layout Standard
+\newline
+The latest version can be downloaded from
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
-\backslash
-/
\end_inset
--exec_prefix see table below
-\layout List
-\labelwidthstring 00.00.0000
+.
--
-\begin_inset ERT
-status Collapsed
+\series bold
+
+\series default
+\emph on
+Please note: the compiler will probably always be some steps ahead of this
+ documentation
+\series bold
+\emph default
-\layout Standard
+\begin_inset LatexCommand \index{Status of documentation}
-\backslash
-/
\end_inset
--bindir see table below
-\layout List
-\labelwidthstring 00.00.0000
--
-\begin_inset ERT
-status Collapsed
+\begin_inset Foot
+collapsed false
\layout Standard
-\backslash
-/
+Obviously this has pros and cons
\end_inset
--datadir see table below
-\layout List
-\labelwidthstring 00.00.0000
+.
+\layout Section
-docdir environment variable, see table below
-\layout List
-\labelwidthstring 00.00.0000
+Open Source
+\layout Standard
-include_dir_suffix environment variable, see table below
-\layout List
-\labelwidthstring 00.00.0000
+All packages used in this compiler system are
+\emph on
+open source
+\emph default
+ and
+\emph on
+freeware
+\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}
-lib_dir_suffix environment variable, see table below
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
-sdccconf_h_dir_separator environment variable, either / or
-\backslash
+ 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}
-\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.
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
--
-\begin_inset ERT
-status Collapsed
+ of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+ You should have received a copy of the GNU General Public License along
+ with this program; if not, write to the Free Software Foundation, 59 Temple
+ Place - Suite 330, Boston, MA 02111-1307, USA.
+ In other words, you are welcome to use, share and improve this program.
+ You are forbidden to forbid anyone else to use, share and improve what
+ you give them.
+ Help stamp out software-hoarding!
+\layout Section
-\layout Standard
+Typographic conventions
+\begin_inset LatexCommand \index{Typographic conventions}
-\backslash
-/
\end_inset
--disable-mcs51-port Excludes the Intel mcs51 port
-\layout List
-\labelwidthstring 00.00.0000
-
--
-\begin_inset ERT
-status Collapsed
\layout Standard
-\backslash
-/
-\end_inset
+Throughout this manual, we will use the following convention.
+ Commands you have to type in are printed in
+\family sans
+\series bold
+"sans serif"
+\series default
+.
--disable-gbz80-port Excludes the Gameboy gbz80 port
-\layout List
-\labelwidthstring 00.00.0000
+\family default
+ Code samples are printed in
+\family typewriter
+typewriter font.
--
-\begin_inset ERT
-status Collapsed
+\family default
+ Interesting items and new terms are printed in
+\emph on
+italic.
+\layout Section
-\layout Standard
+Compatibility
+\begin_inset LatexCommand \label{sec:Compatibility-with-previous}
-\backslash
-/
\end_inset
--z80-port Excludes the z80 port
-\layout List
-\labelwidthstring 00.00.0000
+ with previous versions
+\begin_inset LatexCommand \index{Compatibility with previous versions}
+
+\end_inset
--
-\begin_inset ERT
-status Collapsed
\layout Standard
-\backslash
-/
+This version has numerous bug fixes compared with the previous version.
+ But we also introduced some incompatibilities with older versions.
+ Not just for the fun of it, but to make the compiler more stable, efficient
+ and ANSI compliant
+\begin_inset LatexCommand \index{ANSI-compliance}
+
\end_inset
--disable-avr-port Excludes the AVR port
-\layout List
-\labelwidthstring 00.00.0000
+ (see section
+\begin_inset LatexCommand \ref{sub:ANSI-Compliance}
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+ for ANSI-Compliance).
+
+\newline
-\backslash
-/
-\end_inset
+\layout Itemize
--disable-ds390-port Excludes the DS390 port
-\layout List
-\labelwidthstring 00.00.0000
+short is now equivalent to int (16 bits), it used to be equivalent to char
+ (8 bits) which is not ANSI compliant.
+\layout Itemize
--
-\begin_inset ERT
-status Collapsed
+the default directory for gcc-builds where include, library and documentation
+ files are stored is now in /usr/local/share.
+\layout Itemize
-\layout Standard
+char type parameters to vararg
+\begin_inset LatexCommand \index{vararg, va\_arg}
-\backslash
-/
\end_inset
--disable-pic-port Excludes the PIC port
-\layout List
-\labelwidthstring 00.00.0000
-
--
-\begin_inset ERT
-status Collapsed
+ functions are casted to int unless explicitly casted
+\begin_inset Marginal
+collapsed true
\layout Standard
-\backslash
-/
-\end_inset
-
--disable-xa51-port Excludes the XA51 port
-\layout List
-\labelwidthstring 00.00.0000
--
-\begin_inset ERT
-status Collapsed
+\series bold
+\SpecialChar ~
+!
+\end_inset
-\layout Standard
+, e.g.:
+\newline
+\family typewriter
+\SpecialChar ~
+\SpecialChar ~
+char a=3;
+\newline
+\SpecialChar ~
+\SpecialChar ~
+printf ("%d %c
\backslash
-/
-\end_inset
+n", a, (char)a);
+\family default
--disable-ucsim Disables configuring and building of ucsim
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+ will push a as an int and as a char resp.
+\layout Itemize
--
+option -
\begin_inset ERT
status Collapsed
@@ -719,11 +777,10 @@ status Collapsed
/
\end_inset
--disable-device-lib-build Disables automatically building device libraries
-\layout List
-\labelwidthstring 00.00.0000
+-regextend has been removed.
+\layout Itemize
--
+option -
\begin_inset ERT
status Collapsed
@@ -733,11 +790,10 @@ status Collapsed
/
\end_inset
--disable-packihx Disables building packihx
-\layout List
-\labelwidthstring 00.00.0000
+-noregparms has been removed.
+\layout Itemize
--
+option -
\begin_inset ERT
status Collapsed
@@ -747,488 +803,412 @@ status Collapsed
/
\end_inset
--enable-libgc Use the Bohem memory allocator.
- Lower runtime footprint.
-\layout Standard
-
-Furthermore the environment variables CC, CFLAGS, ...
- the tools and their arguments can be influenced.
- Please see `configure -
-\begin_inset ERT
-status Collapsed
+-stack-after-data has been removed.
+\layout Itemize
-\layout Standard
+bit
+\begin_inset LatexCommand \index{bit}
-\backslash
-/
\end_inset
--help` and the man/info pages of `configure` for details.
-\newline
+ and sbit
+\begin_inset LatexCommand \index{sbit}
-\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
+\end_inset
-\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
-\newline
-The settings for
-\begin_inset Quotes sld
+\begin_inset LatexCommand \index{\_\_sbit}
+
\end_inset
-Win32 builds
-\begin_inset Quotes srd
+ types now consistently behave like the C99 _Bool type with respect to type
+ conversion
+\begin_inset LatexCommand \index{type conversion}
+
\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{type promotion}
-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
+.
+ The most common incompatibility resulting from this change is related to
+ bit toggling
+\begin_inset LatexCommand \index{Bit toggling}
-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_inset
+ idioms, e.g.:
\newline
-These defaults are:
+
+\family typewriter
+\SpecialChar ~
+\SpecialChar ~
+bit b;
\newline
+\SpecialChar ~
+\SpecialChar ~
+b = ~
+\begin_inset LatexCommand \index{\~\/ Operator}
-\layout Standard
-\align center
+\end_inset
-\begin_inset Tabular
-
-
-
-
-
-
-
-\begin_inset Text
+b; /* equivalent to b=1 instead of toggling b */
+\begin_inset Marginal
+collapsed true
\layout Standard
-Variable
+
+\series bold
+\SpecialChar ~
+!
\end_inset
-
-
-\begin_inset Text
+
+\newline
+\SpecialChar ~
+\SpecialChar ~
+b = !b; /* toggles b */
+\newline
+
+\family default
+In previous versions, both forms would have toggled the bit.
\layout Standard
-default
-\end_inset
-
-
-\begin_inset Text
+\emph on
+
+\layout Section
+
+System Requirements
\layout Standard
-Win32 builds
-\end_inset
-
-
-
-
-\begin_inset Text
+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
+Other Resources
\layout Standard
+The SDCC home page at
+\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/}
-\emph on
-PREFIX
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+ 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}
-/usr/local
\end_inset
-
-
-\begin_inset Text
-\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
-sdcc
-\end_inset
-
-
-
-
-\begin_inset Text
+There are (and always will be) some things that could be done.
+ Here are some I can think of:
+\newline
\layout Standard
-\emph on
-EXEC_PREFIX
-\end_inset
-
-
-\begin_inset Text
+\family typewriter
+char KernelFunction3(char p) at 0x340;
+\newline
\layout Standard
-\emph on
-$PREFIX
+\family typewriter
+better code banking
+\begin_inset LatexCommand \index{code banking (limited support)}
+
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+ support for mcs51
+\newline
+\newline
-\emph on
-$PREFIX
-\end_inset
-
-
-
-
-\begin_inset Text
+\family default
+If you can think of some more, please see the section
+\begin_inset LatexCommand \ref{sub:Requesting-Features}
-\layout Standard
+\end_inset
+ about filing feature requests
+\begin_inset LatexCommand \index{Requesting features}
-\emph on
-BINDIR
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\begin_inset LatexCommand \index{Feature request}
-\emph on
-$EXECPREFIX
-\emph default
-/bin
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+.
+\newline
+\layout Chapter
-\emph on
-$EXECPREFIX
-\emph default
+Installing SDCC
+\begin_inset LatexCommand \index{Installation}
-\backslash
-bin
\end_inset
-
-
-
-
-\begin_inset Text
+
\layout Standard
+For most users it is sufficient to skip to either section
+\begin_inset LatexCommand \ref{sub:Building-SDCC-on-Linux}
-\emph on
-DATADIR
\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
+ (Unix) or section
+\begin_inset LatexCommand \ref{sub:Windows-Install}
-\emph on
-$PREFIX
-\emph default
-/share
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+ (Windows).
+ More detailed instructions follow below.
+\layout Section
+Configure Options
+\begin_inset LatexCommand \index{Options SDCC configuration}
-\emph on
-$PREFIX
\end_inset
-
-
-
-
-\begin_inset Text
+
\layout Standard
+The install paths, search paths and other options are defined when running
+ 'configure'.
+ The defaults can be overridden by:
+\layout List
+\labelwidthstring 00.00.0000
-\emph on
-DOCDIR
-\end_inset
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-
-\emph on
-$DATADIR
-\emph default
-/sdcc/doc
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+-prefix see table below
+\layout List
+\labelwidthstring 00.00.0000
+-
+\begin_inset ERT
+status Collapsed
-\emph on
-$DATADIR
-\emph default
+\layout Standard
\backslash
-doc
+/
\end_inset
-
-
-
-
-\begin_inset Text
-
-\layout Standard
+-exec_prefix see table below
+\layout List
+\labelwidthstring 00.00.0000
-\emph on
-INCLUDE_DIR_SUFFIX
-\end_inset
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-sdcc/include
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+-bindir see table below
+\layout List
+\labelwidthstring 00.00.0000
-include
-\end_inset
-
-
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-
-\emph on
-LIB_DIR_SUFFIX
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+-datadir see table below
+\newline
-sdcc/lib
-\end_inset
-
-
-\begin_inset Text
+\layout List
+\labelwidthstring 00.00.0000
-\layout Standard
+\SpecialChar ~
+\SpecialChar ~
+docdir environment variable, see table below
+\layout List
+\labelwidthstring 00.00.0000
-lib
-\end_inset
-
-
-
+\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
+\SpecialChar ~
+\SpecialChar ~
+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
-\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
+\layout List
+\labelwidthstring 00.00.0000
-\begin_inset Tabular
-
-
-
-
-
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-Variable (computed)
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+-disable-mcs51-port Excludes the Intel mcs51 port
+\layout List
+\labelwidthstring 00.00.0000
-default
-\end_inset
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-Win32 builds
+\backslash
+/
\end_inset
-
-
-
-
-\begin_inset Text
-
-\layout Standard
+-disable-gbz80-port Excludes the Gameboy gbz80 port
+\layout List
+\labelwidthstring 00.00.0000
-\emph on
-BIN2DATA_DIR
-\end_inset
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-../share
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
-
-..
+-disable-z80-port Excludes the z80 port
+\layout List
+\labelwidthstring 00.00.0000
-\end_inset
-
-
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-
-\emph on
-PREFIX2BIN_DIR
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+-disable-avr-port Excludes the AVR port
+\layout List
+\labelwidthstring 00.00.0000
-bin
-\end_inset
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-bin
+\backslash
+/
\end_inset
-
-
-
-
-\begin_inset Text
-
-\layout Standard
+-disable-ds390-port Excludes the DS390 port
+\layout List
+\labelwidthstring 00.00.0000
-\emph on
-PREFIX2DATA_DIR
-\end_inset
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-share/sdcc
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+-disable-hc08-port Excludes the HC08 port
+\layout List
+\labelwidthstring 00.00.0000
-\end_inset
-
-
-
+-
+\begin_inset ERT
+status Collapsed
+\layout Standard
+
+\backslash
+/
\end_inset
+-disable-pic-port Excludes the PIC port
+\layout List
+\labelwidthstring 00.00.0000
-\newline
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-\noindent
-Examples:
-\layout LyX-Code
-./configure
-\newline
-./configure -
+\backslash
+/
+\end_inset
+
+-disable-xa51-port Excludes the XA51 port
+\layout List
+\labelwidthstring 00.00.0000
+
+-
\begin_inset ERT
status Collapsed
@@ -1238,15 +1218,11 @@ status Collapsed
/
\end_inset
--prefix=
-\begin_inset Quotes srd
-\end_inset
-
-/usr/bin
-\begin_inset Quotes srd
-\end_inset
+-disable-ucsim Disables configuring and building of ucsim
+\layout List
+\labelwidthstring 00.00.0000
- -
+-
\begin_inset ERT
status Collapsed
@@ -1256,17 +1232,27 @@ status Collapsed
/
\end_inset
--datadir=
-\begin_inset Quotes srd
-\end_inset
+-disable-device-lib Disables automatically building device libraries
+\layout List
+\labelwidthstring 00.00.0000
-/usr/share
-\begin_inset Quotes srd
-\end_inset
+-
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+\backslash
+/
+\end_inset
+-disable-packihx Disables building packihx
\newline
-./configure -
+
+\layout List
+\labelwidthstring 00.00.0000
+
+-
\begin_inset ERT
status Collapsed
@@ -1276,7 +1262,11 @@ status Collapsed
/
\end_inset
--disable-avr-port -
+-enable-doc Build pdf, html and txt files from the lyx sources
+\layout List
+\labelwidthstring 00.00.0000
+
+-
\begin_inset ERT
status Collapsed
@@ -1286,406 +1276,370 @@ status Collapsed
/
\end_inset
--disable-xa51-port
-\layout Standard
+-enable-libgc Use the Bohem memory allocator.
+ Lower runtime footprint.
+\layout Standard
-To cross compile on linux for Mingw32 (see also 'sdcc/support/scripts/sdcc_mingw
-32'):
-\layout LyX-Code
+Furthermore the environment variables CC, CFLAGS, ...
+ the tools and their arguments can be influenced.
+ Please see `configure -
+\begin_inset ERT
+status Collapsed
-./configure
-\backslash
+\layout Standard
-\newline
-CC=
-\begin_inset Quotes srd
+\backslash
+/
\end_inset
-i586-mingw32msvc-gcc
-\begin_inset Quotes srd
-\end_inset
+-help` and the man/info pages of `configure` for details.
+\newline
- CXX=
-\begin_inset Quotes srd
-\end_inset
+\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
-i586-mingw32msvc-g++
-\begin_inset Quotes srd
-\end_inset
+\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
-
-\backslash
-
\newline
-RANLIB=
-\begin_inset Quotes srd
+The settings for
+\begin_inset Quotes sld
\end_inset
-i586-mingw32msvc-ranlib
+Win32 builds
\begin_inset Quotes srd
\end_inset
-
-\backslash
+ 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
-\newline
-STRIP=
-\begin_inset Quotes srd
-\end_inset
+open source,
+\layout Enumerate
-i586-mingw32msvc-strip
-\begin_inset Quotes srd
-\end_inset
+a gcc compiler and last but not least
+\layout Enumerate
-
-\backslash
+the binaries can be built by cross compiling on Sourceforge's compile farm.
+\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
--
-\begin_inset ERT
-status Collapsed
+These defaults are:
+\newline
\layout Standard
+\align center
-\backslash
-/
-\end_inset
+\begin_inset Tabular
+
+
+
+
+
+
+
+\begin_inset Text
--prefix=
-\begin_inset Quotes srd
-\end_inset
+\layout Standard
-/sdcc
-\begin_inset Quotes srd
+Variable
\end_inset
-
-
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+default
\end_inset
+
+
+\begin_inset Text
--datadir=
-\begin_inset Quotes srd
-\end_inset
+\layout Standard
-/sdcc
-\begin_inset Quotes srd
+Win32 builds
\end_inset
+
+
+
+
+\begin_inset Text
-
-\backslash
+\layout Standard
-\newline
-docdir=
-\begin_inset Quotes srd
-\end_inset
-/sdcc/doc
-\begin_inset Quotes srd
+\emph on
+PREFIX
\end_inset
+
+
+\begin_inset Text
-
-\backslash
+\layout Standard
-\newline
-include_dir_suffix=
-\begin_inset Quotes srd
+/usr/local
\end_inset
+
+
+\begin_inset Text
-include
-\begin_inset Quotes srd
-\end_inset
+\layout Standard
-
-\backslash
-\newline
-lib_dir_suffix=
-\begin_inset Quotes srd
+\backslash
+sdcc
\end_inset
+
+
+
+
+\begin_inset Text
-lib
-\begin_inset Quotes srd
-\end_inset
+\layout Standard
-
-\backslash
-\newline
-sdccconf_h_dir_separator=
-\begin_inset Quotes srd
+\emph on
+EXEC_PREFIX
\end_inset
+
+
+\begin_inset Text
+\layout Standard
-\backslash
-\backslash
+\emph on
+$PREFIX
+\end_inset
+
+
+\begin_inset Text
-\backslash
+\layout Standard
-\backslash
-\begin_inset Quotes srd
+\emph on
+$PREFIX
\end_inset
-
-
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
+
+
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
-\end_inset
-
--disable-device-lib-build
-\backslash
-\newline
--
-\begin_inset ERT
-status Collapsed
+\emph on
+BINDIR
+\end_inset
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+
+\emph on
+$EXECPREFIX
+\emph default
+/bin
\end_inset
+
+
+\begin_inset Text
--disable-ucsim
-\backslash
+\layout Standard
-\newline
--
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\emph on
+$EXECPREFIX
+\emph default
\backslash
-/
+bin
\end_inset
-
--host=i586-mingw32msvc -
-\begin_inset ERT
-status Collapsed
+
+
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+
+\emph on
+DATADIR
\end_inset
+
+
+\begin_inset Text
--build=unknown-unknown-linux-gnu
\layout Standard
-To
-\begin_inset Quotes sld
-\end_inset
-cross
-\begin_inset Quotes srd
+\emph on
+$PREFIX
+\emph default
+/share
\end_inset
+
+
+\begin_inset Text
-compile on Cygwin for Mingw32(see also sdcc/support/scripts/sdcc_cygwin_mingw32)
-:
-\layout LyX-Code
-
-./configure -C
-\backslash
+\layout Standard
-\newline
-CFLAGS=
-\begin_inset Quotes srd
-\end_inset
--mno-cygwin -O2
-\begin_inset Quotes srd
+\emph on
+$PREFIX
\end_inset
+
+
+
+
+\begin_inset Text
-
-\backslash
+\layout Standard
-\newline
-LDFLAGS=
-\begin_inset Quotes srd
-\end_inset
--mno-cygwin
-\begin_inset Quotes srd
+\emph on
+DOCDIR
\end_inset
-
-
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
-\end_inset
-
--prefix=
-\begin_inset Quotes srd
-\end_inset
-/sdcc
-\begin_inset Quotes srd
+\emph on
+$DATADIR
+\emph default
+/sdcc/doc
\end_inset
-
-
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
-\end_inset
-
--datadir=
-\begin_inset Quotes srd
-\end_inset
-/sdcc
-\begin_inset Quotes srd
-\end_inset
+\emph on
+$DATADIR
+\emph default
-
\backslash
-
-\newline
-docdir=
-\begin_inset Quotes srd
+doc
\end_inset
+
+
+
+
+\begin_inset Text
-/sdcc/doc
-\begin_inset Quotes srd
-\end_inset
+\layout Standard
-
-\backslash
-
-\newline
-include_dir_suffix=
-\begin_inset Quotes srd
-\end_inset
-include
-\begin_inset Quotes srd
+\emph on
+INCLUDE_DIR_SUFFIX
\end_inset
+
+
+\begin_inset Text
-
-\backslash
-
-\newline
-lib_dir_suffix=
-\begin_inset Quotes srd
-\end_inset
+\layout Standard
-lib
-\begin_inset Quotes srd
+sdcc/include
\end_inset
+
+
+\begin_inset Text
-
-\backslash
+\layout Standard
-\newline
-sdccconf_h_dir_separator=
-\begin_inset Quotes srd
+include
\end_inset
+
+
+
+
+\begin_inset Text
+\layout Standard
-\backslash
-
-\backslash
-
-\backslash
-
-\backslash
-\begin_inset Quotes srd
+\emph on
+LIB_DIR_SUFFIX
\end_inset
-
-
-\backslash
-
-\newline
--
-\begin_inset ERT
-status Collapsed
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+sdcc/lib
\end_inset
-
--disable-ucsim
-\layout Standard
-
-'configure' is quite slow on Cygwin (at least on windows before Win2000/XP).
- The option '-
-\begin_inset ERT
-status Collapsed
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
+lib
\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 Subsection
-
-Install paths
-\begin_inset LatexCommand \index{Install paths}
+
+
+
\end_inset
+\newline
+
\layout Standard
-\added_space_top medskip \align center
+\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
\begin_inset Tabular
-
+
-
-
-
-
+
+
+
\begin_inset Text
\layout Standard
-
-\series bold
-Description
+Variable (computed)
\end_inset
@@ -1693,81 +1647,75 @@ Description
\layout Standard
-
-\series bold
-Path
+default
\end_inset
-
+
\begin_inset Text
\layout Standard
-
-\series bold
-Default
+Win32 builds
\end_inset
-
+
+
+
\begin_inset Text
\layout Standard
-\series bold
-Win32 builds
+\emph on
+BIN2DATA_DIR
\end_inset
-
-
\begin_inset Text
\layout Standard
-Binary files*
+../share
\end_inset
-
+
\begin_inset Text
\layout Standard
-
-\emph on
-$EXEC_PREFIX
+..
\end_inset
+
+
\begin_inset Text
\layout Standard
-/usr/local/bin
+
+\emph on
+PREFIX2BIN_DIR
\end_inset
-
+
\begin_inset Text
\layout Standard
-
-\backslash
-sdcc
-\backslash
bin
\end_inset
-
-
-
+
\begin_inset Text
\layout Standard
-Include files
+bin
\end_inset
+
+
\begin_inset Text
@@ -1775,7 +1723,7 @@ Include files
\emph on
-$DATADIR/ $INCLUDE_DIR_SUFFIX
+PREFIX2DATA_DIR
\end_inset
@@ -1783,7 +1731,7 @@ $DATADIR/ $INCLUDE_DIR_SUFFIX
\layout Standard
-/usr/local/share/sdcc/include
+share/sdcc
\end_inset
@@ -1791,319 +1739,264 @@ $DATADIR/ $INCLUDE_DIR_SUFFIX
\layout Standard
-
-\backslash
-sdcc
-\backslash
-include
\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
+
-Library file**
\end_inset
-
-
-\begin_inset Text
+
+
+\newline
\layout Standard
+\noindent
+Examples:
+\layout LyX-Code
+
+./configure
+\newline
+./configure -
+\begin_inset ERT
+status Collapsed
+\layout Standard
-\emph on
-$DATADIR/$LIB_DIR_SUFFIX
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+-prefix=
+\begin_inset Quotes srd
+\end_inset
-/usr/local/share/sdcc/lib
+/usr/bin
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+ -
+\begin_inset ERT
+status Collapsed
+\layout Standard
\backslash
-sdcc
-\backslash
-lib
+/
\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+-datadir=
+\begin_inset Quotes srd
+\end_inset
-Documentation
+/usr/share
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\newline
+./configure -
+\begin_inset ERT
+status Collapsed
-\emph on
-$DOCDIR
+\layout Standard
+
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
+
+-disable-avr-port -
+\begin_inset ERT
+status Collapsed
\layout Standard
-/usr/local/share/sdcc/doc
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
+-disable-xa51-port
\layout Standard
+To cross compile on linux for Mingw32 (see also 'sdcc/support/scripts/sdcc_mingw
+32'):
+\layout LyX-Code
+./configure
\backslash
-sdcc
-\backslash
-doc
-\end_inset
-
-
-
+\newline
+CC=
+\begin_inset Quotes srd
\end_inset
+i586-mingw32msvc-gcc
+\begin_inset Quotes srd
+\end_inset
-\layout Verse
+ CXX=
+\begin_inset Quotes srd
+\end_inset
+i586-mingw32msvc-g++
+\begin_inset Quotes srd
+\end_inset
-\size footnotesize
-*compiler, preprocessor, assembler, and linker
+
+\backslash
+
\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
+RANLIB=
+\begin_inset Quotes srd
+\end_inset
-Of course this doesn't change the search paths compiled into the binaries.
-\layout Subsection
+i586-mingw32msvc-ranlib
+\begin_inset Quotes srd
+\end_inset
-Search Paths
-\begin_inset LatexCommand \index{Search path}
+
+\backslash
+\newline
+STRIP=
+\begin_inset Quotes srd
\end_inset
+i586-mingw32msvc-strip
+\begin_inset Quotes srd
+\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
+\backslash
\newline
-1.
- Binary files (preprocessor, assembler and linker)
-\newline
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-\align center
-\begin_inset Tabular
-
-
-
-
-
-
-
-\begin_inset Text
+\backslash
+/
+\end_inset
-\layout Standard
+-prefix=
+\begin_inset Quotes srd
+\end_inset
-Search path
+/sdcc
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+
+\backslash
-default
-\end_inset
-
-
-\begin_inset Text
+\newline
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-Win32 builds
+\backslash
+/
\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+-datadir=
+\begin_inset Quotes srd
+\end_inset
-$SDCC_HOME/
-\emph on
-$PPREFIX2BIN_DIR
+/sdcc
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+
+\backslash
-$SDCC_HOME/bin
+\newline
+docdir=
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+/sdcc/doc
+\begin_inset Quotes srd
+\end_inset
-$SDCC_HOME
+
\backslash
-bin
-\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+\newline
+include_dir_suffix=
+\begin_inset Quotes srd
+\end_inset
-Path of argv[0] (if available)
+include
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+
+\backslash
-Path of argv[0]
+\newline
+lib_dir_suffix=
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
-Path of argv[0]
+lib
+\begin_inset Quotes srd
\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+
+\backslash
-$PATH
+\newline
+sdccconf_h_dir_separator=
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
-$PATH
-\end_inset
-
-
-\begin_inset Text
+\backslash
-\layout Standard
+\backslash
-$PATH
-\end_inset
-
-
-
+\backslash
+
+\backslash
+\begin_inset Quotes srd
\end_inset
-\newline
+\backslash
-\layout Standard
-\noindent
-2.
- Include files
\newline
-
-\layout Standard
-\align center
-
-\begin_inset Tabular
-
-
-
-
-
-
-
-\begin_inset Text
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-Search path
+\backslash
+/
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+-disable-device-lib
+\backslash
-default
-\end_inset
-
-
-\begin_inset Text
+\newline
+-
+\begin_inset ERT
+status Collapsed
\layout Standard
-Win32 builds
+\backslash
+/
\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+-host=i586-mingw32msvc
+\backslash
+\newline
-
\begin_inset ERT
status Collapsed
@@ -2114,14 +2007,25 @@ status Collapsed
/
\end_inset
--I dir
+-build=unknown-unknown-linux-gnu
+\layout Standard
+
+To
+\begin_inset Quotes sld
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+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
@@ -2132,14 +2036,18 @@ status Collapsed
/
\end_inset
--I dir
+-prefix=
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+/sdcc
+\begin_inset Quotes srd
+\end_inset
+
+\backslash
+
+\newline
-
\begin_inset ERT
status Collapsed
@@ -2150,147 +2058,99 @@ status Collapsed
/
\end_inset
--I dir
+-datadir=
+\begin_inset Quotes srd
\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
-
-
-\size small
-$SDCC_INCLUDE
+/sdcc
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+
+\backslash
-$SDCC_INCLUDE
+\newline
+docdir=
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+/sdcc/doc
+\begin_inset Quotes srd
+\end_inset
-$SDCC_INCLUDE
+
+\backslash
+
+\newline
+include_dir_suffix=
+\begin_inset Quotes srd
\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+include
+\begin_inset Quotes srd
+\end_inset
+
+\backslash
-\size footnotesize
-$SDCC_HOME/
-\emph on
-$PREFIX2DATA_DIR/$INCLUDE_DIR_SUFFIX
+\newline
+lib_dir_suffix=
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+lib
+\begin_inset Quotes srd
+\end_inset
+
+\backslash
-\size small
-$SDCC_ HOME/share/sdcc/include
+\newline
+sdccconf_h_dir_separator=
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+\backslash
-\size small
-$SDCC_HOME
\backslash
-include
-\end_inset
-
-
-
-
-\begin_inset Text
-\layout Standard
+\backslash
+\backslash
-\size small
-path(argv[0])/
-\emph on
-$BIN2DATADIR/$INCLUDE_DIR_SUFFIX
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-
-\layout Standard
-
-path(argv[0])/../sdcc/include
-\end_inset
-
-
-\begin_inset Text
-\layout Standard
-
-path(argv[0])
-\backslash
-..
+
\backslash
-include
-\end_inset
-
-
-
-
-\begin_inset Text
-
-\layout Standard
-
-\size small
-\emph on
-$DATADIR/$INCLUDE_DIR_SUFFIX
+\newline
+CC=
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
-
-/usr/local/share/sdcc/include
+gcc -mno-cygwin
+\begin_inset Quotes srd
\end_inset
-
-
-\begin_inset Text
-\layout Standard
+
+\backslash
-(not on Win32)
+\newline
+CXX=
+\begin_inset Quotes srd
\end_inset
-
-
-
+g++ -mno-cygwin
+\begin_inset Quotes srd
\end_inset
-\newline
-
\layout Standard
-\noindent
-The option -
+
+'configure' is quite slow on Cygwin (at least on windows before Win2000/XP).
+ The option '-
\begin_inset ERT
status Collapsed
@@ -2300,67 +2160,61 @@ status Collapsed
/
\end_inset
--nostdinc disables the last two search paths.
-\newline
-
-\newline
-3.
- Library files
-\newline
+-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
-\layout Standard
+Install paths
+\begin_inset LatexCommand \label{sub:Install-paths}
-With the exception of
-\begin_inset Quotes sld
\end_inset
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-\backslash
-/
-\end_inset
+\begin_inset LatexCommand \index{Install paths}
--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
\layout Standard
-\align center
+\added_space_top medskip \align center
\begin_inset Tabular
-
+
-
-
-
+
+
+
+
-
+
\begin_inset Text
\layout Standard
-Search path
+
+\series bold
+Description
\end_inset
-
+
\begin_inset Text
\layout Standard
-default
+
+\series bold
+Path
+\end_inset
+
+
+\begin_inset Text
+
+\layout Standard
+
+
+\series bold
+Default
\end_inset
@@ -2368,27 +2222,29 @@ default
\layout Standard
+
+\series bold
Win32 builds
\end_inset
-
+
\begin_inset Text
\layout Standard
--
-\begin_inset ERT
-status Collapsed
+Binary files*
+\end_inset
+
+
+\begin_inset Text
\layout Standard
-\backslash
-/
-\end_inset
--L dir
+\emph on
+$EXEC_PREFIX
\end_inset
@@ -2396,17 +2252,7 @@ status Collapsed
\layout Standard
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--L dir
+/usr/local/bin
\end_inset
@@ -2414,17 +2260,11 @@ status Collapsed
\layout Standard
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
\backslash
-/
-\end_inset
-
--L dir
+sdcc
+\backslash
+bin
\end_inset
@@ -2434,156 +2274,105 @@ status Collapsed
\layout Standard
-$SDCC_LIB/
-\newline
-
-\emph on
-
+Include files
\end_inset
-
+
\begin_inset Text
\layout Standard
-$SDCC_LIB/
-\newline
\emph on
-
+$DATADIR/ $INCLUDE_DIR_SUFFIX
\end_inset
-
+
\begin_inset Text
\layout Standard
-$SDCC_LIB
-\backslash
+/usr/local/share/sdcc/include
+\end_inset
+
+
+\begin_inset Text
-\newline
+\layout Standard
-\emph on
-
+
+\backslash
+sdcc
+\backslash
+include
\end_inset
-
+
+\begin_inset Text
+
+\layout Standard
+
+Library file**
+\end_inset
+
+
\begin_inset Text
\layout Standard
-$SDCC_HOME/
-\newline
\emph on
-$PREFIX2DATA_DIR/
-\newline
-$LIB_DIR_SUFFIX/
+$DATADIR/$LIB_DIR_SUFFIX
\end_inset
-
+
\begin_inset Text
\layout Standard
-$SDCC_HOME/
-\newline
-share/sdcc/
-\newline
-lib/
-\emph on
-
+/usr/local/share/sdcc/lib
\end_inset
-
+
\begin_inset Text
\layout Standard
-$SDCC_HOME
+
\backslash
-lib
+sdcc
\backslash
-
-\emph on
-
-\newline
-
+lib
\end_inset
-
-
+
+
\begin_inset Text
\layout Standard
-path(argv[0])/
-\newline
+Documentation
+\end_inset
+
+
+\begin_inset Text
-\emph on
-$BIN2DATADIR/
-\emph default
+\layout Standard
-\newline
\emph on
-$LIB_DIR_SUFFIX/
+$DOCDIR
\end_inset
-
+
\begin_inset Text
\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 ~
-
+/usr/local/share/sdcc/doc
\end_inset
@@ -2591,68 +2380,104 @@ path(argv[0])/
\layout Standard
-path(argv[0])
-\backslash
-\newline
-..
\backslash
-lib
+sdcc
\backslash
+doc
+\end_inset
+
+
+
-\emph on
-
+\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
-\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 ~
+
+\newline
+Moreover the install path can be changed by defining DESTDIR
+\begin_inset LatexCommand \index{DESTDIR}
\end_inset
-
-
-
-
-\begin_inset Text
+:
+\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
-$DATADIR/
+italics
+\emph default
+, see section above).
+ Further search paths are determined by environment variables during runtime.
+
\newline
-$LIB_DIR_SUFFIX/
+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
+
+Search path
\end_inset
@@ -2660,11 +2485,7 @@ $LIB_DIR_SUFFIX/
\layout Standard
-/usr/local/share/sdcc/
-\newline
-lib/
-\emph on
-
+default
\end_inset
@@ -2672,287 +2493,165 @@ lib/
\layout Standard
-(not on Win32)
+Win32 builds
\end_inset
-
-
-\end_inset
-
+
+
+\begin_inset Text
-\newline
+\layout Standard
-\layout Comment
+$SDCC_HOME/
+\emph on
+$PPREFIX2BIN_DIR
+\end_inset
+
+
+\begin_inset Text
-Don't delete any of the stray spaces in the table above without checking
- the HTML output (last line)!
\layout Standard
-\SpecialChar ~
-
-\newline
-The option -
-\begin_inset ERT
-status Collapsed
+$SDCC_HOME/bin
+\end_inset
+
+
+\begin_inset Text
\layout Standard
+$SDCC_HOME
\backslash
-/
+bin
\end_inset
+
+
+
+
+\begin_inset Text
--nostdlib disables the last two search paths.
-\layout Subsection
-
-Building SDCC
-\begin_inset LatexCommand \index{Building SDCC}
+\layout Standard
+Path of argv[0] (if available)
\end_inset
+
+
+\begin_inset Text
+\layout Standard
-\layout Subsubsection
+Path of argv[0]
+\end_inset
+
+
+\begin_inset Text
-Building SDCC on Linux
-\begin_inset LatexCommand \label{sub:Building-SDCC-on-Linux}
+\layout Standard
+Path of argv[0]
\end_inset
+
+
+
+
+\begin_inset Text
+\layout Standard
-\layout Enumerate
+$PATH
+\end_inset
+
+
+\begin_inset Text
+\layout Standard
-\series medium
-Download the source package
-\series default
- either from the SDCC CVS repository or from the
-\begin_inset LatexCommand \url[nightly snapshots]{http://sdcc.sourceforge.net/snap.php}
-
+$PATH
\end_inset
+
+
+\begin_inset Text
-
-\series medium
-, it will be named something like sdcc
-\series default
-.src
-\series medium
-.t
-\series default
-ar.
-\series medium
-gz.
-\layout Enumerate
-
-
-\series medium
-Bring up a command line terminal, such as xterm.
-\layout Enumerate
-
-
-\series medium
-Unpack the file using a command like:
-\family sans
-\series bold
-"tar -xzf 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
-
-Change directory into the main SDCC directory, for example type:
-\family sans
-\series bold
-"cd sdcc
-\series default
-".
-\layout Enumerate
-
-
-\series medium
-Type
-\family sans
-\series bold
-"./configure
-\family default
-\series default
-".
- This configures the package for compilation on your system.
-\layout Enumerate
-
-
-\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
-
-
-\series medium
-Type
-\family sans
-\series bold
-"make install"
-\family default
-\series default
- as root
-\series medium
-.
-
-\series default
- This copies the binary executables, the include files, the libraries and
- the documentation to the install directories.
-\layout Subsubsection
-
-Building SDCC on OSX 2.x
\layout Standard
-Follow the instruction for Linux.
-\newline
+$PATH
+\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
+\end_inset
-./configure CC=gcc2 CXX=g++2
-\layout Subsubsection
+
+\newline
-Cross compiling SDCC on Linux for Windows
\layout Standard
+\noindent
+2.
+ Include files
+\newline
-With the Mingw32 gcc cross compiler it's easy to compile SDCC for Win32.
- See section 'Configure Options'.
-\layout Subsubsection
-
-Building SDCC on Windows
\layout Standard
+\align center
-With the exception of Cygwin the SDCC binaries uCsim and sdcdb can't be
- built on Windows.
- They use Unix-sockets, which are not available on Win32.
-\layout Subsubsection
+\begin_inset Tabular
+
+
+
+
+
+
+
+\begin_inset Text
-Building SDCC using Cygwin and Mingw32
\layout Standard
-For building and installing a Cygwin executable follow the instructions
- for Linux.
-\newline
-
-\newline
-On Cygwin a
-\begin_inset Quotes sld
-\end_inset
-
-native
-\begin_inset Quotes srd
-\end_inset
-
- Win32-binary can be built, which will not need the Cygwin-DLL.
- For the necessary 'configure' options see section 'configure options' or
- the script 'sdcc/support/scripts/sdcc_cygwinmingw32'.
-\newline
-
-\newline
-In order to install Cygwin on Windows download setup.exe from
-\begin_inset LatexCommand \url[www.cygwin.com]{http://www.cygwin.com/}
-
+Search path
\end_inset
+
+
+\begin_inset Text
-.
- Run it, set the
-\begin_inset Quotes sld
-\end_inset
+\layout Standard
-default text file type
-\begin_inset Quotes srd
+default
\end_inset
+
+
+\begin_inset Text
- to
-\begin_inset Quotes sld
-\end_inset
+\layout Standard
-unix
-\begin_inset Quotes srd
+Win32 builds
\end_inset
+
+
+
+
+\begin_inset Text
- 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
-
-bison
-\layout Itemize
-
-gcc ; version 3.x is fine, no need to use the old 2.9x
-\layout Itemize
-
-binutils ; selected with gcc
-\layout Itemize
-
-make
-\layout Itemize
-
-rxvt ; a nice console, which makes life much easier under windoze (see below)
-\layout Itemize
-
-man ; not really needed for building SDCC, but you'll miss it sooner or
- later
-\layout Itemize
-
-less ; not really needed for building SDCC, but you'll miss it sooner or
- later
-\layout Itemize
-
-cvs ; only if you use CVS access
\layout Standard
-If you want to develop something you'll need:
-\layout Itemize
+-
+\begin_inset ERT
+status Collapsed
-python ; for the regression tests
-\layout Itemize
+\layout Standard
-gdb ; the gnu debugger, together with the nice GUI
-\begin_inset Quotes sld
+\backslash
+/
\end_inset
-insight
-\begin_inset Quotes srd
+-I dir
\end_inset
+
+
+\begin_inset Text
-
-\layout Itemize
-
-openssh ; to access the CF or commit changes
-\layout Itemize
-
-autoconf and autoconf-devel ; if you want to fight with 'configure', don't
- use autoconf-stable!
\layout Standard
-rxvt is a nice console with history.
- Replace in your cygwin.bat the line
-\layout LyX-Code
-
-bash -
+-
\begin_inset ERT
status Collapsed
@@ -2962,16 +2661,15 @@ status Collapsed
/
\end_inset
--login -i
-\layout Standard
-
-with (one line):
-\layout LyX-Code
+-I dir
+\end_inset
+
+
+\begin_inset Text
-rxvt -sl 1000 -fn "Lucida Console-12" -sr -cr red
-\layout LyX-Code
+\layout Standard
- -bg black -fg white -geometry 100x65 -e bash -
+-
\begin_inset ERT
status Collapsed
@@ -2981,336 +2679,308 @@ status Collapsed
/
\end_inset
--login
-\layout Standard
-
-Text selected with the mouse is automatically copied to the clipboard, pasting
- works with shift-insert.
-\newline
-
-\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
-
-cygdrive
-\begin_inset Quotes srd
+-I dir
\end_inset
+
+
+
+
+\begin_inset Text
- is too long, you can change it with e.g.
-\layout LyX-Code
-
-mount -s -u -c /mnt
\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 used in the project is 8.
-\layout Subsubsection
+$SDCC_INCLUDE
+\end_inset
+
+
+\begin_inset Text
-Building SDCC Using Microsoft Visual C++ 6.0/NET (MSVC)
\layout Standard
+$SDCC_INCLUDE
+\end_inset
+
+
+\begin_inset Text
-\series medium
-Download the source package
-\series default
- either from the SDCC CVS repository or from the
-\begin_inset LatexCommand \url[nightly snapshots]{http://sdcc.sourceforge.net/snap.php}
+\layout Standard
+$SDCC_INCLUDE
\end_inset
+
+
+
+
+\begin_inset Text
+\layout Standard
-\series medium
-, it will be named something like sdcc
-\series default
-.src
-\series medium
-.tgz.
-
-\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.exe which currently
- doesn't build under MSVC).
- 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.
-
+$SDCC_HOME/
\newline
+\emph on
+$PREFIX2DATA_DIR/
\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}
-
+$INCLUDE_DIR_SUFFIX
\end_inset
+
+
+\begin_inset Text
+\layout Standard
+$SDCC_ HOME/
\newline
-
+share/sdcc/
\newline
-Download the file UnxUtils
-\begin_inset LatexCommand \index{UnxUtils}
-
+include
\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
-
-The easy way:
-\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
+\layout Standard
-\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
+$SDCC_HOME
\backslash
-wbin', click ok.
-\newline
+include
+\end_inset
+
+
+
+
+\begin_inset Text
-\newline
-(As a side effect, you get a bunch of Unix utilities that could be useful,
- such as diff and patch.)
-\layout Enumerate
+\layout Standard
-A more compact way:
+path(argv[0])/
\newline
-\newline
-This one avoids extracting a bunch of files you may not use, but requires
- some extra work:
-\newline
+\emph on
+$BIN2DATADIR/
+\emph default
-\newline
-a) Create a directory were to put the tools needed, or use a directory already
- present.
- Say for example 'C:
-\backslash
-util'.
\newline
-\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
+\emph on
+$INCLUDE_DIR_SUFFIX
+\end_inset
+
+
+\begin_inset Text
-\newline
-c) Rename bison.exe to '_bison.exe'.
-\newline
+\layout Standard
+path(argv[0])/
\newline
-d) Create a batch file 'bison.bat' in 'C:
-\backslash
-util
-\backslash
-' and add these lines:
+../sdcc/include
\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
+\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 ~
-\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
+\end_inset
+
+
+\begin_inset Text
-\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
-That is it.
- Open 'sdcc.dsw' in Visual Studio, click 'build all', when it finishes copy
- the executables from sdcc
+path(argv[0])
\backslash
-bin_vc to sdcc
+..
\backslash
-bin, and you can compile using sdcc.
-\layout Subsubsection
-
-Building SDCC Using Borland
-\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.exe (which currently doesn't build under Borland C++).
-\layout Enumerate
+include
+\end_inset
+
+
+
+
+\begin_inset Text
+
+\layout Standard
+
+
+\emph on
+$DATADIR/
+\emph default
-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
+\emph on
+$INCLUDE_DIR_SUFFIX
+\end_inset
+
+
+\begin_inset Text
+
+\layout Standard
+
+/usr/local/share/sdcc/
\newline
+include
+\end_inset
+
+
+\begin_inset Text
+
+\layout Standard
+
+(not on Win32)
+\end_inset
+
+
+
+
+\end_inset
-\family sans
-\series bold
-find .
+\newline
+
+\layout Standard
+\noindent
+The option -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+
\backslash
-( -name '*.obj' -o -name '*.lib' -o -name '*.rul'
-\backslash
-) -print -exec rm {}
-\backslash
-;
-\family default
-\series default
+/
+\end_inset
+-nostdinc disables the last two search paths.
\newline
\newline
-or on Windows NT/2000/XP from the command prompt with the command:
-\newline
-
-\family sans
-\series bold
-
+3.
+ Library files
\newline
-del /s *.obj *.lib *.rul
-\family default
-\series default
- from the sdcc directory.
-\layout Subsubsection
-Windows Install Using a Binary Package
-\begin_inset LatexCommand \label{sub:Windows-Install}
+\layout Standard
+With the exception of
+\begin_inset Quotes sld
\end_inset
+-
+\begin_inset ERT
+status Collapsed
-\layout Enumerate
+\layout Standard
-Download the binary package from
-\begin_inset LatexCommand \url{http://sdcc.sourceforge.net/snap.php}
+\backslash
+/
+\end_inset
+-L dir
+\begin_inset Quotes srd
\end_inset
- and unpack it using your favorite unpacking tool (gunzip, WinZip, etc).
- This should unpack to a group of sub-directories.
- An example directory structure after unpacking the mingw32 package is:
- c:
-\backslash
-sdcc
-\backslash
-bin for the executables, c:
-\backslash
-sdcc
-\backslash
-include and c:
-\backslash
-sdcc
-\backslash
-lib for the include and libraries.
-\layout Enumerate
+ the
+\shape italic
+model
+\shape default
+ is auto-appended by the compiler (e.g.
+ small, large, z80, ds390 etc.).
+
+\newline
-Adjust your environment variable PATH to include the location of the bin
- directory or start sdcc using the full path.
-\layout Subsection
+\layout Standard
+\align center
+
+\begin_inset Tabular
+
+
+
+
+
+
+
+\begin_inset Text
-Building the Documentation
\layout Standard
-If the necessary tools are installed it is as easy as changing into the
- doc directory and typing
-\family sans
-\series bold
+Search path
+\end_inset
+
+
+\begin_inset Text
-\begin_inset Quotes srd
+\layout Standard
+
+default
\end_inset
+
+
+\begin_inset Text
-make
-\begin_inset Quotes srd
+\layout Standard
+
+Win32 builds
\end_inset
+
+
+
+
+\begin_inset Text
+\layout Standard
-\family default
-\series default
- there.
- If you want to avoid installing the tools you will have some success with
- a bootable Knoppix CD
-\begin_inset LatexCommand \url{http://www.knopper.net}
+-
+\begin_inset ERT
+status Collapsed
+\layout Standard
+
+\backslash
+/
\end_inset
-.
-\layout Subsection
+-L dir
+\end_inset
+
+
+\begin_inset Text
-Testing the SDCC Compiler
\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
@@ -3320,577 +2990,553 @@ status Collapsed
/
\end_inset
--version"
-\begin_inset LatexCommand \index{version}
-
+-L dir
\end_inset
+
+
+\begin_inset Text
+\layout Standard
-\family default
-\series default
- at the prompt, and the program should run and tell you the version.
- If it doesn't run, or gives a message about not finding sdcc program, then
- you need to check over your installation.
- Make sure that the sdcc bin directory is in your executable search path
- defined by the PATH environment setting (see the Trouble-shooting section
- for suggestions).
- Make sure that the sdcc program is in the bin folder, if not perhaps something
- did not install correctly.
-\newline
+-
+\begin_inset ERT
+status Collapsed
-\newline
+\layout Standard
-\series medium
-SDCC
-\series default
-is commonly installed as described in section
-\begin_inset Quotes sld
+\backslash
+/
\end_inset
-Install and search paths
-\begin_inset Quotes srd
+-L dir
\end_inset
+
+
+
+
+\begin_inset Text
+\layout Standard
+$SDCC_LIB/
\newline
+\emph on
+
+\end_inset
+
+
+\begin_inset Text
+
+\layout Standard
+
+$SDCC_LIB/
\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
+\emph on
+
+\end_inset
+
+
+\begin_inset Text
+\layout Standard
-\family typewriter
-char test;
-\newline
+$SDCC_LIB
+\backslash
\newline
-void main(void) {
-\newline
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-\SpecialChar ~
-test=0;
-\newline
-}
-\layout Standard
+\emph on
+
+\end_inset
+
+
+
+
+\begin_inset Text
-\series medium
-Compile this using the following command:
-\family sans
-\series bold
-"sdcc -c test.c".
-
-\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
+\layout Standard
+$SDCC_HOME/
\newline
+\emph on
+$PREFIX2DATA_DIR/
\newline
+$LIB_DIR_SUFFIX/
+\end_inset
+
+
+\begin_inset Text
-\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 sdcc cannot find the
-\series default
-/
-\series medium
-usr/local/share/sdcc/lib directory
-\series default
-
-\series medium
-(see the Install trouble-shooting section for suggestions).
-\series default
+\layout Standard
+$SDCC_HOME/
\newline
-
+share/sdcc/
\newline
+lib/
+\emph on
+
+\end_inset
+
+
+\begin_inset Text
-\series medium
-The final test is to ensure sdcc can use the
-\series default
-standard
-\series medium
- header files and libraries.
- Edit test.c and change it to the following:
-\layout Verse
+\layout Standard
+
+$SDCC_HOME
+\backslash
+lib
+\backslash
+\emph on
-\family typewriter
-#include
\newline
+
+\end_inset
+
+
+
+
+\begin_inset Text
+\layout Standard
+
+path(argv[0])/
\newline
-char str1[10];
+
+\emph on
+$BIN2DATADIR/
+\emph default
+
\newline
+\emph on
+$LIB_DIR_SUFFIX/
+\end_inset
+
+
+\begin_inset Text
+
+\layout Standard
+
+path(argv[0])/
\newline
-void main(void) {
+../sdcc/lib/
+\emph on
+
\newline
\SpecialChar ~
\SpecialChar ~
-strcpy(str1, "testing");
-\newline
-}
-\layout Standard
-
-
-\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 sdcc cannot
- find the /usr/local/share/sdcc/include directory
-\series default
-
-\series medium
-(see the Install trouble-shooting section for suggestions).
+\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 ~
-\series default
- Use option
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
+
+
+\begin_inset Text
\layout Standard
+path(argv[0])
\backslash
-/
-\end_inset
--print-search-dirs
-\series default
+\newline
+..
+\backslash
+lib
+\backslash
-\begin_inset LatexCommand \index{-\/-print-search-dirs}
+\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
- to find exactly where SDCC is looking for the include and lib files.
-\layout Subsection
+\layout Standard
-Install Trouble-shooting
-\begin_inset LatexCommand \index{Install trouble-shooting}
+\emph on
+$DATADIR/
+\newline
+$LIB_DIR_SUFFIX/
\end_inset
+
+
+\begin_inset Text
+\layout Standard
-\layout Subsubsection
+/usr/local/share/sdcc/
+\newline
+lib/
+\emph on
+
+\end_inset
+
+
+\begin_inset Text
-SDCC does not build correctly.
\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
+(not on Win32)
+\end_inset
+
+
+
-\family sans
-\series bold
-./configure 2>&1 | tee configure.log
-\family default
-\series default
+\end_inset
-\newline
-\newline
-and build it like:
\newline
-\newline
+\layout Comment
-\family sans
-\series bold
-make 2>&1 | tee make.log
-\family default
-\series default
+Don't delete any of the stray spaces in the table above without checking
+ the HTML output (last line)!
+\layout Standard
-\newline
+\SpecialChar ~
\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 Subsubsection
-
-What the
-\begin_inset Quotes sld
-\end_inset
-
-./configure
-\begin_inset Quotes srd
-\end_inset
+The option -
+\begin_inset ERT
+status Collapsed
- does
\layout Standard
-The
-\begin_inset Quotes sld
+\backslash
+/
\end_inset
-./configure
-\begin_inset Quotes srd
-\end_inset
+-nostdlib disables the last two search paths.
+\layout Section
- 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 Subsubsection
+Building SDCC
+\begin_inset LatexCommand \index{Building SDCC}
-What the
-\begin_inset Quotes sld
\end_inset
-make
-\begin_inset Quotes srd
-\end_inset
- does.
-\layout Standard
+\layout Subsection
-This runs the GNU make tool, which automatically compiles all the source
- packages into the final installed binary executables.
-\layout Subsubsection
+Building SDCC on Linux
+\begin_inset LatexCommand \label{sub:Building-SDCC-on-Linux}
-What the
-\begin_inset Quotes sld
\end_inset
-make install
-\begin_inset Quotes erd
-\end_inset
- command does.
-\layout Standard
+\layout Enumerate
-This will install the compiler, other executables libraries and include
- files into the appropriate directories.
- See section
-\begin_inset Quotes sld
-\end_inset
-Install and Search PATHS
-\begin_inset Quotes srd
+\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}
+
\end_inset
.
-\newline
-On most systems you will need super-user privileges to do this.
-\layout Subsection
+\layout Enumerate
-Components of SDCC
-\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 medium
+Bring up a command line terminal, such as xterm.
+\layout Enumerate
-\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
-sdcc - The compiler.
-\layout Itemize
+\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
-sdcpp - The C preprocessor.
-\layout Itemize
+Change directory into the main SDCC directory, for example type:
+\family sans
+\series bold
+"cd sdcc
+\series default
+".
+\layout Enumerate
-asx8051 - The assembler for 8051 type processors.
-\layout Itemize
-as-z80
+\series medium
+Type
+\family sans
\series bold
-,
+"./configure
+\family default
\series default
-as-gbz80 - The Z80 and GameBoy Z80 assemblers.
-\layout Itemize
+".
+ This configures the package for compilation on your system.
+\layout Enumerate
-aslink -The linker for 8051 type processors.
-\layout Itemize
-link-z80
+\series medium
+Type
+\family sans
\series bold
-,
+"make
+\family default
\series default
-link-gbz80 - The Z80 and GameBoy Z80 linkers.
-\layout Itemize
+"
+\series medium
+.
-s51 - The ucSim 8051 simulator.
-\layout Itemize
+\series default
+ All of the source packages will compile, this can take a while.
+\layout Enumerate
-sdcdb - The source debugger.
-\layout Itemize
-packihx - A tool to pack (compress) Intel hex files.
-\layout Standard
+\series medium
+Type
+\family sans
+\series bold
+"make install"
+\family default
+\series default
+ as root
+\series medium
+.
-In /share/sdcc/include
-\layout Itemize
+\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}
-the include files
-\layout Standard
+\end_inset
-In /share/sdcc/lib
-\layout Itemize
+.
+\layout Subsection
-the subdirs src and small, large, z80, gbz80 and ds390 with the precompiled
- relocatables.
+Building SDCC on OSX 2.x
\layout Standard
-In /share/sdcc/doc
-\layout Itemize
+Follow the instruction for Linux.
+\newline
-the documentation
-\layout Standard
+\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
-As development for other processors proceeds, this list will expand to include
- executables to support processors like AVR, PIC, etc.
-\layout Subsubsection
+./configure CC=gcc2 CXX=g++2
+\layout Subsection
-sdcc - The Compiler
+Cross compiling SDCC on Linux for Windows
\layout Standard
-This is the actual compiler, it in turn uses the c-preprocessor and invokes
- the assembler and linkage editor.
-\layout Subsubsection
-
-sdcpp
-\begin_inset LatexCommand \index{sdcpp}
-
-\end_inset
+With the Mingw32 gcc cross compiler it's easy to compile SDCC for Win32.
+ See section 'Configure Options'.
+\layout Subsection
- - The C-Preprocessor
+Building SDCC using Cygwin and Mingw32
\layout Standard
-The preprocessor is a modified version of the GNU preprocessor.
- The C preprocessor is used to pull in #include sources, process #ifdef
- statements, #defines and so on.
-\layout Subsubsection
-
-asx8051, as-z80, as-gbz80, aslink, link-z80, link-gbz80 - The Assemblers
- and Linkage Editors
-\layout Standard
-
-This is retargettable assembler & linkage editor, it was developed by Alan
- Baldwin.
- John Hartman created the version for 8051, and I (Sandeep) have made some
- enhancements and bug fixes for it to work properly with SDCC.
-\layout Subsubsection
-
-s51 - The Simulator
-\begin_inset LatexCommand \index{s51}
+For building and installing a Cygwin executable follow the instructions
+ for Linux.
+\newline
+\newline
+On Cygwin a
+\begin_inset Quotes sld
\end_inset
-
-\layout Standard
-
-S51 is a freeware, opensource simulator developed by Daniel Drotos (
-\begin_inset LatexCommand \url{mailto:drdani@mazsola.iit.uni-miskolc.hu}
-
+native
+\begin_inset Quotes srd
\end_inset
-).
- 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}
+ Win32-binary can be built, which will not need the Cygwin-DLL.
+ For the necessary 'configure' options see section 'configure options' or
+ the script 'sdcc/support/scripts/sdcc_cygwin_mingw32'.
+\newline
+
+\newline
+In order to install Cygwin on Windows download setup.exe from
+\begin_inset LatexCommand \url[www.cygwin.com]{http://www.cygwin.com/}
\end_inset
.
- It currently supports the core mcs51, the Dallas DS80C390 and the Phillips
- XA51 family.
-\layout Subsubsection
-
-sdcdb
-\begin_inset LatexCommand \index{sdcdb}
-
+ Run it, set the
+\begin_inset Quotes sld
\end_inset
- - Source Level Debugger
-\layout Standard
-
-Sdcdb is the companion source level debugger.
- The current version of the debugger uses Daniel's Simulator S51
-\begin_inset LatexCommand \index{s51}
-
+default text file type
+\begin_inset Quotes srd
\end_inset
-, but can be easily changed to use other simulators.
-\layout Section
-\pagebreak_top
-Using SDCC
-\layout Subsection
-
-Compiling
-\layout Subsubsection
-
-Single Source File Projects
-\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".
-
-\family default
-\series default
- This will compile, assemble and link your source file.
- Output files are as follows
-\layout Itemize
-
-sourcefile.asm
-\begin_inset LatexCommand \index{.asm}
-
+ to
+\begin_inset Quotes sld
\end_inset
- - Assembler source
-\begin_inset LatexCommand \index{Assembler source}
-
+unix
+\begin_inset Quotes srd
\end_inset
- file created by the compiler
+ 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
-sourcefile.lst
-\begin_inset LatexCommand \index{.lst}
-
-\end_inset
-
- - Assembler listing
-\begin_inset LatexCommand \index{Assembler listing}
-
-\end_inset
-
- file created by the Assembler
+flex
\layout Itemize
-sourcefile.rst
-\begin_inset LatexCommand \index{.rst}
-
-\end_inset
-
- - Assembler listing
-\begin_inset LatexCommand \index{Assembler listing}
-
-\end_inset
-
- file updated with linkedit information, created by linkage editor
+bison
\layout Itemize
-sourcefile.sym
-\begin_inset LatexCommand \index{.sym}
-
-\end_inset
-
- - symbol listing
-\begin_inset LatexCommand \index{Symbol listing}
+gcc ; version 3.x is fine, no need to use the old 2.9x
+\layout Itemize
-\end_inset
+binutils ; selected with gcc
+\layout Itemize
- for the sourcefile, created by the assembler
+make
\layout Itemize
-sourcefile.rel
-\begin_inset LatexCommand \index{.rel}
+rxvt ; a nice console, which makes life much easier under windoze (see below)
+\layout Itemize
-\end_inset
+man ; not really needed for building SDCC, but you'll miss it sooner or
+ later
+\layout Itemize
- - Object file
-\begin_inset LatexCommand \index{Object file}
+less ; not really needed for building SDCC, but you'll miss it sooner or
+ later
+\layout Itemize
-\end_inset
+svn ; only if you use Subversion access
+\layout Standard
- created by the assembler, input to Linkage editor
+If you want to develop something you'll need:
\layout Itemize
-sourcefile.map
-\begin_inset LatexCommand \index{.map}
+python ; for the regression tests
+\layout Itemize
+gdb ; the gnu debugger, together with the nice GUI
+\begin_inset Quotes sld
\end_inset
- - The memory map
-\begin_inset LatexCommand \index{Memory map}
-
+insight
+\begin_inset Quotes srd
\end_inset
- for the load module, created by the Linker
-\layout Itemize
-
-sourcefile.mem
-\begin_inset LatexCommand \index{.mem}
-
-\end_inset
- - A file with a summary of the memory usage
\layout Itemize
-sourcefile.ihx
-\begin_inset LatexCommand \index{.ihx}
-
-\end_inset
-
- - The load module in Intel hex format
-\begin_inset LatexCommand \index{Intel hex format}
-
-\end_inset
+openssh ; to access the CF or commit changes
+\layout Itemize
- (you can select the Motorola S19 format
-\begin_inset LatexCommand \index{Motorola S19 format}
+autoconf and autoconf-devel ; if you want to fight with 'configure', don't
+ use autoconf-stable!
+\layout Standard
-\end_inset
+rxvt is a nice console with history.
+ Replace in your cygwin.bat the line
+\layout LyX-Code
- with -
+bash -
\begin_inset ERT
status Collapsed
@@ -3900,44 +3546,16 @@ status Collapsed
/
\end_inset
--out-fmt-s19
-\begin_inset LatexCommand \index{-\/-out-fmt-s19}
-
-\end_inset
-
-.
- If you need another format you might want to use
-\family sans
-\shape italic
-objdump
-\family default
-\shape default
-
-\begin_inset LatexCommand \index{objdump}
-
-\end_inset
-
- or
-\family sans
-\shape italic
- srecord
-\family default
-\shape default
-
-\begin_inset LatexCommand \index{srecord}
-
-\end_inset
-
-)
-\layout Itemize
+-login -i
+\layout Standard
-sourcefile.adb
-\begin_inset LatexCommand \index{.adb}
+with (one line):
+\layout LyX-Code
-\end_inset
+rxvt -sl 1000 -fn "Lucida Console-12" -sr -cr red
+\layout LyX-Code
- - An intermediate file containing debug information needed to create the
- .cdb file (with -
+ -bg black -fg white -geometry 100x65 -e bash -
\begin_inset ERT
status Collapsed
@@ -3947,717 +3565,906 @@ status Collapsed
/
\end_inset
--debug
-\begin_inset LatexCommand \index{-\/-debug}
-
-\end_inset
+-login
+\layout Standard
-)
-\layout Itemize
+Text selected with the mouse is automatically copied to the clipboard, pasting
+ works with shift-insert.
+\newline
-sourcefile.cdb
-\begin_inset LatexCommand \index{.cdb}
+\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
+cygdrive
+\begin_inset Quotes srd
\end_inset
- - An optional file (with -
-\begin_inset ERT
-status Collapsed
+ is too long, you can change it with e.g.
+\layout LyX-Code
+mount -s -u -c /mnt
\layout Standard
-\backslash
-/
+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
--debug) containing debug information
-\layout Itemize
+ 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
-sourcefile.
- - (no extension)
-\begin_inset LatexCommand \index{. (no extension)}
+Building SDCC Using Microsoft Visual C++ 6.0/NET (MSVC)
+\layout Standard
-\end_inset
- An optional AOMF51
-\begin_inset LatexCommand \index{AOMF51}
+\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
- file containing debug information (with -
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\series medium
+, it will be named something like sdcc
+\series default
+.src
+\series medium
+.tgz.
+\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
+
+\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
--debug).
- This format is commonly used by third party tools (debuggers
-\begin_inset LatexCommand \index{Debugger}
+ 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
+unix2dos
+\begin_inset Quotes srd
\end_inset
-, simulators, emulators)
-\layout Itemize
+ utility freely available on the internet.
+ Doug Hawkins reported in the sdcc-user list that this works:
+\newline
-sourcefile.dump*
-\begin_inset LatexCommand \index{.dump*}
+\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[here]{http://unxutils.sourceforge.net}
- - Dump file to debug the compiler it self (with -
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
-\end_inset
+\newline
--dumpall) (see section
-\begin_inset Quotes sld
-\end_inset
+\newline
+Download the file UnxUtils
+\begin_inset LatexCommand \index{UnxUtils}
-Anatomy of the compiler
-\begin_inset Quotes srd
\end_inset
-).
-\layout Subsubsection
-
-Projects with Multiple Source Files
-\layout Standard
+.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
-SDCC can compile only ONE file at a time.
- Let us for example assume that you have a project containing the following
- files:
+The easy way:
\newline
\newline
-foo1.c (contains some functions)
+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
-foo2.c (contains some more functions)
+
\newline
-foomain.c (contains more functions and the function main)
+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
-\size footnotesize
-
\newline
+(As a side effect, you get a bunch of Unix utilities that could be useful,
+ such as diff and patch.)
+\layout Enumerate
-\size default
-The first two files will need to be compiled separately with the commands:
-\size footnotesize
-
-\size default
+A more compact way:
+\newline
\newline
+This one avoids extracting a bunch of files you may not use, but requires
+ some extra work:
+\newline
+\newline
+a) Create a directory were to put the tools needed, or use a directory already
+ present.
+ Say for example 'C:
+\backslash
+util'.
\newline
-\family sans
-\series bold
-sdcc\SpecialChar ~
--c\SpecialChar ~
-foo1.c
-\family default
-\series default
-\size footnotesize
+\newline
+b) Extract 'bison.exe', 'bison.hairy', 'bison.simple', 'flex.exe', and gawk.exe
+ to such directory WITHOUT preserving the original paths.
+ (If you are using WinZip make certain that 'Use folder names' is not selected)
+\newline
+\newline
+c) Rename bison.exe to '_bison.exe'.
\newline
-\family sans
-\series bold
-\size default
-sdcc\SpecialChar ~
--c\SpecialChar ~
-foo2.c
-\family default
-\series default
+\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
\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
-Then compile the source file containing the
-\emph on
-main()
-\emph default
- function and link
-\begin_inset LatexCommand \index{Linker}
+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
- the files together with the following command:
+Building SDCC Using Borland
+\layout Enumerate
+
+From the sdcc directory, run the command "make -f Makefile.bcc".
+ This should regenerate all the .exe files in the bin directory except for
+ SDCDB and ucSim.
+\layout Enumerate
+
+If you modify any source files and need to rebuild, be aware that the dependenci
+es may not be correctly calculated.
+ The safest option is to delete all .obj files and run the build again.
+ From a Cygwin BASH prompt, this can easily be done with the command (be
+ sure you are in the sdcc directory):
\newline
\newline
\family sans
\series bold
-sdcc\SpecialChar ~
-foomain.c\SpecialChar ~
-foo1.rel\SpecialChar ~
-foo2.rel
+find .
+
+\backslash
+( -name '*.obj' -o -name '*.lib' -o -name '*.rul'
+\backslash
+) -print -exec rm {}
+\backslash
+;
\family default
\series default
-\begin_inset LatexCommand \index{.rel}
-
-\end_inset
-
-
\newline
\newline
-Alternatively,
-\emph on
-foomain.c
-\emph default
-can be separately compiled as well:
+or on Windows NT/2000/XP from the command prompt with the command:
+\newline
+
\family sans
\series bold
\newline
+del /s *.obj *.lib *.rul
+\family default
+\series default
+ from the sdcc directory.
+\layout Subsection
-\newline
-sdcc\SpecialChar ~
--c\SpecialChar ~
-foomain.c
-\newline
-sdcc foomain.rel foo1.rel foo2.rel
-\newline
-
-\newline
+Windows Install Using a ZIP Package
+\layout Enumerate
-\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}
+Download the binary zip package from
+\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
\end_inset
-.
- You can view this file to troubleshoot linking problems such as those arising
- from missing libraries.
-\layout Subsubsection
+ 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
-Projects with Additional Libraries
-\begin_inset LatexCommand \index{Libraries}
+Adjust your environment variable PATH to include the location of the bin
+ directory or start sdcc using the full path.
+\layout Subsection
+
+Windows Install Using the Setup Program
+\begin_inset LatexCommand \label{sub:Windows-Install}
\end_inset
\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{.lib}
-
-\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
+Download the setup program
\emph on
-mylib
+sdcc-x.y.z-setup.exe
\emph default
- (if that is not the same as your current project):
-\newline
-
+ for an official release from
\newline
-\family sans
-\series bold
-sdcc foomain.c foolib.lib -L mylib
-\newline
+\begin_inset LatexCommand \url{http://sf.net/project/showfiles.php?group_id=599}
-\newline
+\end_inset
-\family default
-\series default
-Note here that
+ or a setup program for one of the snapshots
\emph on
- mylib
+sdcc-yyyymmdd-xxxx-setup.exe
\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}
+ from
+\begin_inset LatexCommand \url{http://sdcc.sf.net/snap.php}
\end_inset
- files.
- For an example see the standard library file
-\emph on
-libsdcc.lib
-\emph default
- in the directory /share/lib/small.
+ and execute it.
+ A windows typical installer will guide you through the installation process.
\layout Subsection
-Command Line Options
-\begin_inset LatexCommand \index{Command Line Options}
+VPATH
+\begin_inset LatexCommand \index{VPATH}
\end_inset
+ feature
+\layout Standard
-\layout Subsubsection
+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
-Processor Selection Options
-\begin_inset LatexCommand \index{Options processor selection}
-\end_inset
+\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_inset LatexCommand \index{Processor selection options}
+\family typewriter
+tar -xzf sdcc.src.tar.gz\SpecialChar ~
+# extract source to directory sdcc
+\layout Standard
-\end_inset
+\family typewriter
+mkdir sdcc.build\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+# put output in sdcc.build
+\layout Standard
-\layout List
-\labelwidthstring 00.00.0000
+\family typewriter
+cd sdcc.build
+\layout Standard
-\series bold
--mmcs51
-\begin_inset LatexCommand \index{-mmcs51}
-\end_inset
+\family typewriter
+../sdcc/configure\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+# configure is doing all the magic!
+\layout Standard
+\family typewriter
+make
+\layout Standard
+\noindent
+That's it!
+\series bold
+configure
\series default
- Generate code for the Intel MCS51
-\begin_inset LatexCommand \index{MCS51}
+ 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
-\end_inset
+Building the Documentation
+\layout Standard
- family of processors.
- This is the default processor target.
-\layout List
-\labelwidthstring 00.00.0000
+Add -
+\begin_inset ERT
+status Collapsed
+
+\layout Standard
+\backslash
+/
+\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
--mds390
-\begin_inset LatexCommand \index{-mds390}
+\begin_inset Quotes srd
+\end_inset
+
+make
+\begin_inset Quotes srd
\end_inset
+\family default
\series default
- Generate code for the Dallas DS80C390
-\begin_inset LatexCommand \index{DS80C390}
+ there.
+ You're invited to make changes and additions to this manual (sdcc/doc/sdccman.ly
+x).
+ Using LyX
+\begin_inset LatexCommand \url{http://www.lyx.org}
\end_inset
- processor.
-\layout List
-\labelwidthstring 00.00.0000
+ 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
+.
+\layout Section
-\series bold
--mds400
-\begin_inset LatexCommand \index{-mds400}
+Reading the Documentation
+\begin_inset LatexCommand \index{Documentation}
\end_inset
-\series default
- Generate code for the Dallas DS80C400
-\begin_inset LatexCommand \index{DS80C400}
+\layout Standard
-\end_inset
+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
- processor.
-\layout List
-\labelwidthstring 00.00.0000
+\layout Standard
+If you should know why please drop us a note
+\end_inset
-\series bold
--mz80
-\begin_inset LatexCommand \index{-mz80}
+.
+
+\newline
+You'll find the pdf version
+\begin_inset LatexCommand \index{PDF version of this document}
\end_inset
+ at
+\begin_inset LatexCommand \url{http://sdcc.sf.net/doc/sdccman.pdf}
-\series default
- Generate code for the Zilog Z80
-\begin_inset LatexCommand \index{Z80}
+\end_inset
+
+.
+
+\newline
+A html version
+\begin_inset LatexCommand \index{HTML version of this document}
\end_inset
- family of processors.
-\layout List
-\labelwidthstring 00.00.0000
+ should be online at
+\begin_inset LatexCommand \url{http://sdcc.sf.net/doc/sdccman.html/index.html}
+\end_inset
-\series bold
--mgbz80
-\begin_inset LatexCommand \index{-mgbz80}
+.
+\newline
+This documentation is in some aspects different from a commercial documentation:
+
+\layout Itemize
+
+It tries to document SDCC for several processor architectures in one document
+ (commercially these probably would be separate documents/products).
+ This document
+\begin_inset LatexCommand \index{Status of documentation}
\end_inset
+ 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
-\series default
- Generate code for the GameBoy Z80
-\begin_inset LatexCommand \index{GameBoy Z80}
+There are many references pointing away from this documentation.
+ Don't let this distract you.
+ If there f.e.
+ was a reference like
+\begin_inset LatexCommand \url{http://www.opencores.org}
\end_inset
- processor.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--mavr
-\begin_inset LatexCommand \index{-mavr}
-
+ together with a statement
+\begin_inset Quotes sld
\end_inset
-
-\series default
- Generate code for the Atmel AVR
-\begin_inset LatexCommand \index{AVR}
+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
- processor (In development, not complete).
- AVR users should probably have a look at avr-gcc
-\begin_inset LatexCommand \url{ http://savannah.nongnu.org/download/avr-libc/snapshots/}
+\begin_inset Quotes srd
\end_inset
-.
-\layout Comment
-
-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
-
-
-\series bold
--mpic14
-\begin_inset LatexCommand \index{-mpic14}
+ or
+\begin_inset LatexCommand \url{http://sf.net/projects/fpgac}
\end_inset
-\series default
- Generate code for the Microchip PIC 14
-\begin_inset LatexCommand \index{PIC14}
+\begin_inset LatexCommand \index{FpgaC ((subset of) C to FPGA compiler)}
\end_inset
--bit processors (p16f84 and variants).
-\layout Comment
-
-p16f627 p16f628 p16f84 p16f873 p16f877?
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--mpic16
-\begin_inset LatexCommand \index{-mpic16}
-
+
+\begin_inset Quotes sld
\end_inset
+have you ever heard of an open source compiler that compiles a subset of
+ C for an FPGA?
+\begin_inset Quotes srd
+\end_inset
-\series default
- Generate code for the Microchip PIC 16
-\begin_inset LatexCommand \index{PIC16}
+ 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
+Some sections attribute more space to problems, restrictions and warnings
+ than to the solution.
+\layout Itemize
--bit processors (p18f452 and variants).
-\layout List
-\labelwidthstring 00.00.0000
+The installation section and the section about the debugger is intimidating.
+\layout Itemize
+There are still lots of typos and there are more different writing styles
+ than pictures.
+\layout Section
-\series bold
--mtlcs900h
-\series default
- Generate code for the Toshiba TLCS-900H
-\begin_inset LatexCommand \index{TLCS-900H}
+Testing the SDCC Compiler
+\begin_inset LatexCommand \label{sec:Testing-the-SDCC}
\end_inset
- processor (In development, not complete).
-\layout List
-\labelwidthstring 00.00.0000
+\layout Standard
+The first thing you should do after installing your SDCC compiler is to
+ see if it runs.
+ Type
+\family sans
\series bold
--mxa51
-\begin_inset LatexCommand \index{-mxa51}
-
-\end_inset
-
+"sdcc -
+\begin_inset ERT
+status Collapsed
-\series default
- Generate code for the Phillips XA51
-\begin_inset LatexCommand \index{XA51}
+\layout Standard
+\backslash
+/
\end_inset
- processor (In development, not complete).
-\layout Subsubsection
-
-Preprocessor Options
-\begin_inset LatexCommand \index{Options preprocessor}
+-version"
+\begin_inset LatexCommand \index{version}
\end_inset
-\begin_inset LatexCommand \index{Preprocessor options}
-
-\end_inset
+\family default
+\series default
+ at the prompt, and the program should run and output its version like:
+
+\newline
+\family typewriter
+SDCC : mcs51/z80/avr/ds390/pic16/pic14/ds400/hc08 2.5.6 #4169 (May 8 2006)
+ (UNIX)
+\layout Standard
-\layout List
-\labelwidthstring 00.00.0000
+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}
+\end_inset
-\series bold
--I
-\begin_inset LatexCommand \index{-I}
+\SpecialChar ~
-\end_inset
+\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
+\series medium
+SDCC
\series default
- The additional location where the pre processor will look for <..h> or
-\begin_inset Quotes eld
+is commonly installed as described in section
+\begin_inset Quotes sld
\end_inset
-..h
-\begin_inset Quotes erd
+Install and search paths
+\begin_inset Quotes srd
\end_inset
- files.
-\layout List
-\labelwidthstring 00.00.0000
+.
+\newline
+\newline
-\series bold
--D
-\begin_inset LatexCommand \index{-D}
+\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_inset
+\family typewriter
+char test;
+\newline
-\series default
- Command line definition of macros.
- Passed to the preprocessor.
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+void main(void) {
+\newline
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+\SpecialChar ~
+test=0;
+\newline
+}
+\layout Standard
+\series medium
+Compile this using the following command:
+\family sans
\series bold
--M
-\begin_inset LatexCommand \index{-M}
-
-\end_inset
-
+"sdcc -c test.c".
+\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
- 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
-'.
-\layout List
-\labelwidthstring 00.00.0000
+\newline
+\newline
+\series medium
+The next step is to try it with the linker.
+ Type in
+\family sans
\series bold
--C
-\begin_inset LatexCommand \index{-C}
+"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}
\end_inset
+\SpecialChar ~
+\series medium
+Install trouble-shooting for suggestions).
\series default
- Tell the preprocessor not to discard comments.
- Used with the `-E' option.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--MM
-\begin_inset LatexCommand \index{-MM}
-\end_inset
+\newline
+\newline
-\size large
-\bar under
-
+\series medium
+The final test is to ensure
\series default
-\size default
-\bar default
-Like `-M' but the output mentions only the user header files included with
- `#include
-\begin_inset Quotes eld
-\end_inset
-
-file"'.
- System header files included with `#include ' are omitted.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--Aquestion(answer)
-\begin_inset LatexCommand \index{-Aquestion(answer)}
-
-\end_inset
-
-
+SDCC
+\series medium
+ can use the
\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
-
+standard
+\series medium
+ header files and libraries.
+ Edit test.c and change it to the following:
+\layout Verse
-\series bold
--Umacro
-\begin_inset LatexCommand \index{-Umacro}
-\end_inset
+\family typewriter
+#include
+\newline
+\newline
+char str1[10];
+\newline
-\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
+\newline
+void main(void) {
+\newline
+\SpecialChar ~
+\SpecialChar ~
+strcpy(str1, "testing");
+\newline
+}
+\layout Standard
+\series medium
+Compile this by typing
+\family sans
\series bold
--dM
-\begin_inset LatexCommand \index{-dM}
-
-\end_inset
-
-
+"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
- Tell the preprocessor to output only a list of the macro definitions that
- are in effect at the end of preprocessing.
- Used with the `-E' option.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--dD
-\begin_inset LatexCommand \index{-dD}
-
-\end_inset
-
-
+SDCC
+\series medium
+ cannot find the /usr/local/share/sdcc/include directory
\series default
- Tell the preprocessor to pass all macro definitions into the output, in
- their proper sequence in the rest of the output.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--dN
-\begin_inset LatexCommand \index{-dN}
-
-\end_inset
-
-
-\size large
-\bar under
+\series medium
+(see the
\series default
-\size default
-\bar default
-Like `-dD' except that the macro arguments and contents are omitted.
- Only `#define name' is included in the output.
-\layout Subsubsection
-
-Linker Options
-\begin_inset LatexCommand \index{Options linker}
-
-\end_inset
-
-
-\begin_inset LatexCommand \index{Linker options}
+section
+\begin_inset LatexCommand \ref{sub:Install-Trouble-shooting}
\end_inset
+\SpecialChar ~
-\layout List
-\labelwidthstring 00.00.0000
-
+\series medium
+Install trouble-shooting section for suggestions).
+\series default
+ Use option
\series bold
--L\SpecialChar ~
-
-\series default
-
\begin_inset ERT
status Collapsed
@@ -4667,386 +4474,434 @@ status Collapsed
/
\end_inset
+-print-search-dirs
+\series default
-\series bold
--lib-path
-\begin_inset LatexCommand \index{-\/-lib-path}
+\begin_inset LatexCommand \index{-\/-print-search-dirs}
\end_inset
+ to find exactly where SDCC is looking for the include and lib files.
+\layout Section
-\begin_inset LatexCommand \index{-L -\/-lib-path}
+Install Trouble-shooting
+\begin_inset LatexCommand \label{sub:Install-Trouble-shooting}
\end_inset
-\bar under
-
-\series default
-\bar default
- This option is passed to the linkage
- editor's additional libraries
-\begin_inset LatexCommand \index{Libraries}
+\begin_inset LatexCommand \index{Install trouble-shooting}
\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
-
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\layout Subsection
+If SDCC does not build correctly
\layout Standard
-\backslash
-/
-\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
--xram-loc
+\newline
+
+\family sans
+\series bold
+./configure 2>&1 | tee configure.log
+\family default
\series default
-\begin_inset LatexCommand \index{-\/-xram-loc}
+\newline
-\end_inset
+\newline
+and build it like:
+\newline
- The start location of the external ram
-\begin_inset LatexCommand \index{xdata}
+\newline
-\end_inset
+\family sans
+\series bold
+make 2>&1 | tee make.log
+\family default
+\series default
-, default value is 0.
- The value entered can be in Hexadecimal or Decimal format, e.g.: -
-\begin_inset ERT
-status Collapsed
+\newline
-\layout Standard
+\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
-\backslash
-/
+What the
+\begin_inset Quotes sld
\end_inset
--xram-loc 0x8000 or -
-\begin_inset ERT
-status Collapsed
+./configure
+\begin_inset Quotes srd
+\end_inset
+ does
\layout Standard
-\backslash
-/
+The
+\begin_inset Quotes sld
\end_inset
--xram-loc 32768.
-\layout List
-\labelwidthstring 00.00.0000
+./configure
+\begin_inset Quotes srd
+\end_inset
+ command is a script that analyzes your system and performs some configuration
+ to ensure the source package compiles on your system.
+ It will take a few minutes to run, and will compile a few tests to determine
+ what compiler features are installed.
+\layout Subsection
-\series bold
--
-\begin_inset ERT
-status Collapsed
+What the
+\begin_inset Quotes sld
+\end_inset
+
+make
+\begin_inset Quotes srd
+\end_inset
+ does
\layout Standard
-\backslash
-/
+This runs the GNU make tool, which automatically compiles all the source
+ packages into the final installed binary executables.
+\layout Subsection
+
+What the
+\begin_inset Quotes sld
\end_inset
--code-loc
-\series default
+make install
+\begin_inset Quotes erd
+\end_inset
-\begin_inset LatexCommand \index{-\/-code-loc}
+ command does.
+\layout Standard
+
+This will install the compiler, other executables libraries and include
+ files into the appropriate directories.
+ See sections
+\begin_inset LatexCommand \ref{sub:Install-paths}
\end_inset
- The start location of the code
-\begin_inset LatexCommand \index{code}
+,\SpecialChar ~
+
+\begin_inset LatexCommand \ref{sub:Search-Paths}
\end_inset
- segment, default value 0.
- Note when this option is used the interrupt vector table is also relocated
- to the given address.
- The value entered can be in Hexadecimal or Decimal format, e.g.: -
-\begin_inset ERT
-status Collapsed
+\SpecialChar ~
+about install and search paths.
+\newline
+On most systems you will need super-user privileges to do this.
+\layout Section
+Components of SDCC
\layout Standard
-\backslash
-/
-\end_inset
+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
--code-loc 0x8000 or -
-\begin_inset ERT
-status Collapsed
+\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
-\layout Standard
+sdcc - The compiler.
+\layout Itemize
-\backslash
-/
-\end_inset
+sdcpp - The C preprocessor.
+\layout Itemize
--code-loc 32768.
-\layout List
-\labelwidthstring 00.00.0000
+asx8051 - The assembler for 8051 type processors.
+\layout Itemize
+
+as-z80
+\series bold
+,
+\series default
+as-gbz80 - The Z80 and GameBoy Z80 assemblers.
+\layout Itemize
+aslink -The linker for 8051 type processors.
+\layout Itemize
+link-z80
\series bold
--
-\begin_inset ERT
-status Collapsed
+,
+\series default
+link-gbz80 - The Z80 and GameBoy Z80 linkers.
+\layout Itemize
-\layout Standard
+s51 - The ucSim 8051 simulator.
+\layout Itemize
-\backslash
-/
-\end_inset
+sdcdb - The source debugger.
+\layout Itemize
--stack-loc
-\series default
+packihx - A tool to pack (compress) Intel hex files.
+\layout Standard
-\begin_inset LatexCommand \index{-\/-stack-loc}
+In /share/sdcc/include
+\layout Itemize
-\end_inset
+the include files
+\layout Standard
- By default the stack
-\begin_inset LatexCommand \index{stack}
+In /share/sdcc/lib
+\layout Itemize
-\end_inset
+the subdirs src and small, large, z80, gbz80 and ds390 with the precompiled
+ relocatables.
+\layout Standard
- 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
+In /share/sdcc/doc
+\layout Itemize
+the documentation
\layout Standard
-\backslash
-/
-\end_inset
+As development for other processors proceeds, this list will expand to include
+ executables to support processors like AVR, PIC, etc.
+\layout Subsection
--stack-loc 0x20 or -
-\begin_inset ERT
-status Collapsed
+sdcc - The Compiler
+\layout Standard
+
+This is the actual compiler, it in turn uses the c-preprocessor and invokes
+ the assembler and linkage editor.
+\layout Subsection
+sdcpp - The C-Preprocessor
\layout Standard
-\backslash
-/
+The preprocessor
+\begin_inset LatexCommand \index{sdcpp (preprocessor)}
+
\end_inset
--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.
-\layout List
-\labelwidthstring 00.00.0000
+ is a modified version of the GNU cpp
+\begin_inset LatexCommand \index{cpp|see{sdcpp}}
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+ preprocessor
+\begin_inset LatexCommand \url{http://gcc.gnu.org/}
+
+\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
-\backslash
-/
-\end_inset
+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
--data-loc
-\series default
+s51 - The Simulator
+\layout Standard
-\begin_inset LatexCommand \index{-\/-data-loc}
+S51
+\begin_inset LatexCommand \index{s51}
\end_inset
- The start location of the internal ram data
-\begin_inset LatexCommand \index{data}
+ is a freeware, opensource simulator developed by Daniel Drotos.
+ The simulator is built as part of the build process.
+ For more information visit Daniel's web site at:
+\begin_inset LatexCommand \url{http://mazsola.iit.uni-miskolc.hu/~drdani/embedded/s51}
\end_inset
- segment.
- The value entered can be in Hexadecimal or Decimal format, eg.
- -
-\begin_inset ERT
-status Collapsed
+.
+ It currently supports the core mcs51, the Dallas DS80C390 and the Phillips
+ XA51 family.
+\layout Subsection
+sdcdb - Source Level Debugger
\layout Standard
-\backslash
-/
-\end_inset
+SDCDB
+\begin_inset LatexCommand \index{SDCDB (debugger)}
--data-loc 0x20 or -
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+ is the companion source level debugger.
+ More about SDCDB in section
+\begin_inset LatexCommand \ref{cha:Debugging-with-SDCDB}
-\backslash
-/
\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
-
-\layout Standard
+.
+ The current version of the debugger uses Daniel's Simulator S51
+\begin_inset LatexCommand \index{s51}
-\backslash
-/
\end_inset
--data-loc is not used, to location 0x10.)
-\layout List
-\labelwidthstring 00.00.0000
+, but can be easily changed to use other simulators.
+\layout Chapter
+Using SDCC
+\layout Section
-\series bold
--
-\begin_inset ERT
-status Collapsed
+Compiling
+\layout Subsection
+Single Source File Projects
\layout Standard
-\backslash
-/
-\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".
--idata-loc
+\family default
\series default
+ This will compile, assemble and link your source file.
+ Output files are as follows:
+\layout Itemize
-\begin_inset LatexCommand \index{-\/-idata-loc}
+sourcefile.asm
+\begin_inset LatexCommand \index{.asm}
\end_inset
- The start location of the indirectly addressable internal ram
-\begin_inset LatexCommand \index{idata}
+ - Assembler source
+\begin_inset LatexCommand \index{Assembler source}
\end_inset
-, default value is 0x80.
- The value entered can be in Hexadecimal or Decimal format, eg.
- -
-\begin_inset ERT
-status Collapsed
+ file created by the compiler
+\layout Itemize
-\layout Standard
+sourcefile.lst
+\begin_inset LatexCommand \index{.lst}
-\backslash
-/
\end_inset
--idata-loc 0x88 or -
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+ - Assembler listing
+\begin_inset LatexCommand \index{Assembler listing}
-\backslash
-/
\end_inset
--idata-loc 136.
-\layout List
-\labelwidthstring 00.00.0000
-
-
-\series bold
--
-\begin_inset ERT
-status Collapsed
+ file created by the Assembler
+\layout Itemize
-\layout Standard
+sourcefile.rst
+\begin_inset LatexCommand \index{.rst}
-\backslash
-/
\end_inset
--out-fmt-ihx
-\begin_inset LatexCommand \index{-\/-out-fmt-ihx}
+ - Assembler listing
+\begin_inset LatexCommand \index{Assembler listing}
\end_inset
+ file updated with linkedit information, created by linkage editor
+\layout Itemize
-\bar under
-
-\series default
-\bar default
-The linker output (final object code) is in Intel Hex format.
-\begin_inset LatexCommand \index{Intel hex format}
+sourcefile.sym
+\begin_inset LatexCommand \index{.sym}
\end_inset
- (This is the default option).
-\layout List
-\labelwidthstring 00.00.0000
+ - symbol listing
+\begin_inset LatexCommand \index{Symbol listing}
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+ for the sourcefile, created by the assembler
+\layout Itemize
-\layout Standard
+sourcefile.rel
+\begin_inset LatexCommand \index{.rel}
-\backslash
-/
\end_inset
--out-fmt-s19
-\begin_inset LatexCommand \index{-\/-out-fmt-s19}
+ or sourcefile.o
+\begin_inset LatexCommand \index{.o}
\end_inset
+ - Object file
+\begin_inset LatexCommand \index{Object file}
-\bar under
-
-\series default
-\bar default
-The linker output (final object code) is in Motorola S19 format
-\begin_inset LatexCommand \index{Motorola S19 format}
+\end_inset
+
+ created by the assembler, input to Linkage editor
+\layout Itemize
+
+sourcefile.map
+\begin_inset LatexCommand \index{.map}
\end_inset
-.
-\layout Subsubsection
+ - The memory map
+\begin_inset LatexCommand \index{Memory map}
-MCS51 Options
-\begin_inset LatexCommand \index{Options MCS51}
+\end_inset
+
+ for the load module, created by the Linker
+\layout Itemize
+
+sourcefile.mem
+\begin_inset LatexCommand \index{.mem}
\end_inset
+ - A file with a summary of the memory usage
+\layout Itemize
-\begin_inset LatexCommand \index{MCS51 options}
+sourcefile.ihx
+\begin_inset LatexCommand \index{.ihx}
\end_inset
+ - The load module in Intel hex format
+\begin_inset LatexCommand \index{Intel hex format}
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+ (you can select the Motorola S19 format
+\begin_inset LatexCommand \index{Motorola S19 format}
-\series bold
--
+\end_inset
+
+ with -
\begin_inset ERT
status Collapsed
@@ -5056,53 +4911,50 @@ status Collapsed
/
\end_inset
--model-small
-\begin_inset LatexCommand \index{-\/-model-small}
+-out-fmt-s19
+\begin_inset LatexCommand \index{-\/-out-fmt-s19}
\end_inset
+.
+ If you need another format you might want to use
+\family sans
+\shape italic
+objdump
+\family default
+\shape default
-\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
+\begin_inset LatexCommand \index{objdump (tool)}
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+ or
+\family sans
+\shape italic
+ srecord
+\family default
+\shape default
-\layout Standard
+\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
-\backslash
-/
\end_inset
--model-large
-\begin_inset LatexCommand \index{-\/-model-large}
+).
+ Both formats are documented in the documentation of srecord
+\begin_inset LatexCommand \index{srecord (bin, hex, ... tool)}
\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 should be compiled
- with this option.
-\layout List
-\labelwidthstring 00.00.0000
+\layout Itemize
+sourcefile.adb
+\begin_inset LatexCommand \index{.adb}
-\series bold
--
+\end_inset
+
+ - An intermediate file containing debug information needed to create the
+ .cdb file (with -
\begin_inset ERT
status Collapsed
@@ -5112,22 +4964,20 @@ status Collapsed
/
\end_inset
--xstack
-\begin_inset LatexCommand \index{-\/-xstack}
+-debug
+\begin_inset LatexCommand \index{-\/-debug}
\end_inset
+)
+\layout Itemize
-\series default
- Uses a pseudo stack in the first 256 bytes in the external ram for allocating
- variables and passing parameters.
- See section on external stack for more details.
-\layout List
-\labelwidthstring 00.00.0000
+sourcefile.cdb
+\begin_inset LatexCommand \index{.cdb}
+\end_inset
-\series bold
--
+ - An optional file (with -
\begin_inset ERT
status Collapsed
@@ -5137,21 +4987,27 @@ status Collapsed
/
\end_inset
--iram-size
-\series default
-
-\begin_inset LatexCommand \index{-\/-iram-size}
+-debug) containing debug information.
+ The format is documented in cdbfileformat.pdf
+\layout Itemize
+
+sourcefile.
+ - (no extension)
+\begin_inset LatexCommand \index{ (no extension)}
\end_inset
- Causes the linker to check if the internal ram usage is within limits of
- the given value.
-\layout List
-\labelwidthstring 00.00.0000
+ An optional AOMF or AOMF51
+\begin_inset LatexCommand \index{AOMF, AOMF51}
+\end_inset
-\series bold
--
+
+\begin_inset LatexCommand \label{OMF file}
+
+\end_inset
+
+file containing debug information (generated with option -
\begin_inset ERT
status Collapsed
@@ -5161,21 +5017,37 @@ status Collapsed
/
\end_inset
--xram-size
-\series default
-
-\begin_inset LatexCommand \index{-\/-xram-size}
+-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
- Causes the linker to check if the external ram usage is within limits of
- the given value.
-\layout List
-\labelwidthstring 00.00.0000
+, simulators, emulators)
+\layout Itemize
+sourcefile.dump*
+\begin_inset LatexCommand \index{.dump*}
-\series bold
--
+\end_inset
+
+ - Dump file to debug the compiler it self (generated with option -
\begin_inset ERT
status Collapsed
@@ -5185,567 +5057,610 @@ status Collapsed
/
\end_inset
--code-size
-\series default
-
-\begin_inset LatexCommand \index{-\/-data-loc}
+-dumpall) (see section
+\begin_inset LatexCommand \ref{sub:Intermediate-Dump-Options}
\end_inset
- Causes the linker to check if the code memory usage is within limits of
- the given value.
-\layout Subsubsection
-
-DS390 Options
-\begin_inset LatexCommand \index{Options DS390}
+\SpecialChar ~
+ and section
+\begin_inset LatexCommand \ref{sub:The-anatomy-of}
\end_inset
+\SpecialChar ~
-\begin_inset LatexCommand \index{DS390 options}
-
+\begin_inset Quotes sld
\end_inset
+Anatomy of the compiler
+\begin_inset Quotes srd
+\end_inset
-\layout List
-\labelwidthstring 00.00.0000
+).
+\layout Subsection
+Postprocessing the Intel Hex
+\begin_inset LatexCommand \index{Intel hex format}
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
+ file
\layout Standard
-\backslash
-/
+In most cases this won't be needed but the Intel Hex file
+\begin_inset LatexCommand \index{.ihx}
+
\end_inset
--model-flat24
-\series default
+ 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
-\begin_inset LatexCommand \index{-\/-model-flat24}
+\begin_inset LatexCommand \index{packihx (tool)}
\end_inset
+ which is part of the SDCC distribution:
+\newline
-\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
+\newline
+
+\family sans
+\series bold
+ packihx sourcefile.ihx >sourcefile.hex
+\family default
+\series default
+
+\newline
+
+\newline
+The separately available
\emph on
--mds390
+ srecord
\emph default
-.
- See section Memory Models for more details.
-\layout List
-\labelwidthstring 00.00.0000
+\begin_inset LatexCommand \index{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{checksum}
-\backslash
-/
\end_inset
--stack-10bit
-\series default
+ of various flavours (crc, add, xor) and to perform other manipulations
+ (convert, split, crop, offset, ...).
+
+\newline
-\begin_inset LatexCommand \index{-\/-stack-10bit}
+\newline
-\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_inset
+\family sans
+\series bold
+srec_cat\SpecialChar ~
+\SpecialChar ~
+sourcefile.ihx -intel\SpecialChar ~
+\SpecialChar ~
+-o sourcefile.hex -intel
+\newline
+\newline
-\emph default
- option, but that has not been tested.
- It is incompatible with the
-\emph on
--
-\begin_inset ERT
-status Collapsed
+\family default
+\series default
+An example for a more complex command line
+\begin_inset Foot
+collapsed false
\layout Standard
-\backslash
-/
-\end_inset
+the command backfills
+\begin_inset LatexCommand \index{backfill unused memory}
--xstack
-\begin_inset LatexCommand \index{-\/-xstack}
+\end_inset
+ unused memory with 0x12 and the overall 16 bit sum of the complete 64 kByte
+ block is zero.
+ If the program counter on an mcs51 runs wild the backfill pattern 0x12
+ will be interpreted as an
+\family typewriter
+lcall
+\family default
+ to address
+\family typewriter
+0x1212
+\family default
+ (where an emergency routine could sit).
\end_inset
+ could look like:
+\newline
-\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
+\newline
-\layout Standard
+\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
-\backslash
-/
-\end_inset
+\newline
--model-flat24 option
-\emph default
-).
-\layout Subsubsection
+\newline
-Z80 Options
-\begin_inset LatexCommand \index{Options Z80}
+\family default
+\series default
+The srecord package is available at
+\begin_inset LatexCommand \url{http://sf.net/projects/srecord}
\end_inset
+ .
+\layout Subsection
-\begin_inset LatexCommand \index{Z80 options}
+Projects with Multiple Source Files
+\layout Standard
-\end_inset
+SDCC can compile only ONE file at a time.
+ Let us for example assume that you have a project containing the following
+ files:
+\newline
+\newline
+foo1.c (contains some functions)
+\newline
+foo2.c (contains some more functions)
+\newline
+foomain.c (contains more functions and the function main)
+\newline
-\layout List
-\labelwidthstring 00.00.0000
+\size footnotesize
+\newline
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\size default
+The first two files will need to be compiled separately with the commands:
+\size footnotesize
+
+\size default
-\layout Standard
+\newline
-\backslash
-/
-\end_inset
+\newline
--callee-saves-bc
+\family sans
+\series bold
+sdcc\SpecialChar ~
+-c\SpecialChar ~
+foo1.c
+\family default
\series default
+\size footnotesize
-\begin_inset LatexCommand \index{-\/-callee-saves-bc}
+\newline
-\end_inset
+\family sans
+\series bold
+\size default
+sdcc\SpecialChar ~
+-c\SpecialChar ~
+foo2.c
+\family default
+\series default
+\newline
-\size large
+\newline
+Then compile the source file containing the
\emph on
-
-\size default
+main()
\emph default
-Force a called function to always save BC.
-\layout List
-\labelwidthstring 00.00.0000
-
+ function and link
+\begin_inset LatexCommand \index{Linker}
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+ the files together with the following command:
+\newline
-\backslash
-/
-\end_inset
+\newline
--no-std-crt0
+\family sans
+\series bold
+sdcc\SpecialChar ~
+foomain.c\SpecialChar ~
+foo1.rel\SpecialChar ~
+foo2.rel
+\family default
\series default
-\begin_inset LatexCommand \index{-\/-no-std-crt0}
+\begin_inset LatexCommand \index{.rel}
\end_inset
- When linking, skip the standard crt0.o object file.
- You must provide your own crt0.o for your system when linking.
-
-\layout Subsubsection
-
-Optimization Options
-\begin_inset LatexCommand \index{Options optimization}
-\end_inset
+\newline
+\newline
+Alternatively,
+\emph on
+foomain.c
+\emph default
+can be separately compiled as well:
+\family sans
+\series bold
-\begin_inset LatexCommand \index{Optimization options}
+\newline
-\end_inset
+\newline
+sdcc\SpecialChar ~
+-c\SpecialChar ~
+foomain.c
+\newline
+sdcc foomain.rel foo1.rel foo2.rel
+\newline
+\newline
-\layout List
-\labelwidthstring 00.00.0000
+\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}
+\end_inset
-\series bold
--
-\begin_inset ERT
-status Collapsed
+.
+ You can view this file to troubleshoot linking problems such as those arising
+ from missing libraries.
+\layout Subsection
-\layout Standard
+Projects with Additional Libraries
+\begin_inset LatexCommand \index{Libraries}
-\backslash
-/
\end_inset
--nogcse
-\begin_inset LatexCommand \index{-\/-nogcse}
-
-\end_inset
+\layout Standard
-\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.
- A warning message will be generated when this happens and the compiler
- will indicate the number of extra bytes it allocated.
- It recommended that this option NOT be used, #pragma\SpecialChar ~
-NOGCSE
-\begin_inset LatexCommand \index{\#pragma NOGCSE}
+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}
\end_inset
- can be used to turn off global subexpression elimination
-\begin_inset LatexCommand \index{Subexpression elimination}
-\end_inset
-
- for a given function only.
-\layout List
-\labelwidthstring 00.00.0000
+\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
+\newline
+\family sans
\series bold
--
-\begin_inset ERT
-status Collapsed
+sdcc foomain.c foolib.lib -L mylib
+\newline
-\layout Standard
+\newline
-\backslash
-/
-\end_inset
+\family default
+\series default
+Note here that
+\emph on
+ mylib
+\emph default
+ must be an absolute path name.
+\newline
--noinvariant
-\begin_inset LatexCommand \index{-\/-noinvariant}
+\newline
+The most efficient way to use libraries is to keep separate modules in separate
+ source files.
+ The lib file now should name all the modules.rel
+\begin_inset LatexCommand \index{.rel}
\end_inset
+ files.
+ For an example see the standard library file
+\emph on
+libsdcc.lib
+\emph default
+ in the directory /share/lib/small.
+\layout Subsection
-\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 section Loop Invariants.It
- recommended that this option NOT be used, #pragma\SpecialChar ~
-NOINVARIANT
-\begin_inset LatexCommand \index{\#pragma NOINVARIANT}
+Using sdcclib to Create and Manage Libraries
+\begin_inset LatexCommand \index{sdcclib}
\end_inset
- can be used to turn off invariant optimizations for a given function only.
-\layout List
-\labelwidthstring 00.00.0000
+\layout Standard
-\series bold
--
-\begin_inset ERT
-status Collapsed
+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
-\backslash
-/
-\end_inset
--noinduction
-\begin_inset LatexCommand \index{-\/-noinduction}
+\family sans
+\series bold
+sdcclib -?
+\begin_inset LatexCommand \index{sdcclib}
\end_inset
-\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 ~
-NOINDUCT
-ION
-\begin_inset LatexCommand \index{\#pragma NOINDUCTION}
+\newline
-\end_inset
+\newline
- can be used to turn off induction optimizations for a given function only.
-\layout List
-\labelwidthstring 00.00.0000
+\family default
+\series default
+To create a new library file, start by compiling all the required modules.
+ For example:
+\newline
+
+\layout Standard
+\family sans
\series bold
--
-\begin_inset ERT
-status Collapsed
+sdcc -c _divsint.c
+\layout Standard
+
+\family sans
+\series bold
+sdcc -c _divuint.c
\layout Standard
-\backslash
-/
-\end_inset
--nojtbound
-\begin_inset LatexCommand \index{-\/-nojtbound}
+\family sans
+\series bold
+sdcc -c _modsint.c
+\layout Standard
-\end_inset
+\family sans
+\series bold
+sdcc -c _moduint.c
+\layout Standard
-\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
+\family sans
+\series bold
+sdcc -c _mulint.c
+\newline
- are implemented using jump-tables.
- See section Switch Statements for more details.
- It is recommended that this option is NOT used, #pragma\SpecialChar ~
-NOJTBOUND
-\begin_inset LatexCommand \index{\#pragma NOJTBOUND}
+\layout Standard
-\end_inset
+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
- can be used to turn off boundary checking for jump tables for a given function
- only.
-\layout List
-\labelwidthstring 00.00.0000
+\layout Standard
+\family sans
\series bold
--
-\begin_inset ERT
-status Collapsed
+sdcclib libint.lib _divsint.rel
+\family default
-\layout Standard
+\begin_inset LatexCommand \index{sdcclib}
-\backslash
-/
\end_inset
--noloopreverse
-\begin_inset LatexCommand \index{-\/-noloopreverse}
-\end_inset
+\layout Standard
-\series default
-\size large
-
-\size default
-Will not do loop reversal
-\begin_inset LatexCommand \index{Loop reversing}
+\family sans
+\series bold
+sdcclib libint.lib _divuint.rel
+\layout Standard
-\end_inset
-optimization.
-\layout List
-\labelwidthstring 00.00.0000
+\family sans
+\series bold
+sdcclib libint.lib _modsint.rel
+\layout Standard
--
-\begin_inset ERT
-status Collapsed
+\family sans
+\series bold
+sdcclib libint.lib _moduint.rel
\layout Standard
-\backslash
-/
-\end_inset
--
+\family sans
\series bold
-nolabelopt
+sdcclib libint.lib _mulint.rel
\series default
-
-\begin_inset LatexCommand \index{-\/-nolabelopt }
-\end_inset
+\newline
-Will not optimize labels (makes the dumpfiles more readable).
-\layout List
-\labelwidthstring 00.00.0000
+\layout Standard
+
+If the file already exists in the library, it will be replaced.
+ To see what modules and symbols are included in the library, options -s
+ and -m are available.
+ For example:
+\newline
+\newline
+\family sans
\series bold
--
-\begin_inset ERT
-status Collapsed
+sdcclib -s libint.lib
+\family default
-\layout Standard
+\begin_inset LatexCommand \index{sdcclib}
-\backslash
-/
\end_inset
--no-xinit-opt
-\begin_inset LatexCommand \index{-\/-no-xinit-opt}
-
-\end_inset
+\newline
+\family typewriter
\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.
-\layout Subsubsection
-
-Other Options
-\begin_inset LatexCommand \index{Options other}
+_divsint.rel:
+\layout Standard
-\end_inset
+\family typewriter
+__divsint_a_1_1
+\layout Standard
-\layout List
-\labelwidthstring 00.00.0000
+\family typewriter
+__divsint_PARM_2
+\layout Standard
-\series bold
--c\SpecialChar ~
--
-\begin_inset ERT
-status Collapsed
+\family typewriter
+__divsint
+\newline
+_divuint.rel:
\layout Standard
-\backslash
-/
-\end_inset
--compile-only
-\begin_inset LatexCommand \index{-\/-compile-only}
+\family typewriter
+__divuint_a_1_1
+\layout Standard
-\end_inset
+\family typewriter
+__divuint_PARM_2
+\layout Standard
-\begin_inset LatexCommand \index{-c -\/-compile-only}
-\end_inset
+\family typewriter
+__divuint_reste_1_1
+\layout Standard
-\series default
- will compile and assemble the source, but will not call the linkage editor.
-\layout List
-\labelwidthstring 00.00.0000
+\family typewriter
+__divuint_count_1_1
+\layout Standard
-\series bold
--
-\series default
+\family typewriter
+__divuint
+\newline
+_modsint.rel:
+\layout Standard
-\begin_inset ERT
-status Collapsed
+\family typewriter
+__modsint_a_1_1
\layout Standard
-\backslash
-/
-\end_inset
+\family typewriter
+__modsint_PARM_2
+\layout Standard
-\series bold
--c1mode
-\begin_inset LatexCommand \index{-\/-c1mode}
-\end_inset
+\family typewriter
+__modsint
+\newline
+_moduint.rel:
+\layout Standard
-\series default
- reads the preprocessed source from standard input and compiles it.
- The file name for the assembler output must be specified using the -o option.
-\layout List
-\labelwidthstring 00.00.0000
-
+\family typewriter
+__moduint_a_1_1
+\layout Standard
-\series bold
--E
-\begin_inset LatexCommand \index{-E}
-\end_inset
+\family typewriter
+__moduint_PARM_2
+\layout Standard
-\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
+\family typewriter
+__moduint_count_1_1
+\layout Standard
-\series bold
--o\SpecialChar ~
-
-\begin_inset LatexCommand \index{-o }
+\family typewriter
+__moduint
+\newline
+_mulint.rel:
+\layout Standard
-\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
+\family typewriter
+__mulint_PARM_2
+\layout Standard
+\family typewriter
+__mulint
+\family default
\series bold
--
+
+\newline
+
+\layout Standard
+\added_space_bottom bigskip
+If the source files are compiled using -
\begin_inset ERT
status Collapsed
@@ -5755,616 +5670,531 @@ status Collapsed
/
\end_inset
--stack-auto
-\begin_inset LatexCommand \index{-\/-stack-auto}
+-debug
+\begin_inset LatexCommand \index{-\/-debug}
\end_inset
+, 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
-\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
+Command Line Options
+\begin_inset LatexCommand \index{Command Line Options}
-\begin_inset LatexCommand \index{reentrant}
+\end_inset
+
+
+\layout Subsection
+
+Processor Selection Options
+\begin_inset LatexCommand \index{Options processor selection}
\end_inset
-, i.e.
- the parameters and local variables will be allocated on the stack
-\begin_inset LatexCommand \index{stack}
+
+\begin_inset LatexCommand \index{Processor selection options}
\end_inset
-.
- see section Parameters and Local Variables for more details.
- If this option is used all source files in the project should be compiled
- with this option.
-
+
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+-mmcs51
+\begin_inset LatexCommand \index{-mmcs51}
-\backslash
-/
\end_inset
--callee-saves
-\begin_inset LatexCommand \index{-\/-callee-saves}
+
+\series default
+ Generate code for the Intel MCS51
+\begin_inset LatexCommand \index{MCS51}
\end_inset
- function1[,function2][,function3]....
+ family of processors.
+ This is the default processor target.
+\layout List
+\labelwidthstring 00.00.0000
-\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
-\begin_inset LatexCommand \index{function prologue}
+\series bold
+-mds390
+\begin_inset LatexCommand \index{-mds390}
\end_inset
\series default
- & epilogue
-\series bold
-
-\begin_inset LatexCommand \index{function epilogue}
+ Generate code for the Dallas DS80C390
+\begin_inset LatexCommand \index{DS80C390}
\end_inset
+ processor.
+\layout List
+\labelwidthstring 00.00.0000
-\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 -
-\begin_inset ERT
-status Collapsed
-\layout Standard
+\series bold
+-mds400
+\begin_inset LatexCommand \index{-mds400}
-\backslash
-/
\end_inset
--callee-saves option string.
- Also see #pragma\SpecialChar ~
-CALLEE-SAVES
-\begin_inset LatexCommand \index{\#pragma CALLEE-SAVES}
+
+\series default
+ Generate code for the Dallas DS80C400
+\begin_inset LatexCommand \index{DS80C400}
\end_inset
-.
+ processor.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+-mhc08
+\begin_inset LatexCommand \index{-mhc08}
-\backslash
-/
\end_inset
--debug
-\begin_inset LatexCommand \index{-\/-debug}
-\end_inset
+\series default
+ Generate code for the Freescale/Motorola HC08
+\begin_inset LatexCommand \index{HC08}
+\end_inset
-\bar under
-
-\series default
-\bar default
-When this option is used the compiler will generate debug information, that
- can be used with the SDCDB.
- The debug information is collected in a file with .cdb extension.
- For more information see documentation for SDCDB.
+ family of processors.
\layout List
\labelwidthstring 00.00.0000
\series bold
--S
-\begin_inset LatexCommand \index{-S}
+-mz80
+\begin_inset LatexCommand \index{-mz80}
\end_inset
-\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.
+ Generate code for the Zilog Z80
+\begin_inset LatexCommand \index{Z80}
+
+\end_inset
+
+ family of processors.
\layout List
\labelwidthstring 00.00.0000
\series bold
--Wa_asmOption[,asmOption]
-\series default
+-mgbz80
+\begin_inset LatexCommand \index{-mgbz80}
+
+\end_inset
-\begin_inset LatexCommand \index{-Wa\_asmOption[,asmOption]}
+
+\series default
+ Generate code for the GameBoy Z80
+\begin_inset LatexCommand \index{gbz80 (GameBoy Z80)}
\end_inset
-...
- Pass the asmOption to the assembler.
+ processor (Not actively maintained).
\layout List
\labelwidthstring 00.00.0000
\series bold
--Wl_linkOption[,linkOption]
+-mavr
+\begin_inset LatexCommand \index{-mavr}
+
+\end_inset
+
+
\series default
+ Generate code for the Atmel AVR
+\begin_inset LatexCommand \index{AVR}
-\begin_inset LatexCommand \index{-Wl\_linkOption[,linkOption]}
+\end_inset
+
+ processor (Not maintained, not complete).
+ AVR users should probably have a look at winavr
+\begin_inset LatexCommand \url{http://sourceforge.net/projects/winavr}
\end_inset
-...
- Pass the linkOption to the linker.
+ or
+\begin_inset LatexCommand \url{http://www.avrfreaks.net/index.php?name=PNphpBB2&file=index}
+
+\end_inset
+
+.
+\layout Comment
+
+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
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+-mpic14
+\begin_inset LatexCommand \index{-mpic14}
-\backslash
-/
\end_inset
--int-long-reent
-\begin_inset LatexCommand \index{-\/-int-long-reent}
+
+\series default
+ Generate code for the Microchip PIC 14
+\begin_inset LatexCommand \index{PIC14}
\end_inset
+-bit processors (p16f84 and variants.
+ In development, not complete).
+\layout Comment
-\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.
+p16f627 p16f628 p16f84 p16f873 p16f877?
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+-mpic16
+\begin_inset LatexCommand \index{-mpic16}
-\backslash
-/
\end_inset
--cyclomatic
-\begin_inset LatexCommand \index{-\/-cyclomatic}
+
+\series default
+ Generate code for the Microchip PIC 16
+\begin_inset LatexCommand \index{PIC16}
\end_inset
+-bit processors (p18f452 and variants.
+ In development, not complete).
+\layout List
+\labelwidthstring 00.00.0000
-\bar under
-
+
+\series bold
+-mtlcs900h
\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}
+ Generate code for the Toshiba TLCS-900H
+\begin_inset LatexCommand \index{TLCS-900H}
\end_inset
-
-\emph default
- see section on Cyclomatic Complexity for more details.
+ processor (Not maintained, not complete).
\layout List
-\labelwidthstring 00.00.0000
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--float-reent
-\begin_inset LatexCommand \index{-\/-float-reent}
+-mxa51
+\begin_inset LatexCommand \index{-mxa51}
\end_inset
-\bar under
-
\series default
-\bar default
- Floating point library is compiled as reentrant
-\begin_inset LatexCommand \index{reentrant}
+ Generate code for the Phillips XA51
+\begin_inset LatexCommand \index{XA51}
\end_inset
-.
- See section Installation for more details.
-\layout List
-\labelwidthstring 00.00.0000
+ processor (Not maintained, not complete).
+\layout Subsection
+Preprocessor Options
+\begin_inset LatexCommand \index{Options preprocessor}
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
-\backslash
-/
+\begin_inset LatexCommand \index{Preprocessor options}
+
\end_inset
--nooverlay
-\begin_inset LatexCommand \index{-\/-nooverlay}
+
+\begin_inset LatexCommand \index{sdcpp (preprocessor)}
\end_inset
-\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
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--main-return
-\begin_inset LatexCommand \index{-\/-main-return}
+-I
+\begin_inset LatexCommand \index{-I}
\end_inset
\series default
- This option can be used when the code generated is called by a monitor
- program.
- The compiler will generate a 'ret' upon return from the 'main'
-\begin_inset LatexCommand \index{main return}
+ The additional location where the pre processor will look for <..h> or
+\begin_inset Quotes eld
+\end_inset
+..h
+\begin_inset Quotes erd
\end_inset
- function.
- The default option is to lock up i.e.
- generate a '
-\family typewriter
-ljmp .
-\family default
-'.
+ files.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+-D
+\begin_inset LatexCommand \index{-D}
-\backslash
-/
\end_inset
--peep-file
-\series default
-
-\begin_inset LatexCommand \index{-\/-peep-file}
-
-\end_inset
- This option can be used to use additional rules to be used by
- the peep hole optimizer.
- See section Peep Hole optimizations for details on how to write these rules.
+\series default
+ Command line definition of macros.
+ Passed to the preprocessor.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+-M
+\begin_inset LatexCommand \index{-M}
-\backslash
-/
\end_inset
--no-peep
-\begin_inset LatexCommand \index{-\/-no-peep}
-\end_inset
+\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
-\series default
- Disable peep-hole optimization.
+'.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--peep-asm
-\begin_inset LatexCommand \index{-\/-peep-asm}
+-C
+\begin_inset LatexCommand \index{-C}
\end_inset
\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
-
- rules defined in the source file tree '/peeph.def' before using
- this option.
+ Tell the preprocessor not to discard comments.
+ Used with the `-E' option.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
+-MM
+\begin_inset LatexCommand \index{-MM}
-\backslash
-/
\end_inset
--nostdincl
-\begin_inset LatexCommand \index{-\/-nostdincl}
+\size large
+\bar under
+
+\series default
+\size default
+\bar default
+Like `-M' but the output mentions only the user header files included with
+ `#include
+\begin_inset Quotes eld
\end_inset
-
-\series default
- This will prevent the compiler from passing on the default include path
- to the preprocessor.
+file"'.
+ System header files included with `#include ' are omitted.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--nostdlib
-\begin_inset LatexCommand \index{-\/-nostdlib}
+-Aquestion(answer)
+\begin_inset LatexCommand \index{-Aquestion(answer)}
\end_inset
\series default
- This will prevent the compiler from passing on the default library
-\begin_inset LatexCommand \index{Libraries}
-
-\end_inset
-
- path to the linker.
+ Assert the answer answer for question, in case it is tested with a preprocessor
+ conditional such as `#if #question(answer)'.
+ `-A-' disables the standard assertions that normally describe the target
+ machine.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--verbose
-\begin_inset LatexCommand \index{-\/-verbose}
+-Umacro
+\begin_inset LatexCommand \index{-Umacro}
\end_inset
\series default
- Shows the various actions the compiler is performing.
+ Undefine macro macro.
+ `-U' options are evaluated after all `-D' options, but before any `-include'
+ and `-imacros' options.
\layout List
\labelwidthstring 00.00.0000
\series bold
--V
-\begin_inset LatexCommand \index{-V}
+-dM
+\begin_inset LatexCommand \index{-dM}
\end_inset
\series default
- Shows the actual commands the compiler is executing.
+ Tell the preprocessor to output only a list of the macro definitions that
+ are in effect at the end of preprocessing.
+ Used with the `-E' option.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--no-c-code-in-asm
-\begin_inset LatexCommand \index{-\/-no-c-code-in-asm}
+-dD
+\begin_inset LatexCommand \index{-dD}
\end_inset
\series default
- Hides your ugly and inefficient c-code from the asm file, so you can always
- blame the compiler :).
+ Tell the preprocessor to pass all macro definitions into the output, in
+ their proper sequence in the rest of the output.
\layout List
\labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
-
-\layout Standard
-
-\backslash
-/
-\end_inset
-
--i-code-in-asm
-\begin_inset LatexCommand \index{-\/-i-code-in-asm}
+-dN
+\begin_inset LatexCommand \index{-dN}
\end_inset
+\size large
+\bar under
+
\series default
- Include i-codes in the asm file.
- Sounds like noise but is most helpful for debugging the compiler itself.
+\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
+\added_space_bottom bigskip \labelwidthstring 00.00.0000
\series bold
--
-\begin_inset ERT
-status Collapsed
+-Wp\SpecialChar ~
+preprocessorOption[,preprocessorOption]
+\series default
-\layout Standard
+\begin_inset LatexCommand \index{-Wp preprocessorOption[,preprocessorOption]}
-\backslash
-/
\end_inset
--less-pedantic
-\begin_inset LatexCommand \index{-\/-less-pedantic}
+...
+ Pass the preprocessorOption to the preprocessor
+\family typewriter
+sdcpp
+\family default
+
+\begin_inset LatexCommand \index{sdcpp (preprocessor)}
\end_inset
+.
+ 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)}
-\series default
- Disable some of the more pedantic warnings (jwk burps: please be more specific
- here, please!)
-\layout List
-\labelwidthstring 00.00.0000
+\end_inset
+ (
+\emph on
+gcc
+\emph default
+
+\begin_inset LatexCommand \url{http://gcc.gnu.org/}
-\series bold
--
-\begin_inset ERT
-status Collapsed
+\end_inset
-\layout Standard
+), 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/}
-\backslash
-/
\end_inset
--print-search-dirs
-\begin_inset LatexCommand \index{-\/-print-search-dirs}
+.
+\layout Subsection
+
+Linker Options
+\begin_inset LatexCommand \index{Options linker}
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{Linker options}
\end_inset
-\series default
- Display the directories in the compiler's search path
\layout List
\labelwidthstring 00.00.0000
\series bold
+-L\SpecialChar ~
-
+\series default
+
\begin_inset ERT
status Collapsed
@@ -6374,15 +6204,31 @@ status Collapsed
/
\end_inset
--vc
-\begin_inset LatexCommand \index{-\/-vc}
+
+\series bold
+-lib-path
+\begin_inset LatexCommand \index{-\/-lib-path }
+
+\end_inset
+
+
+\begin_inset LatexCommand \index{-L -\/-lib-path}
\end_inset
\series default
- Display errors and warnings using MSVC style, so you can use SDCC with
- visual studio.
+\SpecialChar ~
+ This option is passed to the linkage
+ editor's additional libraries
+\begin_inset LatexCommand \index{Libraries}
+
+\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
@@ -6398,39 +6244,41 @@ status Collapsed
/
\end_inset
--use-stdout
-\begin_inset LatexCommand \index{-\/-use-stdout}
-
-\end_inset
+-xram-loc
+\series default
+\begin_inset LatexCommand \index{-\/-xram-loc }
-\series default
- Send errors and warnings to stdout instead of stderr.
-\layout Subsubsection
+\end_inset
-Intermediate Dump Options
-\begin_inset LatexCommand \index{Options intermediate dump}
+\SpecialChar ~
+ The start location of the external ram
+\begin_inset LatexCommand \index{xdata (mcs51, ds390 storage class)}
\end_inset
+, default value is 0.
+ The value entered can be in Hexadecimal or Decimal format, e.g.: -
+\begin_inset ERT
+status Collapsed
-\begin_inset LatexCommand \index{Intermediate dump options}
+\layout Standard
+\backslash
+/
\end_inset
+-xram-loc 0x8000 or -
+\begin_inset ERT
+status Collapsed
\layout Standard
-The following options are provided for the purpose of retargetting and debugging
- the compiler.
- These provided a means to dump the intermediate code (iCode
-\begin_inset LatexCommand \index{iCode}
-
+\backslash
+/
\end_inset
-) generated by the compiler in human readable form at various stages of
- the compilation process.
-
+-xram-loc 32768.
\layout List
\labelwidthstring 00.00.0000
@@ -6446,33 +6294,27 @@ status Collapsed
/
\end_inset
--dumpraw
-\begin_inset LatexCommand \index{-\/-dumpraw}
+-code-loc
+\series default
-\end_inset
+\begin_inset LatexCommand \index{-\/-code-loc }
+\end_inset
-\series default
- This option will cause the compiler to dump the intermediate code into
- a file of named
-\emph on
-