1 <!doctype html public "-//w3c//dtd html 4.0 transitional//en">
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5 <meta name="GENERATOR" content="Mozilla/4.7 [en] (X11; I; Linux 2.2.12-20 i686) [Netscape]">
6 <title>SDCC - Freeware, Optimizing C_Compiler (8051)</title>
12 <br><b><font color="#666666"><font size=+3>SDCC</font></font></b>
14 <p><b><font color="#009900"><font size=+2>Official Home of SDCC</font></font></b></center>
16 <p><b><font size=+1>What is SDCC ?</font></b>
20 <font size=+1><b>SDCC</b> is a<u> </u><b><i><font color="#660000">Free
21 ware , retargettable, optimizing ANSI - C compiler. The</font></i></b>
22 current version targets <b><i><font color="#660000">Intel 8051 </font></i></b>based
23 MCUs, it can be retargeted for other 8 bit MCUs or PICs. The entire
24 source code for the compiler is distributed under GPL. SDCC uses ASXXXX
25 & ASLINK a Free ware, retargettable assembler & linker. SDCC has
26 <b><i><font color="#660000">extensive
27 MCU (8051) specific language extensions, which</font></i></b> lets it utilize
28 the underlying hardware effectively. The front end (parser) will be enhanced
29 to handle language extensions for other MCUs as and when they are targeted.
30 In addition to the MCU Specific optimizations SDCC also does a host of
31 standard optimizations like <b><i><font color="#660000">global sub expression
32 elimination, loop optimizations (loop invariant , strength reduction of
33 induction variables and loop reversing ), constant folding & propagation,
34 copy propagation, dead code elimination and jump tables for 'switch' statements.
35 For</font></i></b> the Back end SDCC uses a <b><i><font color="#660000">global
36 register allocation </font></i></b>scheme which should be well suited for
37 other 8 bit MCUs , the peep hole optimizer uses a rule based substitution
38 mechanism which is MCU independent. Supported data types are <b><i><font color="#660000">short
39 (8</font></i></b> bits, 1 byte), <b><i><font color="#660000">char (8</font></i></b>
40 bits, 1 byte) , int (16 bits, 2 bytes ), <b><i><font color="#660000">long
41 (32</font></i></b> bit, 4 bytes) & <b><i><font color="#660000">float
42 (4</font></i></b> byte IEEE). SDCC also comes with a <b><i>source
43 level debugger</i> SDCDB</b>, the current version of the debugger uses
44 Daniel's s51 simulator. The compiler also allows <b><i><font color="#660000">inline
45 assembler code</font></i></b> to be embedded anywhere in a function. In
46 addition routines developed in assembly can also be called. SDCC also provides
47 an option to report the relative complexity of a function, these functions
48 can then be further optimized , or hand coded in assembly if need be.</font></dt>
53 <hr WIDTH="100%"></dt>
55 <br><b><font size=+1>Download [Sun Jan 16 12:08:15 CST 2000]</font></b>
57 <dl><font size=+1>To compile SDCC, <b><i><font color="#993300">Linux (
58 and other Unix )</font> </i></b>users will need to install <i>gcc</i> or
59 any other <i>C</i> compiler. Windows 95/NT users will need to download
60 the <i>full</i> development version of CYGWIN32 from <b><a href="http://sourceware.cygnus.com/cygwin/">http://sourceware.cygnus.com/cygwin/
62 Note that <b>cygnus</b> distributes CYGWIN32 in two packages you will need
63 the <i>full development</i> package, this contains the compiler and other
64 utilities that you will need to compile SDCC, I have not tried compiling
65 the system with any other compiler under MS/Windows.</font>
66 <p><font size=+1>Version 2.1.8 onwards will be distributed in *.tar.gz
67 format, the installation procedure will also change. Installation section
68 of the documentation has been updated to include the new procedure.
69 Click here to download </font><b><font size=+2><a href="ftp://sdcc.sourceforge.net/pub/sdcc/sdcc-2.1.9Ga.tar.gz">sdcc-2.1.9Ga.tar.gz
70 </a></font></b><font size=+1> in
71 the new distribution format. This distribution also contains Daniel's simulator
73 <p><font size=+1><a href="http://www.kd0yu.com">Vote for the next target
75 <p><font size=+1>Having trouble downloading ? Here are some alternate site.</font>
80 <b><font size=+1><a href="http://web.kd0yu.com/sdcc/">http://web.kd0yu.com/sdcc/
81 </a></font></b><font size=-1>provided
82 by dave@kd0yu.com</font></li>
85 <b><font size=+1><a href="http://www.ozemail.com.au/~bkk/sdcc">http://www.ozemail.com.au/~bkk/sdcc
86 </a></font></b><font size=-1>provided
87 by ben knight bkk@ozemail.com.au></font></li>
90 <font size=+1>Two sites </font><font size=-1>provided by irk Verwiebe dirk@verwiebe.de></font></li>
92 <br><font size=+1>Binaries on: <b><a href="http://members.aol.com/sdccwin/pub">http://members.aol.com/sdccwin/pub</a></b></font>
93 <br><font size=+1>Sources on: <b><a href="http://members.aol.com/sdccsrc/pub">http://members.aol.com/sdccsrc/pub</a></b></font></ul>
96 Looking for Sample code ? Have some code developed for SDCC you want to
98 <b><font size=+1><a href="http://42.fht-esslingen.de/SDCC_OKR/">Click
99 here for the SDCC "Open Knowledge" website</a></font></b>
101 <p><b><font size=+2><a href="ftp://sdcc.sourceforge.net/pub/sdcc/sdcc-2.1.9Gawinbin.tar.gz">Binary distribution
102 of Version 2.1.9Ga </a></font></b><font size=+1>for Windows is available
103 . The distribution is compiled to run from the directory /usr/local. Gunzip
104 & untar the binary distribution at the root (/) directory of the partition/drive
105 you want to install the software on. The source distribution of this version
106 compiles with CYGWIN. <b><a href="cygwininst.txt">Click here to view more
107 detailed installation</a></b> instructions for Win95/NT (provided by Michael
108 Jamet mjamet@computer.org).</font>
109 <p><font size=+1>A binary distribution of the package for DOS can be <b><a href="http://www.geocities.com/SiliconValley/Vista/6552/sdcc.html">downloaded
110 from SET's page.</a></b></font>
111 <p><font size=+2>Michael Hope <michaelh@earthling.net> is working on
112 a Z80 target ,a snapshot of which can be downloaded by <b><a href="http://earthling.net.nz/~michaelh/snapshots/">clicking
114 <p>The debugger works the DDD (Data Display debugger), Terry Porter <tp@gronk.apana.org.au>
115 has a screenshot and a brief HOWTO at <a href=http://www.odyssey.apana.org.au/~tjporter/ddd_sdcc.gif> http://www.odyssey.apana.org.au/~tjporter/ddd_sdcc.gif </a>
116 <p>An alternate simulator & source level debugger can be downloaded
117 from Jens Altmann's JSIM page <b><a href="http://home.t-online.de/home/Jens.Altmann/jsim-e.htm">http://home.t-online.de/home/Jens.Altmann/jsim-e.htm</a></b>
119 <p><font size=+1>Older versions can be <b><a href="http://nipkow.cs.abo.fi">downloaded
120 from Marcus Alanen's Page.</a></b></font>
121 <p><!-- Begin ListBot Code --><form method="post" action="http://www.listbot.com/cgi-bin/subscriber">
124 <td COLSPAN="2"><font size=+2>Join our mailing list! Enter your email address
125 below, then click the 'Join List' button:</font></td>
129 <td><input type=text name="e_mail"><input type=hidden name="list_id" value="sdcc"><input type=hidden name="Act" value="subscribe_list"></td>
131 <td><input type=image src="http://www.listbot.com/subscribe_button.gif" border=0 width=88 height=31 alt="Click here to join our mailing list!"></td>
135 <td COLSPAN="2"><font face="arial"><font size=-2><a href="http://www.listbot.com/" target="_top">Powered
136 by ListBot</a></font></font></td>
139 </form><!-- End ListBot Code -->
140 <p><font size=+1>You can </font><b><font size=+2><a href="http://sdcc.listbot.com">view
141 the archive</a> </font></b><font size=+1>of messages posted to the mailing
142 list (poor man's FAQ).</font>
143 <p><font size=+1><b><a href="http://www.insidetheweb.com/mbs.cgi/mb576992">Click
144 here for SDCC Message Board </a></b>, maintained by <a href="mailto:ratzefumm@gmx.net">Alex
145 Ratzefumm <ratzefumm@gmx.net> .</a></font>
147 <hr WIDTH="100%"></dl>
148 <b><font size=+1>Documentation</font></b>
152 <b><i><font size=+2>SDCC User Guide :</font></i></b></dt>
156 <b><i><font size=+2> <a href="SDCCUdoc.html">HTML Format (included
157 with Source bundle)</a></font></i></b></li>
160 <b><i><font size=+2><a href="SDCCUdoc.ps">PostScript Format (Not included
161 with Source Bundle)</a></font></i></b></li>
164 <b><i><font size=+2><a href="SDCCUdoc.txt">Plain Text Format. (Not included
165 with source bundle)</a></font></i></b></li>
174 <hr WIDTH="100%"></dt>
179 <b><font size=+1>Known Problems</font></b>
183 <font color="#CC0000"><font size=+1>MS/Windows Users note that due to some
184 bugs in the CYGWIN runtime library the compiler generated temporary files
185 are NOT cleared from the </font><b><font size=+2>/tmp </font></b><font size=+1>directory,
186 these have to be manually deleted.</font></font></li>
189 <font color="#CC0000"><font size=+1>--xstack options not yet fully implemented.</font></font></li>
192 <font color="#CC0000"><font size=+1>first storage class specified overrides
193 in declarations . e.g.,</font></font></li>
195 <dl><font color="#CC0000"><font size=+1>short xdata x, idata y.</font></font></dl>
196 <font color="#CC0000"><font size=+1>will declare both x & y in xdata
197 space. The work around for this is to declare variables with different
198 storage classes separately e.g..</font></font>
199 <dl><font color="#CC0000"><font size=+1>xdata short x;</font></font>
200 <br><font color="#CC0000"><font size=+1>idata short y;</font></font></dl>
207 <hr WIDTH="100%"></dt>
214 <b><font size=+1>Enhancements & Bugs Fixes.</font></b></dt>
217 <dl><font color="#330000"><font size=+1>Click</font><b><font size=+2><a href="SDCCBugsFixed.html">
218 here </a></font></b><font size=+1>to see the enhancements and bug fixes
219 done till date.</font></font></dl>
221 <hr WIDTH="100%"></dl>
222 <b><font size=+1>What IDE to use ?</font></b>
224 <dl><font size=+1>I recommend using <b><i><a href="http://www.xemacs.org">XEmacs</a></i></b>,
225 it is free and is also a really GREAT editor. Linux / Unix users can download
226 binaries for their specific platforms from <b><i><a href="ftp://ftp.xemacs.org">ftp://ftp.xemacs.org</a></i></b>
227 . Windows 95/98/NT Users , can download binaries from <b><i><a href="ftp://ftp.xemacs.org/pub/xemacs/binary-kits/win32/">ftp://ftp.xemacs.org/pub/xemacs/binary-kits/win32/</a></i></b></font>
228 <p><font size=+1>The interface files required for the debugger to interact
229 with XEmacs is distributed with the source code.</font></dl>
234 <hr WIDTH="100%"></dl>
235 <b><font size=+1>Reporting Bugs.</font></b></dl>
240 <font size=+1>Click on this </font><b><font size=+2><a href="mailto:sandeep.dutta@usa.net">sandeep.dutta@usa.net</a></font></b><font size=+1>to
241 send me an email, also send an </font><b><font size=+2><a href="mailto:sdcc@listbot.com">email
242 to the mailing list</a></font></b><font size=+1> for the benefit of other
243 users .Bugs will be fixed according to their severity. I will update the
244 Known Problems section. The compiler alone without the assembler , linker,
245 Preprocessor & garbage collector is about 40,000 lines of blank skipped
246 code, as with any project of this size there are bound to be bugs, I will
247 try me level best to fix them as quickly as I can . If you can trace the
248 bug and fix it, please do so, do send me a copy of the fixed source
249 code so I can update my copy.</font></dt>
253 <hr WIDTH="100%"></dt>
260 <b><font size=+1>Things we are working on .</font></b></dt>
264 <font size=+1>More optimizations.</font></li>
267 <font size=+1>Retargeting to for ATMEL AVR (8 bit RISC MCUs).</font></li>
275 <hr WIDTH="100%"></dt>
282 <b><font size=+1>Notes for Users of Version 1.xx</font></b></dt>
286 <font size=+1>For the benefit of users of the previous Version, I
287 have kept the parser almost identical, I have added a few features, but
288 the programs developed using the first version should compile without change
289 with the new version. The command line options however have changed, the
290 compiler will generate a warning when it encounters an older option and
291 prompt you with the new option.</font></dt>
294 <font size=+1>Version 2.xx is a almost a complete rewrite, it is much more
295 stable and ANSI Compliant than the previous version.</font></dt>
299 <hr WIDTH="100%"></dt>
306 <b><font size=+1>Links</font></b></dt>
310 <font size=+1>Here are some links I found useful.</font></dt>
314 <font size=+1>Daniel Drotos has a <a href="http://mazsola.iit.uni-miskolc.hu/~drdani/embedded/s51/">Freeware
315 simulator for MCS51.</a> This simulator is distributed with the compiler
316 . I found this simulator very very useful (MUST HAVE).</font></li>
319 <font size=+1>J<a href="http://www.caseconsole.com/mcb152">oachim Elen
320 has a 8051 Micro controller board </a>with Packet Radio interface .</font></li>
323 <font size=+1><a href="http://www.goofee.com/goofee.htm">Goofee </a>is
324 a very interesting visual programming environment. The software used to
325 be free now you have to buy his book, but worth taking a look.</font></li>
328 <font size=+1><a href="http://www.8052.com">www.8052.com</a> is a great
329 site for 8051 programmers.</font></li>
332 <font size=+1><a href="http://welcome.to/obukhov">Dimitry Obukhov</a> has
333 some useful routines in C, for I</font><sup>2</sup><font size=+1>C
334 and other stuff. His malloc & serial I/O routines are included with
335 the compiler.</font></li>
338 <font size=+1><a href="http://ourworld.compuserve.com/homepages/jhartman">John
339 Hartman </a>sells NoICE, an emulator. He also created ASXXXX & ASLINK
340 for 8051. SDCC will eventually support NoICE.</font></li>
343 <font size=+1><a href="http://www.pagesz.net/~thyphoon">Tayfun</a> sells
344 a Single Board Computer based on Phillips 80C552.</font></li>
351 <hr WIDTH="100%"></dl>
354 <b><font size=+1>Acknowledgments.</font></b></dt>
359 <font size=+1><a href="mailto:baldwin@shop-pdp.kent.edu">Alan Baldwin (baldwin@shop-pdp.kent.edu)
361 Initial version of ASXXXX and ASLINK.</font></li>
364 <font size=+1>J<a href="jhartman@compuserve.com">ohn Hartman (jhartman@compuserve.com)
366 Porting ASXXX and ASLINK for 8051.</font></li>
369 <font size=+1><a href="mailto:dso@usa.net">Dmitry S. Obukhov (dso@usa.net)</a>
370 - malloc and serial I/O routines.</font></li>
373 <font size=+1><a href="boehm@sgi.com">Jans J Boehm(boehm@sgi.com)</a> and
374 Alan J Demers - Conservative garbage collector for C & C++.</font></li>
377 <font size=+1><a href="mailto:jlvern@writeme.com">Jean Loius-VERN (jlvern@writeme.com></a>
378 - substantial improvement in the back-end code generation.</font></li>
381 <font size=+1><a href="mailto:drdani@mazsola.iit.uni-miskolc.hu">Daniel
382 Drotos <drdani@mazsola.iit.uni-miskolc.hu> </a>- Free ware simulator
383 for 8051.</font></li>
386 <font size=+1><a href="mailto:malini_dutta@hotmail.com">Malini Dutta(malini@mediaone.net)</a>
387 - my wife for her patience and support.</font></li>
390 <font size=+1>Unknown - for the GNU C - preprocessor.</font></li>
395 <center>This page has been accessed <img SRC="/cgi-bin/counter" > times since
396 March 6th 1999</center>