Copyright ©2008 by Zilog
®
, Inc. All rights reserved.
www.zilog.com
White Paper
Z8 Encore!
®
Using Zilog
Standard Library (ZSL)
WP001002-0208
Z8 Encore!
®
Using Zilog Standard Library (ZSL)
WP001002-0208 Page 2 of 6
Abstract
This White Paper explains how to use the new Zilog Standard Library (ZSL) software
component in Zilog Developer Studio II (ZDS II)—Z8 Encore!
®
projects. Different mod-
els are described for using, or not using ZSL.
Introduction
The Zilog Developer Studio II (ZDS II)—Z8 Encore! v4.9.0 distribution includes a new
software component called the Zilog Standard Library (ZSL). ZSL is a set of library files
that provides an interface between the application and on-chip peripherals of the
Z8 Encore! microcontrollers. The ZSL included in this ZDS II distribution supports GPIO
and UART on-chip peripherals.
To integrate the new ZSL software component, changes are done to the C-language run-
time library (RTL)
sio.c and sio.h files. These files originally held UART-related
implementations that now reside in the ZSL. To make migration to ZDS II v4.9.0 easier,
the
sio.c and sio.h files still exist in the RTL as a wrapper for corresponding ZSL func-
tions. That is, functions called from the
sio.c file now call ZSL functions in turn to
access the UART.
Supported Use Models
ZSL is created with the following use models:
Migrating an existing application to ZDS II v4.9.0, adopting ZSL. This model has two
different scenarios:
Using the RTL I/O functions.
Using ZSL APIs directly.
Using ZSL in a completely new project.
Running ZSL code on the simulator.
Choosing not to adopt ZSL.
Using ZSL with custom startup or link control files.
These models are described in the following sections.
Migrating an Existing Application to ZDS II v4.9.0
When you use ZDS II v4.9.0 to open a project created for an earlier version, the project is
converted to a new format with the file extension
.zdsproj. As part of this conversion,
ZDS II also performs the following functions:
Copies a new file, zsldevinit.asm, into the project. This is a ZSL-specific device
initialization file. It contains the routine
_open_periphdevice(), which initializes