next up previous contents index
Next: 3.16.3 Math functions (sin, Up: 3.16 Library Routines Previous: 3.16.1 Compiler support routines   Contents   Index

Subsections

3.16.2 Stdclib functions (puts, printf, strcat etc.)

3.16.2.1 <stdio.h>

As usual on embedded systems you have to provide your own getchar() and putchar() routines. SDCC does not know whether the system connects to a serial line with or without handshake, LCD, keyboard or other device. You'll find examples for serial routines f.e. in sdcc/device/lib.

If you're short on memory you might want to use printf_small() instead of printf(). For the mcs51 there is an assembly version printf_fast() which should fit the requirements of many embedded systems (by unsetting #defines it can be customized to not support long variables and field widths).



Bernhard Held 2004-02-21