
3-16
C Cross Compiler
The library functions are grouped into the following categories:
String functions (
string.h
)
bcmp
,
bcopy
,
bzero
,
index
,
memchr
,
memcmp
,
memcpy
,
memmove
,
memset
,
rindex
,
strcat
,
strchr
,
strcmp
,
strcpy
,
strcspn
,
strlen
,
strncat
,
strncmp
,
strncpy
,
strpbrk
,
strrchr
,
strspn
,
strstr
,
strtok
.
I/O functions (
stdio.h
)
fopen, fclose, fwrite, fread, fgetc, fputc, fprintf,
printf, sprintf, vfprintf, vprintf, vsprintf, getc, putc,
getchar, putchar
The
fprintf
and
printf
functions have been extended to allow
printing of the
q15
data type. A “
%q
” format specifier will print a 16-bit
value in fixed-point notation.
The filehandles
stdin
,
stdout
, and
stderr
are available for use with
fwrite
,
fread
,
fgetc
,
fputc
, and
fprintf
.
Memory allocation functions (
stdlib.h
)
malloc, free, mbtowc
Interprocedural control flow functions (
setjmp.h
)
setjmp, longjmp
In the case of I/O functions, the SDK performs file I/O by sending a
message to the program running on the host (sdbug400, zsim400,
zisim400, zdbug, zdxbug, zsimg2 or zisimg2). These messages will
cause the host program to perform the requested file I/O operation. All
host programs and all zdbug targets support file I/O.
3.5 N-Intrinsics
SDCC N-Intrinsics provide support for DSP instructions. N-Intrinsics are
implemented as macros in the header file
N_Intrinsic.h
. The name
of an N-Intrinsic begins with an
N_
, followed by a suffix that indicates the
operation’s data type:
_s
for
int
,
_l
for
long
, and
_h
for high-order
int
of a
long
.