Specifications

CAVR-4
Contents
ix
math.h ................................................................................................. 83
stdio.h ................................................................................................. 83
stdlib.h ................................................................................................ 83
printf, scanf and strtod ....................................................................... 84
The CLIB runtime environment .............................................................. 85
Runtime environment .......................................................................... 85
Input and output ..................................................................................... 87
Character-based I/O ........................................................................... 87
Formatters used by printf and sprintf ................................................. 87
Formatters used by scanf and sscanf .................................................. 89
System startup and termination ...................................................... 89
System startup .................................................................................... 89
System termination ............................................................................ 90
Overriding default library modules ................................................ 90
Customizing system initialization ................................................... 90
Implementation of cstartup .............................................................. 90
C-SPY runtime interface .................................................................... 91
The debugger terminal I/O window ................................................... 91
Termination ........................................................................................ 91
Checking module consistency ........................................................... 91
Assembler language interface ................................................................... 93
Mixing C and assembler ....................................................................... 93
Intrinsic functions .............................................................................. 93
Mixing C and assembler modules ...................................................... 94
Inline assembler ................................................................................ 95
Calling assembler routines from C ................................................. 96
Creating skeleton code ....................................................................... 96
Compiling the code ............................................................................ 97
Calling assembler routines from C++ ............................................ 98
Calling convention .................................................................................. 99
Choosing a calling convention ........................................................... 99
Function declarations ...................................................................... 100
C and C++ linkage ........................................................................... 100