SDCC: Difference between revisions
RafaelOrtiz (talk | contribs) m (→SDCDB) |
RafaelOrtiz (talk | contribs) mNo edit summary |
||
Line 1: | Line 1: | ||
SDCC is a small Device C Compiler that was specifically designed to the needs of 8 Bit Micros like Intel 8051, Maxim 80DS390, Zilog Z80 among others. |
SDCC is a small Device C Compiler that was specifically designed to the needs of 8 Bit Micros like Intel [http://en.wikipedia.org/wiki/Intel_8051 8051], Maxim 80DS390, Zilog Z80 among others. |
||
SDCC comes with SDCDB a source level debugger and ucSim a free open source simulator for Intel 8051 and other micro-controllers |
SDCC comes with SDCDB a source level debugger and ucSim a free open source simulator for Intel 8051 and other micro-controllers |
||
Revision as of 05:56, 1 June 2007
SDCC is a small Device C Compiler that was specifically designed to the needs of 8 Bit Micros like Intel 8051, Maxim 80DS390, Zilog Z80 among others. SDCC comes with SDCDB a source level debugger and ucSim a free open source simulator for Intel 8051 and other micro-controllers
Installation
Debian
apt-get install sdcc
Working with SDCC
Compiling a program
Write this in an ASCII editor and call the archive test.c (Or wathever name you want):
char test; void main(void) { test=0; }
Then:
sdcc -c test.c
The -c option is for disable the linker, the next step is trying without the linker:
sdcc test.c
Final test, modify the test file and include the following (if all goes without warnings SDCC is well instaled):
#include <string.h> char str1[10]; void main(void) { strcpy(str1, "testing"); }
this is needed to test that SDCC supports libraries.
SDCDB
Compilling for Debugging
--debug When this option is used the compiler will generate debug information. The debug information collected in a file with .cdb extension can be used with the SDCDB. Another file with no extension contains debug information in AOMF or AOMF51 format which is commonly used by third party tools.