- stdarg.h - contains definition for the following macros to be used for
variable parameter list, note that a function can have a variable parameter
list if and only if it is 'reentrant'
va_list, va_start, va_arg, va_end.
- setjmp.h - contains defintion for ANSI setjmp & longjmp routines. Note
in this case setjmp & longjmp can be used between functions executing within
the same register bank, if long jmp is executed from a function that is using
a different register bank from the function issuing the setjmp function, the
results may be unpredictable. The jump buffer requires 3 bytes of data (the
stack pointer & a 16 byte return address), and can be placed in any address
- stdlib.h - contains the following functions.
- string.h - contains the following functions.
strcpy, strncpy, strcat, strncat, strcmp, strncmp, strchr, strrchr, strspn,
strcspn, strpbrk, strstr, strlen, strtok, memcpy, memcmp, memset.
- ctype.h - contains the following routines.
iscntrl, isdigit, isgraph, islower, isupper, isprint, ispunct, isspace,
isxdigit, isalnum, isalpha.
- malloc.h - The malloc routines are developed by Dmitry S. Obukhov (firstname.lastname@example.org).
These routines will allocate memory from the external ram. Here is a description
on how to use them (as described by the author).
// #define DYNAMIC_MEMORY_SIZE 0x2000
// unsigned char xdata dynamic_memory_pool[DYNAMIC_MEMORY_SIZE];
// unsigned char xdata * current_buffer;
// void main(void)
//Now it's possible to use malloc.
- serial.h - Serial IO routines are also developed by Dmitry S. Obukhov (email@example.com).
These routines are interrupt driven with a 256 byte circular buffer, they also
expect external ram to be present. Please see documentation in file SDCCDIR/sdcc51lib/serial.c
. Note the header file "serial.h" MUST be included in the file containing the
- ser.h - Alternate serial routine provided by Wolfgang Esslinger <wolfgang@WiredMinds.com>
these routines are more compact and faster. Please see documentation in file
- ser_ir.h - Another alternate set of serial routines provided by Josef Wolf
<firstname.lastname@example.org> , these routines do not use the external ram.
- reg51.h - contains register definitions for a standard 8051
- reg552.h - contains register definitions for 80C552.
- float.h - contains min, max and other floating point related stuff.
All library routines are compiled as --model-small , they are all non-reentrant,
if you plan to use the large model or want to make these routines reentrant,
then they will have to be recompiled with the appropriate compiler option.
Have not had time to do the more involved routines like printf, will get
to them shortly.