Ansi standard compliance, Freestanding implementation – Zilog EZ80F916 User Manual
Page 184

UM014423-0607
Using the ANSI C-Compiler
ZiLOG Developer Studio II
eZ80Acclaim!
®
User Manual
164
.\LedTimer.obj, \
.\main.obj, \
.\zsldevinit.obj, \
C:\PROGRA~1\ZiLOG\ZDSII_~1.1\lib\std\chelpD.lib, \
C:\PROGRA~1\ZiLOG\ZDSII_~1.1\lib\std\crtD.lib, \
C:\PROGRA~1\ZiLOG\ZDSII_~1.1\lib\std\fplibD.obj, \
C:\PROGRA~1\ZiLOG\ZDSII_~1.1\lib\zilog\gpioD.lib, \
C:\PROGRA~1\ZiLOG\ZDSII_~1.1\lib\zilog\uartF91simD.lib
This final command shows that, in this example, the linker output file is named
ledDemo.lod
. The source object files (
Buttons.obj
,
LedMatrix.obj
,
LedTimer.obj
, and
main.obj
) are to be linked with the other modules that are required
to make a complete executable load file. In this case, those other modules are the C startup
module and related initialization modules (
cstartup.obj
,
vectors24.obj
,
init_params_f91.obj
, and
zsldevinit.obj
), the C helper library with debug
(
chelpld.lib
), the C run-time library with debug (
crtD.lib
), the floating-point
library with debug (
fplibD.lib
), and the relevant ZSL libraries (
gpioD.lib
and
uartF91simD.lib
).
An important point to understand in using the linker is that if you use the ZiLOG default
version of the C run-time library, the linker will link in only those functions that are actu-
ally called in your program. This is because the ZiLOG default library is organized with
only one function (or in a few cases, a few closely related functions) in each module.
Although the C run-time library contains a very large number of functions from the C
standard library, if your application only calls two of those functions, then only those two
are linked into your application (plus any functions that are called by those two functions
in turn). This means it is safe for you to simply link in a large library, like chelpLD.lib,
crtLD.lib
, and
fpLD.lib
in this example. You do not have to worry about any unnec-
essary code being linked in and do not have to do the extra work of painstakingly finding
the unresolved symbols for yourself and linking only to those specific functions. See the
discussion of “Use Default Libraries” on page 87 for a further discussion of this area.
ANSI STANDARD COMPLIANCE
The ZiLOG eZ80Acclaim! C-Compiler is a freestanding ANSI C compiler complying
with the 1989 ISO standard, which is also known as ANSI Standard X3.159-1989, with
some deviations that are described in “Deviations from ANSI C” on page 165.
Freestanding Implementation
A “freestanding” implementation of the C language is a concept defined in the ANSI stan-
dard itself, to accommodate the needs of embedded applications that cannot be expected to
provide all the services of the typical desktop execution environment (which is called a
hosted environment in the terms of the standard). In particular, it is presumed that there are
no file system and no operating system. The use of the standard term “freestanding imple-
mentation” means that the compiler must contain, at least, a specific subset of the full