SDCC - Small Device C Compiler
SDCC - Small Device C Compiler
SDCC - Small Device C Compiler
2014-03-17
Snapshots
Linux
Windows
Mac OS X
Documentation
Source
Regression
T ests
Download CSV
Differences
Documentation
SDCC Manual (pdf)
SDCC at
SourceForge
SDCC File Releases
SDCC Subversion
Repository
SDCC Forum
SDCC Wiki
Links and More!
SDCC Metrics by
Ohloh
What is SDCC?
SDCC is a retargettable, optimizing ANSI - C compiler suite that targets the Intel MCS51 based
microprocessors (8031, 8032, 8051, 8052, etc.), Maxim (formerly Dallas) DS80C390 variants, Freescale
(formerly Motorola) HC08 based (hc08, s08) and Zilog Z80 based MCUs (z80, z180, gbz80, Rabbit
2000/3000, Rabbit 3000A). Work is in progress on supporting the Microchip PIC16 and PIC18 targets. It can
be retargeted for other microprocessors.
SDCC suite is a collection of several components derived from different sources with different FOSS licenses.
SDCC compiler suite include:
sdas and sdld, a retargettable assembler and linker, based on ASXXXX, written by Alan Baldwin; (GPL).
sdcpp preprocessor, based on GCC cpp; (GPL).
ucsim simulators, originally written by Daniel Drotos; (GPL).
sdcdb source level debugger, originally written by Sandeep Dutta; (GPL).
sdbinutils library archive utilities, including sdar, sdranlib and sdnm, derived from GNU Binutils; (GPL)
SDCC run-time libraries; (GPL+LE). Pic device libraries and header files are derived from Microchip header
(.inc) and linker script (.lkr) files. Microchip requires that "The header files should state that they are only
to be used with authentic Microchip devices" which makes them incompatible with the GPL.
gcc-test regression tests, derived from gcc-testsuite; (no license explicitely specified, but since it is a
part of GCC is probably GPL licensed)
packihx; (public domain)
makebin; (zlib/libpng License)
sdcc C compiler, originally written by Sandeep Dutta; (GPL). Some of the features include:
extensive MCU specific language extensions, allowing effective use of the underlying hardware.
a host of standard optimizations such as global sub expression elimination, loop optimizations (loop
invariant, strength reduction of induction variables and loop reversing), constant folding and
propagation, copy propagation, dead code elimination and jump tables for 'switch' statements.
MCU specific optimizations, including a global register allocator.
adaptable MCU specific backend that should be well suited for other 8 bit MCUs
independent rule based peep hole optimizer.
a full range of data types: char (8 bits, 1 byte), short (16 bits, 2 bytes), int (16 bits, 2 bytes), long
(32 bit, 4 bytes), float (4 byte IEEE) and _Bool/bool;
basic (no integer constants) support for long long (64 bit, 8 bytes) data types for the z80, z180,
r2k, r3ka, gbz80, hc08 and s08 targets.
the ability to add inline assembler code anywhere in a function.
the ability to report on the complexity of a function to help decide what should be re-written in
assembler.
a good selection of automated regression tests.
SDCC was written by Sandeep Dutta and released under a GPL license. Since its initial release there have been
numerous bug fixes and improvements. As of December 1999, the code was moved to SourceForge where all the
"users turned developers" can access the same source tree. SDCC is constantly being updated with all the users'
and developers' input.
News
May 20th, 2013: Small Device C Compiler 3.3.0 released.
A new release of SDCC, the portable optimizing compiler for 8051, DS390, Z80, Z180, Rabbit 2000, HC08 and PIC
microprocessors is now available (http://sdcc.sourceforge.net). Sources, documentation and binaries compiled for
x86 Linux, x86 and x64 MS Windows and x86 and PPC Mac OS X are available.
SDCC 3.3.0 Feature List:
Many small improvements in code generation for the z80-related ports - merged smallopts branch
lospre (currently enabled for z80-related and hc08-related ports only) - merged lospre branch
More efficient initialization of globals in z80, z180, r2k and r3ka ports.
Inclusion of tests from the gcc test suite into the sdcc regression test suite led to many bugs being found
and fixed.
Split sdas390 from sdas8051
Merged big parts of ASxxxx v5 into sdas
New pic devices (synchronization with MPLABX 1.60). (Except for very old MCU-s.)
New script which disassembles those hex files, in which MCS51 code there is. (mcs51-disasm.pl)
Added the PIC16F1788 and PIC16F1789 devices.
C11 _Alignof operator.
C11 _Alignas alignment specifier.
C11 _Static_Assert static assertion.
Numerous feature requests and bug fixes are included as well.
You can download the release from:
https://sourceforge.net/projects/sdcc/files/
1/3
2014-03-17
SDCC compiles natively on Linux and Mac OS X using gcc. Windows release and snapshot builds are made by
cross compiling to mingw32 on a Linux host.
Windows 9x/NT/2000/XP/Vista/7/8 users are recommended to use Cygwin
(http://sources.redhat.com/cygwin/) or may try the unsupported Microsoft Visual C++ build scripts.
Downloading SDCC
See the Sourceforge download page for the last released version including source and binary packages for Linux x86, Microsoft Windows - x86, Microsoft Windows - x86_64 and Mac OS X - ppc and i386.
Major Linux distributions take care of SDCC installation packages themselves and you will find SDCC in their
repositories. Unfortunately SDCC packages included in Linux disributions are often outdated. In this case users are
encouraged to compile the latest official SDCC release or a recent snapshot build by themselves or download the
pre-compiled binaries from Sourceforge download page.
SDCC is known to compile from the source code also on the following platforms:
Linux - x86_64
Linux - Alpha
Linux - IBM Power5
NetBSD - i386
NetBSD - Sparc64
FreeBSD - i386
SUN Solaris - i386
SUN Solaris - Sparc
Rasbian (Debian for Raspberry Pi) - ARMv6
SDCC is always under active development. Please consider downloading one of the snapshot builds if you have run
across a bug, or if the above release is more than two months old.
The latest development source code can be accessed using Subversion. The following will fetch the latest
sources:
svn checkout svn://svn.code.sf.net/p/sdcc/code/trunk/sdcc sdcc
... will create the sdcc directory in your current directory and place all downloaded code there. You can browse
the Subversion repository here.
Before reporting a bug, please check your SDCC version and build date using the -v option, and be sure to include
the full version string in your bug report. For example:
sdcc/bin > sdcc -v
SDCC : mcs51/gbz80/z80/avr/ds390/pic14/TININative/xa51 2.3.8 (Feb 10 2004) (UNIX)
Who is SDCC?
Sandeep Dutta <sandeep.AT.users.sourceforge.net> - original author (SDCC's version of Torvalds)
Jean Loius-VERN <jlvern.AT.writeme.com> - substantial improvement in the back-end code generation.
Daniel Drotos <drdani.AT.mazsola.iit.uni-miskolc.hu> - Freeware simulator for 8051.
Kevin Vigor <kevin.AT.vigor.nu> - numerous enhancements and bug fixes to the Dallas ds390 tree.
Johan Knol <johan.knol.AT.users.sourceforge.net> - testing and patching ds390 tree, bug stompper
extrodanaire
http://sdcc.sourceforge.net/
2/3
2014-03-17
Past news
May 12th, 2013: SDCC 3.3.0 RC3 released.
SDCC 3.3.0 Release Candidate 3 source, doc and binary packages for x86 Linux, 32 bit Windows, 64 bit Windows
and universal Mac OS X are available in corresponding folders at: http://sourceforge.net/projects/sdcc/files/.
May 11th, 2013: SDCC 3.3.0 RC2 released.
SDCC 3.3.0 Release Candidate 2 source, doc and binary packages for x86 Linux, 32 bit Windows, 64 bit Windows
and universal Mac OS X are available in corresponding folders at: http://sourceforge.net/projects/sdcc/files/.
May 5th, 2013: SDCC 3.3.0 RC1 released.
SDCC 3.3.0 Release Candidate 1 source, doc and binary packages for x86 Linux, 32 bit Windows and universal Mac
OS X are available in corresponding folders at: http://sourceforge.net/projects/sdcc/files/.
Previous News
Webmaster
http://sdcc.sourceforge.net/
Last updated:
June 17, 2013 08:43:19.
3/3