SDCC

Official Home of SDCC

What is SDCC ?

SDCC is a Free ware , retargettable, optimizing ANSI - C compiler. The current version targets Intel 8051 based MCUs, it can be retargeted for other 8 bit MCUs or PICs. The  entire source code for the compiler is distributed under GPL. SDCC uses ASXXXX & ASLINK a Free ware, retargettable assembler & linker. SDCC has extensive MCU (8051) specific language extensions, which lets it utilize the underlying hardware effectively. The front end (parser) will be enhanced to handle language extensions for other MCUs as and when they are targeted. In addition to the MCU Specific optimizations SDCC also does a host of standard optimizations like global sub expression elimination, loop optimizations (loop invariant , strength reduction of induction variables and loop reversing ), constant folding & propagation, copy propagation, dead code elimination and jump tables for 'switch' statements. For the Back end SDCC uses a global register allocation scheme which should be well suited for other 8 bit MCUs , the peep hole optimizer uses a rule based substitution mechanism which is MCU independent. Supported data types are short (8 bits, 1 byte), char (8 bits, 1 byte) , int (16 bits, 2 bytes ), long (32 bit, 4 bytes) & float (4 byte IEEE).  SDCC also comes with a source level debugger SDCDB, the current version of the debugger uses Daniel's s51 simulator. The compiler also allows inline assembler code to be embedded anywhere in a function. In addition routines developed in assembly can also be called. SDCC also provides an option to report the relative complexity of a function, these functions can then be further optimized , or hand coded in assembly if need be.


Download [Sun Jan 16 12:08:15 CST 2000]
 
To compile SDCC, Linux ( and other Unix ) users will need to install gcc or any other C compiler. Windows 95/NT users will need to download the full development version of CYGWIN32 from http://sourceware.cygnus.com/cygwin/. Note that cygnus distributes CYGWIN32 in two packages you will need the full development package, this contains the compiler and other utilities that you will need to compile SDCC, I have not tried compiling the system with any other compiler under MS/Windows.

Version 2.1.8 onwards will be distributed in *.tar.gz format, the installation procedure will also change. Installation section of the  documentation has been updated to include the new procedure. Click here to download  sdcc-2.1.9Ga.tar.gz in the new distribution format. This distribution also contains Daniel's simulator .

Vote for the next target of SDCC

Having trouble downloading ? Here are some alternate site.

Looking for Sample code ? Have some code developed for SDCC you want to share ? Click here for the SDCC "Open Knowledge" website
 

Binary distribution of Version 2.1.9Ga for Windows is available . The distribution is compiled to run from the directory /usr/local. Gunzip & untar the binary distribution at the root (/) directory of the partition/drive you want to install the software on. The source distribution of this version compiles with CYGWIN. Click here to view more detailed installation instructions for Win95/NT (provided by Michael Jamet mjamet@computer.org).

A binary distribution of the package for DOS can be downloaded from SET's  page.

Michael Hope <michaelh@earthling.net> is working on a Z80 target ,a snapshot of which can be downloaded by clicking here.

The debugger works the DDD (Data Display debugger), Terry Porter <tp@gronk.apana.org.au> has a screenshot and a brief HOWTO at http://www.odyssey.apana.org.au/~tjporter/ddd_sdcc.gif

An alternate simulator & source level debugger can be downloaded from Jens Altmann's JSIM page http://home.t-online.de/home/Jens.Altmann/jsim-e.htm
 

Older versions can be downloaded from Marcus Alanen's Page.

Join our mailing list! Enter your email address below, then click the 'Join List' button:
Powered by ListBot

You can view the archive of messages posted to the mailing list (poor man's FAQ).

Click here for SDCC Message Board , maintained by mailto:ratzefumm@gmx.net


Documentation
 
SDCC User Guide :

Known Problems
  • MS/Windows Users note that due to some bugs in the CYGWIN runtime library the compiler generated temporary files are NOT cleared from the /tmp directory, these have to be manually deleted.
  • --xstack options not yet fully implemented.
  • first storage class specified overrides in declarations . e.g.,
    short xdata x, idata y.
    will declare both x & y in xdata space. The work around for this is to declare variables with different storage classes separately e.g..
    xdata short x;
    idata  short y;

  • Enhancements & Bugs Fixes.
    Click here to see the enhancements and bug fixes done till date.

    What IDE to use ?
     
    I recommend using XEmacs, it is free and is also a really GREAT editor. Linux / Unix users can download binaries for their specific platforms from ftp://ftp.xemacs.org/ .  Windows 95/98/NT Users , can download binaries from ftp://ftp.xemacs.org/pub/xemacs/binary-kits/win32/

    The interface files required for the debugger to interact with XEmacs is distributed with the source code.

     

    Reporting Bugs.
    Click on this sandeep.dutta@usa.netto send me an email, also send an email to the mailing list for the benefit of other users .Bugs will be fixed according to their severity. I will update the Known Problems section. The compiler alone without the assembler , linker, Preprocessor & garbage collector is about 40,000 lines of blank skipped code, as with any project of this size there are bound to be bugs, I will try me level best to fix them as quickly as I can . If you can trace the bug and fix it, please do so, do  send me a copy of the fixed source code so I can update my copy.

    Things we are working on .
  • More optimizations.
  • Retargeting to for ATMEL AVR (8 bit RISC MCUs).

  • Notes for Users of Version 1.xx
    For the benefit of  users of the previous Version, I have kept the parser almost identical, I have added a few features, but the programs developed using the first version should compile without change with the new version. The command line options however have changed, the compiler will generate a warning when it encounters an older option and prompt you with the new option.
    Version 2.xx is a almost a complete rewrite, it is much more stable and ANSI Compliant than the previous version.

    Links
    Here are some links I found useful.
    • Daniel Drotos has a Freeware simulator for MCS51.  This simulator is distributed with the compiler . I found this simulator very very useful (MUST HAVE).
    • Joachim Elen  has a 8051 Micro controller board with Packet Radio interface .
    • Goofee is a very interesting visual programming environment. The software used to be free now you have to buy his book, but worth taking a look.
    • http://www.8052.com/ is a great site for 8051 programmers.
    • Dimitry Obukhov has some useful routines in C, for  I2C  and other stuff. His malloc & serial I/O routines are included with the compiler.
    • John Hartman sells NoICE, an emulator. He also created ASXXXX & ASLINK for 8051. SDCC will eventually support NoICE.
    • Tayfun sells a Single Board Computer based on Phillips 80C552.

    Acknowledgments.
    This page has been accessed  times since March 6th 1999
    1