Merge back from 2.21-pre1
[fw/sdcc] / README
1 Small Device C Compiler (sdcc)
2 ------------------------------
3 A C compiler for the Intel mcs51 series and soon the Z80.
4
5 http://sdcc.sourceforge.net/
6
7 This file is just a stub.  It will get better.
8
9 Almost all of this is by Sandeep Dutta <sandeep.dutta@usa.net>
10 The Z80 port was started by Michael Hope <michaelh@earthling.net>
11
12 Some of the Z80 related files are borrowed from the Gameboy
13 Development Kit (GBDK) originally by Pascal Felber.
14
15 Notes on the z80 port
16 ---------------------
17 The 2.2.1 release finally includes the required libraries and
18 tools to target the z80.  2.2.0a included z80 compiler support
19 but not the assembler, linker, etc.
20
21 Things are still not perfect.  The z80 port is partly wedged in
22 due to the different ports using different base libraries, but most
23 of this is hidden by lcc.  It is reccomended that to compile for
24 the z80 you use:
25
26 lcc -mz80/consolez80 -c -o file.o file.c
27 lcc -mz80/consolez80 -o file.ihx file.o
28
29 etc.
30 lcc is a wrapper for sdcc, the assembler, linker etc.  It has the
31 added advantage that it accepts more of the standard command line
32 options than raw sdcc.
33
34 The -mz80/consolez80 is very important as it selects the libraries
35 to use and which crt0 module to use.  Unfortunatly each target system
36 requires its own startup code (crt0) and definitions for the base
37 of RAM, ROM etc.  Those adventurous enough should get a copy of gbdk-lib,
38 build the appropriate crt0.s, and then manually link the object files
39 together with the appropriate base definitions and the appropriate
40 crt0.o.  Try 
41
42 lcc -mz80/consolez80 -v -o file.ihx file.c
43
44 to see the current liker command line.
45
46 If you succeed, please consider sending Michael Hope a copy of crt0.s
47 and the appropriate base definitions, and he will roll them into the
48 next release of sdcc.
49
50 If you find a bug and really cant wait, download the latest copy of
51 gbdk and use the copy of sdcc from that.
52
53 Notes:
54 ------
55 000123 mlh: You can set the processor type at run time.  Try:
56 sdcc -mz80 blah.c
57 sdcc -mmcs51 blah.c
58
59 The default is the mcs51.
60
61 Roadmap:
62 --------
63 README          - This file
64 COPYING         - GPL v2
65 as/             - Assembler, derrived from asxxxx
66 debugger/
67 device/         - Device libraries and examples
68 doc/            - sdcc and port specific documentation
69 link/           - Linker, also derrived from asxxxx
70 sim/            - Simulator (mcs51 only)
71 src/            - Source to the C compiler and ports
72 support/        - Libraries and apps that may not be provided by your system.
73
74 Most of the port related files are in a subdirectory below the
75 appropriate module.  For example, all compiler z80 related files
76 are in src/z80, all 8051 (mcs51) specific library files are in
77 device/lib/mcs51.
78
79 Links:
80 ------
81
82 * SDCC homepage
83   http://sdcc.sourceforge.net/
84
85 * GBDK homepage
86   http://gbdk.sourceforge.net/
87
88 * SDCC at Geocities (old)
89   http://www.geocities.com/ResearchTriangle/Forum/1353/
90
91 * SDCC mailing list
92   http://lists.sourceforge.net/mailman/listinfo/sdcc-user
93
94
95 * Yahoo! Random link
96   http://random.yahoo.com/bin/ryl