Zilog Z8F0130 User Manual

This document has been discontinued and thus will no longer be updated. Please refer instead to Zilog Developer Studio’s Online Help feature.
on the Zilog website.
Zilog Developer Studio II – Z8 Encore!
User Manual
UM013037-1212
®
Copyright ©2012 Zilog®, Inc. All rights reserved.
www.zilog.com
Zilog Developer Studio II – Z8 Encore!
Warning:
User Manual
ii
DO NOT USE THIS PRODUCT IN LIFE SUPPORT SYSTEMS.
LIFE SUPPORT POLICY
ZILOG’S PRODUCTS ARE NOT AUTHORIZED FOR USE AS CRITICAL COMPONENTS IN LIFE SUPPORT DEVICES OR SYSTEMS WITHOUT THE EXPRESS PRIOR WRITTEN APPROVAL OF THE PRESIDENT AND GENERAL COUNSEL OF ZILOG CORPORATION.
As used herein
Life support devices or systems are devices which (a) are intended for surgical implant into the body, or (b) support or sustain life and whose failure to perform when properly used in accordance with instructions for use provided in the labeling can be reasonably expected to result in a significant injury to the user. A criti­cal component is any componen t in a li fe supp ort device o r syste m whose failure to p erform ca n be re ason­ably expected to cause the failure of the life support device or system or to affect its safety or effectiveness.
Document Disclaimer
©2012 Zilog, Inc. All rights reserved. Information in this publication concerning the devices, applications, or technology described is intended to suggest possible uses and may be superseded. ZILOG, INC. DOES NOT ASSUME LIABILITY FOR OR PROVIDE A REPRESENTATION OF ACCURACY OF THE INFORMATION, DEVICES, OR TECHNOLOGY DESCRIBED IN THIS DOCUMENT. ZILOG ALSO DOES NOT ASSUME LIABILITY FOR INTELLECTUAL PROPERTY INFRINGEMENT RELATED IN ANY MANNER TO USE OF INFORMATION , DEVI CES, OR TECHNOLOGY DESCRIBED HEREIN OR OTHERWISE. The information contained within this document has been verified according to the general principles of electrical and mechanical engineering.
Z8 Encore!, Z8 Encore! XP and Z8 Encore! XM are trademarks or registered trademarks of Zilog, Inc. All other product or service names are the property of their respective owners.
UM013037-1212

Revision History

Each instance in the following revision history table reflects a change to this document from its previous version. For more details, refer to the corresponding pages provided in the table.
Revision
Date
Dec 2012
Nov 2012
Nov 2012
Dec 2010
May 2008
Dec 2006
Jul 2006
Sep 2005
Level Description Page
37 Restored all pages to document for current reference purposes. Document
will not be updated; please refer instead to Zilog Developer Studio Online Help.
36 Updated title page to note discontinuation of this document; readers are
instead referred to Zilog Developer Studio’s Online Help, which contains this manual in its entirety. Removed all pages but title page.
35 Added Linker Command Files for C Programs section to Using the ANSI
CCompiler chapter.
34 Updated for the ZDS II 5.0.0 release; updated the Using the Integrated
Development Environment chapter; added new section to the Using the Editor chapter.
33 Updated for the ZDS II 4.11.0 release. All
32 Added description of the Use Page Erase Before Flashing check; described
new Place ISR into PRAM checkboxes; added description of the Use Page Erase checkbox; added path for Ethernet Smart Cab le upgrade information; updated the note about PRAM; deleted PL, PW, PAGEWIDTH, and PAGELENGTH; added the checksum, fillmem, loadmem, and savemem commands.
31 Updated for the ZDS II 4.10.0 release. All
30 Added Ethernet target. 111
Zilog Developer Studio II – Z8 Encore!
User Manual
All
All
247
1, 138,
, 149
141
, 94,
49
, 125,
110
, 277,
133
, 312,
307
, 489,
391 523
, 114,
, 273
263
iii
UM013037-1212 Revision History
Zilog Developer Studio II – Z8 Encore! User Manual
iv
Revision History UM013037-1212

Table of Contents

Revision History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .iii
List of Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
List of Tables. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x xiii
Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
ZDS II System Requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Supported Operating Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Recommended Host System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
Minimum Host System Configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
When Using the Serial Smart Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
When Using the USB Smart Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
When Using the Opto-Isolated USB Smart Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
When Using the Ethernet Smart Cable . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
When Using the Z8 Encore! MC Emulator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Z8 Encore! Product Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
Zilog Technical Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
Zilog Developer Studio II – Z8 Encore!
User Manual
v
Getting Started . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Installing ZDS II . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Developer’s Environment Tutorial . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Create a New Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Add a File to the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Set Up the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Save the Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Using the Integrated Development Environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
File Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Build Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Find Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Command Processor Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Bookmarks Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Debug Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Debug Windows Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Project Workspace Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
Edit Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Output Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
UM013037-1212 Table of Contents
Zilog Developer Studio II – Z8 Encore! User Manual
vi
Menu Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
File Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Edit Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
View Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Project Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Build Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 117
Debug Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
Tools Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
Window Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 145
Shortcut Keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
File Menu Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Edit Menu Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Project Menu Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Build Menu Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Debug Menu Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Using the Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 149
Auto Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Call Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 155
Auto Indentation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 157
Multiple Clipboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
Line and Block Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Abbreviations and Expansions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 161
Auto Insertion of Braces and Quotes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Long Line Indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
UNICODE Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 170
Auto Syntax Styler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 171
Code Folding Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Line Number Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176
Type Info Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 178
Highlighting and Finding Matched Braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Matching Preprocessor Conditional Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Wrap Long Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Indentation Guides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182
Zoom In/Out . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Bookmarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 184
Opening an Include File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
Highlighting a Program Counter Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Mismatched Brace Highlighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Auto Conversion of “.” to “→” . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Table of Contents UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
Using the ANSI C-Compiler. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193
Language Extensions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194
Additional Keywords for Storage Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 195
Memory Models . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 199
Call Frames . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200
Interrupt Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202
Monitor Function Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
String Placement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 204
Inline Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 205
Placement Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 206
Char and Short Enumerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207
Setting Flash Option Bytes in C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
Program RAM Support (Z8 Encore! XP 16K Series Only) . . . . . . . . . . . . . . . . . . . . 208
Preprocessor #warning Directive Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Supported New Features from the 1999 Standard . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
Type Sizes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Predefined Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Macros Generated by the IDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Calling Conventions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Function Call Mechanism: Dynamic Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Function Call Mechanism: Static Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Function Call Mechanism: Register Parameter Passing . . . . . . . . . . . . . . . . . . . . . . . 218
Return Value . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Special Cases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Calling Assembly Functions from C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Function Naming Convention . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Argument Locations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 221
Return Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Preserving Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
Calling C Functions from Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
Assembly File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Referenced C Function Prototype . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 224
Run-Time Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225
Zilog Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Zilog Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 228
Zilog Extensions to the C Library Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
Start-Up Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
vii
UM013037-1212 Table of Contents
Zilog Developer Studio II – Z8 Encore! User Manual
viii
Customizing Start-Up Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Segment Naming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Linker Command Files for C Programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
Linker Referenced Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Linker Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Sample Linker Command File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
ANSI Standard Compliance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Freestanding Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 255
Deviations from ANSI C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256
Warning and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 259
Preprocessor Warning and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260
Front-End Warning and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 263
Optimizer Warning and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 273
Code Generator Warning and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274
Using the Macro Assembler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 277
Address Spaces and Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Allocating Processor Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Address Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 278
Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Assigning Memory at Link Time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Output Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281
Source Listing (.lst) Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282
Object Code (.obj) File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Source Language Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
General Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283
Assembler Rules . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 285
Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Arithmetic Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 288
Relational Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
Boolean Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
HIGH and LOW Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289
HIGH16 and LOW16 Operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
.FTOL Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
.LTOF Operator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290
Decimal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Hexadecimal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Binary Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
Octal Numbers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Character Constants . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Table of Contents UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
Operator Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Automatic Working Register Definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293
Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 294
ALIGN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 295
.COMMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
CPU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296
Data Directives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 297
DEFINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301
DS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 303
END . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
EQU . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304
INCLUDE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 305
LIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
NEWPAGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
NOLIST . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 306
ORG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
SEGMENT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307
SUBTITLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
TITLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
VAR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308
VECTOR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 309
XDEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 311
XREF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Structures and Unions in Assembly Code . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312
Structured Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317
Structured Assembly Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 319
Structured Assembly Processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323
Conditional Assembly . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325
IF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326
IFDEF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327
IFSAME . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
IFMA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Macros . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328
Macro Definition . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Concatenation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 329
Macro Invocation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Local Macro Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 330
Optional Macro Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Exiting a Macro . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
Delimiting Macro Arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
ix
UM013037-1212 Table of Contents
Zilog Developer Studio II – Z8 Encore! User Manual
x
Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 332
Anonymous Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Local Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Importing and Exporting Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Label Spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Label Checks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Source Language Syntax . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334
Compatibility Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337
Warning and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 338
Using the Linker/Locator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Linker Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345
Invoking the Linker . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 346
Linker Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 347
<outputfile>=<module list> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
CHANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 348
COPY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 349
DEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
DEFINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351
FORMAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
GROUP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
HEADING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
LOCATE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 352
MAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353
MAXHEXLEN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
MAXLENGTH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
NODEBUG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 354
NOMAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
NOWARN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
ORDER . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 355
RANGE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
SEARCHPATH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356
SEQUENCE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
SORT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
SPLITTABLE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357
UNRESOLVED IS FATAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358
WARN . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
WARNING IS FATAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
WARNOVERLAP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
Linker Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 359
+ (Add) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
Table of Contents UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
& (And) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
BASE OF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 361
COPY BASE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
COPY TOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
/ (Divide) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 362
FREEMEM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
HIGHADDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
LENGTH . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
LOWADDR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
* (Multiply) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Decimal Numeric Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
Hexadecimal Numeric Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
| (Or) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
<< (Shift Left) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364
>> (Shift Right) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
- (Subtract) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
TOP OF . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 365
^ (Bitwise Exclusive Or) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
~ (Not) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Sample Linker Map File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 366
Warning and Error Messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 381
xi
Using the Debugger. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Code Line Indicators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387
Debug Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Registers Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Special Function Registers Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Clock Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Memory Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Watch Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Locals Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399
Call Stack Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Symbols Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Disassembly Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Simulated UART Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Using Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Inserting Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 404
Viewing Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Moving to a Breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Enabling Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
UM013037-1212 Table of Contents
Zilog Developer Studio II – Z8 Encore! User Manual
xii
Disabling Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406
Removing Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 407
Appendix A. Zilog Standard Library Notes and Tips. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
Appendix B. C Standard Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Standard Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Diagnostics <assert.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 416
Character Handling <ctype.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 417
Errors <errno.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Floating Point <float.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418
Limits <limits.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 420
Mathematics <math.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 421
Nonlocal Jumps <setjmp.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Variable Arguments <stdarg.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 423
Standard Definitions <stddef.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 424
Input/Output <stdio.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
General Utilities <stdlib.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 425
String Handling <string.h> . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
Standard Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 430
abort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
abs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
acos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 431
asin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
atan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 432
atan2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
atof . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
atoi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 433
atol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
bsearch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
calloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 435
ceil . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
cos . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 436
cosh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
div . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 437
exp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
fabs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 438
floor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
fmod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
free . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 439
frexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
getchar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440
Table of Contents UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
gets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 441
isalnum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
isalpha . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
iscntrl . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
isdigit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 442
isgraph . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
islower . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
isprint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
ispunct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
isspace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
isupper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 444
isxdigit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
labs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
ldexp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445
ldiv . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446
log10 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
longjmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 447
malloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
memchr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 448
memcmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
memcpy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
memmove . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
memset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 450
modf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
pow . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
printf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 451
putchar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
puts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455
qsort . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
rand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
realloc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 457
scanf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 458
setjmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
sin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
sinh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
sprintf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 462
sqrt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
srand . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463
sscanf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
strcat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 464
xiii
UM013037-1212 Table of Contents
Zilog Developer Studio II – Z8 Encore! User Manual
xiv
strchr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
strcmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
strcpy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 465
strcspn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
strlen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 466
strncat . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
strncmp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467
strncpy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
strpbrk . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 468
strrchr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
strspn . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
strstr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 469
strtod . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
strtok . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 471
strtol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
tan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 472
tanh . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
tolower . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 473
toupper . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
va_arg . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 474
va_end . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 475
va_start . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 476
vprintf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
vsprintf . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 477
Appendix C. Running ZDS II from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Building a Project from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 479
Running the Assembler from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Running the Compiler from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 480
Running the Linker from the Command Line . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 481
Assembler Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Compiler Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Librarian Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 487
Linker Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Appendix D. Using the Command Processor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489
Sample Command Script File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 494
Supported Script File Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 495
add file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
batch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 496
bp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
Table of Contents UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
build . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
cancel all . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
cancel bp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 497
cd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
checksum . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
crc . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
debugtool copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 498
debugtool create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
debugtool get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
debugtool help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
debugtool list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499
debugtool save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
debugtool set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
debugtool setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 500
defines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
delete config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 501
examine (?) for Expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 502
examine (?) for Variables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
exit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
fillmem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 503
go . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
list bp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
loadmem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 504
log . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
makfile or makefile . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 505
new project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
open project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 506
option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
print . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
pwd . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
quit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
rebuild . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
reset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
savemem . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 513
set config . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
step . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 514
stepin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
stepout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
stop . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
target copy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
target create . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 515
xv
UM013037-1212 Table of Contents
Zilog Developer Studio II – Z8 Encore! User Manual
xvi
target get . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
target help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
target list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
target options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516
target save . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
target set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 517
target setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
wait . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
wait bp . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 518
Running the Flash Loader from the Command Processor . . . . . . . . . . . . . . . . . . . . . . . . . 518
Displaying Flash Help . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Setting Up Flash Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Executing Flash Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 519
Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 520
Appendix E. Compatibility Issues. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Assembler Compatibility Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
Compiler Compatibility Issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 525
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 531
Customer Support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 557
Table of Contents UM013037-1212

List of Figures

Figure 1. New Project Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 2. Select Project Name Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 3. New Project Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 4. New Project Wizard Dialog Box, Build Options Step . . . . . . . . . . . . . . . . . 12
Figure 5. New Project Wizard Dialog Box, Target and Debug Tool Selection Step . 13 Figure 6. New Project Wizard Dialog Box, Target Memory Configuration Step . . . 14
Figure 7. Add Files to Project Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Figure 8. Sample Project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 9. General Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . . . 17
Figure 10. Assembler Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . 18
Figure 11. Code Generation Page of the Project Settings Dialog Box . . . . . . . . . . . . . 19
Figure 12. Advanced Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . 20
Figure 13. Output Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . . . . 21
Figure 14. Build Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 15. Z8 Encore! Integrated Development Environment Window . . . . . . . . . . . . 24
Figure 16. File Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 17. Build Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
Figure 18. Find Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 19. Command Processor Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
Figure 20. Bookmarks Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32
Figure 21. The Debug Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 22. Debug Windows Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
Figure 23. Project Workspace Window for Standard Projects . . . . . . . . . . . . . . . . . . . 39
Figure 24. Project Workspace Window for Assembly Only Projects . . . . . . . . . . . . . . 39
Figure 25. Edit Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
Figure 26. Bookmark Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42
Figure 27. Inserting a Bookmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Figure 28. Build Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 29. Debug Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Figure 30. Find in Files Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 31. Find in Files 2 Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 32. Message Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 33. Command Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Zilog Developer Studio II – Z8 Encore!
User Manual
xvii
UM013037-1212 List of Figures
xviii
Zilog Developer Studio II – Z8 Encore! User Manual
Figure 34. Open Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Figure 35. New Project Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
Figure 36. Select Project Name Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
Figure 37. New Project Dialog Box, Build Options . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Figure 38. New Project Wizard Dialog Box, Target and Debug Tool Selection . . . . . 52
Figure 39. New Project Wizard Dialog Box, Target Memory Configuration . . . . . . . . 53
Figure 40. Open Project Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Figure 41. Save As Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 42. Print Preview Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Figure 43. Find Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Figure 44. Find in Files Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Figure 45. Replace Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
Figure 46. Go to Line Number Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Figure 47. Breakpoints Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Figure 48. Abbreviations Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Figure 49. Add Files to Project Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Figure 50. General Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . . . 69
Figure 51. Assembler Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . 72
Figure 52. Code Generation Page of the Project Settings Dialog Box . . . . . . . . . . . . . 75
Figure 53. Listing Files Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . 79
Figure 54. Preprocessor Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . 81
Figure 55. Advanced Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . 83
Figure 56. Deprecated Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . 87
Figure 57. Librarian Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . . 92
Figure 58. ZSL Page (Z8 Encore! XP F1680 Series) of the Project Settings Dialog
Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Figure 59. Commands Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . 95
Figure 60. Additional Linker Directives Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Figure 61. Select Linker Command File Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . 98
Figure 62. Objects and Libraries Page of the Project Settings Dialog Box . . . . . . . . . 99
Figure 63. Address Spaces Page of the Project Settings Dialog Box . . . . . . . . . . . . . 103
Figure 64. Warnings Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . 106
Figure 65. Output Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . . . 108
Figure 66. Debugger Page of the Project Settings Dialog Box . . . . . . . . . . . . . . . . . . 110
Figure 67. Configure Target Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Figure 68. Create New Target Wizard Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
List of Figures UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
Figure 69. Target Copy or Move Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
Figure 70. Setup Ethernet Smart Cable Communication Dialog Box . . . . . . . . . . . . . 114
Figure 71. Setup Serial Communication Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . 115
Figure 72. Setup USB Communication Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Figure 73. Save As Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Figure 74. Select Configuration Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118
Figure 75. Manage Configurations Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Figure 76. Add Project Configuration Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
Figure 77. Manage Configurations Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Figure 78. Copy Configuration Settings Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . 120
Figure 79. Flash Loader Processor Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Figure 80. Fill Memory Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
Figure 81. Save to File Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131
Figure 82. Load from File Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Figure 83. Show CRC Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
Figure 84. Calculate Checksum Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Figure 85. Calculate Checksum Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133
Figure 86. Show CRC Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 134
Figure 87. Customize Dialog Box, Toolbars Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
Figure 88. Customize Dialog Box, Commands Tab . . . . . . . . . . . . . . . . . . . . . . . . . . 136
Figure 89. Options Dialog Box, General Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138
Figure 90. Options Dialog Box, Editor Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 139
Figure 91. Color Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 140
Figure 92. Font Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141
Figure 93. Options Dialog Box: Editor Tab, Advanced Editor Options Dialog Box . 142
Figure 94. Options Dialog Box, Debugger Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 144
Figure 95. Auto Completion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152
Figure 96. Autocompletion of Members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153
Figure 97. Autocompletion of Header File Inclusion . . . . . . . . . . . . . . . . . . . . . . . . . 153
Figure 98. Autocompletion of HTML Tags . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 154
Figure 99. Advance Editor Options, Show Autocompletion List . . . . . . . . . . . . . . . . 155
Figure 100. Call Tips Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 156
Figure 101. Advance Editor Options, Show Call Tips Window . . . . . . . . . . . . . . . . . . 157
Figure 102. Auto Indentation in C Program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158
Figure 103. Auto Indentation With Assembly Program . . . . . . . . . . . . . . . . . . . . . . . . 158
Figure 104. Options Dialog Box, Auto Indent . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
xix
UM013037-1212 List of Figures
Zilog Developer Studio II – Z8 Encore! User Manual
xx
Figure 105. Multiple Clipboards . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160
Figure 106. Abbreviation Example 1 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162
Figure 107. Abbreviation Example 2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 163
Figure 108. Abbreviations Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164
Figure 109. Auto Insertion of Closing Brace . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Figure 110. Auto Insertion of Closing Parenthesis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 167
Figure 111. Advance Editor Options, Auto Insertion of Brace and Quotes . . . . . . . . . 168
Figure 112. Long Line Indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 169
Figure 113. Advance Editor Options, Long Line Indicator Settings . . . . . . . . . . . . . . 170
Figure 114. Advance Editor Options, Support UNICODE . . . . . . . . . . . . . . . . . . . . . . 171
Figure 115. Auto Syntax Styler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172
Figure 116. Options Dialog Box, Editor Tab . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173
Figure 117. Color Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 174
Figure 118. Code Folding Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
Figure 119. Advance Editor Options, Display Code Folding Margin . . . . . . . . . . . . . 176
Figure 120. Line Number Margin . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 177
Figure 121. Advance Editor Options, Display Line Number Margin . . . . . . . . . . . . . . 178
Figure 122. Type Info Tips . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Figure 123. Highlighting Matching Braces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179
Figure 124. Highlighting Matching Parentheses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 180
Figure 125. Wrapping Long Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 181
Figure 126. Advance Editor Options, Wrap Long Lines . . . . . . . . . . . . . . . . . . . . . . . 182
Figure 127. Indentation Guides . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
Figure 128. Advance Editor Options, Display Indentation Guide . . . . . . . . . . . . . . . . 184
Figure 129. Bookmark Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185
Figure 130. Inserting a Bookmark . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186
Figure 131. Opening an Include File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188
Figure 132. Highlighting PC Line in Debug mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . 189
Figure 133. Advance Editor Options, Highlight PC Line in Debug mode . . . . . . . . . . 190
Figure 134. Mismatched Brace Highlighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
Figure 135. Mismatched Parenthesis Highlighting . . . . . . . . . . . . . . . . . . . . . . . . . . . . 191
Figure 136. Convert . to Automatically . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 192
Figure 137. Z8 Encore! Memory Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
Figure 138. Dynamic Call Frame Layout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Figure 139. Z8 Encore! Hierarchical Memory Model . . . . . . . . . . . . . . . . . . . . . . . . . 248
Figure 140. Multiple File Linking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
List of Figures UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
Figure 141. Debug and Debug Window Toolbars . . . . . . . . . . . . . . . . . . . . . . . . . . . . 386
Figure 142. Debug Windows Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 388
Figure 143. Registers Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Figure 144. Special Function Registers Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 389
Figure 145. Clock Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 390
Figure 146. Memory Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 391
Figure 147. Memory Window, Starting Address . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 393
Figure 148. Memory Window, Requested Address . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Figure 149. Fill Memory Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
Figure 150. Save to File Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 395
Figure 151. Load from File Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 396
Figure 152. Show CRC Dialog Box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Figure 153. Watch Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 397
Figure 154. Locals Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
Figure 155. Call Stack Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Figure 156. Symbols Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 401
Figure 157. Disassembly Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 402
Figure 158. Simulated UART Output Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 403
Figure 159. Setting a Breakpoint . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
Figure 160. Viewing Breakpoints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 405
xxi
UM013037-1212 List of Figures
xxii
Zilog Developer Studio II – Z8 Encore! User Manual
List of Figures UM013037-1212

List of Tables

Table 1. Edit Window Shortcuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Table 2. File Menu Shortcut Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
Table 3. Edit Menu Shortcut Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Table 4. Project Menu Shortcut Option . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
Table 5. Build Menu Shortcut Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Table 6. Debug Menu Shortcut Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 148
Table 7. Working with Words . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Table 8. Working with Lines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 150
Table 9. Working with Paragraphs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Table 10. Working with Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151
Table 11. Default Storage Specifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 198
Table 12. Return Value Registers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Table 13. Nonstandard Header Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 226
Table 14. Z8 Encore! Start-Up Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243
Table 15. Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246
Table 16. Linker Referenced Files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 249
Table 17. Linker Symbols . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 252
Table 18. Predefined Segments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 279
Table 19. Operator Precedence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 292
Table 20. Assembler Directives for Structured Assembly . . . . . . . . . . . . . . . . . . . . . 318
Table 21. Anonymous Labels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 333
Table 22. Standard Headers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
Table 23. Assembler Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 482
Table 24. Compiler Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 484
Table 25. Librarian Command Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 488
Table 26. Script File Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 490
Table 27. Command Line Examples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 507
Table 28. Assembler Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Table 29. Compiler Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 508
Table 30. General Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Table 31. Librarian Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510
Table 32. Linker Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 511
Table 33. ZSL Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 512
Zilog Developer Studio II – Z8 Encore!
User Manual
xxiii
UM013037-1212 List of Tables
xxiv
Zilog Developer Studio II – Z8 Encore! User Manual
Table 34. Z8 Encore! Directive Compatibility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 523
List of Tables UM013037-1212

Introduction

Note:
The following sections provide an introduction to the Zilog Developer Studio II:
ZDS II System Requirements – see page 1
Zilog T echnical Support – see page 6

ZDS II System Requirements

T o effectively use Zilog Developer System II, you need a basic understanding of the C and assembly languages, the device architecture, and Microsoft Windows.
The following sections describe the ZDS II system requirements:
Zilog Developer Studio II – Z8 Encore!
User Manual
1
Supported Operating Systems – see page 1
Recommended Host System Configuration – see page 2
Minimum Host System Configuration – see page 2
When Using the Serial Smart Cable – see page 2
When Using the USB Smart Cable – see page 3
When Using the Opto-Isolated USB Smart Cable – see page 3
When Using the Ethernet Smart Cable – see page 3
When Using the Z8 Encore! MC Emulator – see page 3
Z8 Encore! Product Support – see page 3

Supported Operating Systems

Windows 7 64-bit
Windows 7 32-bit
Windows Vista 64-bit
Windows Vista 32-bit
Windows XP Professional 32-bit
The USB Smart Cable is not supported on 64-bit Windows Vista and Windows XP for ZDS II – Z8 Encore! versions 4.10.1 or earlier.
UM013037-1212 Introduction
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
2
Windows 2000 SP4

Recommended Host System Configuration

Windows XP Professional SP3 or later
Pentium IV 2.2 GHz processor or higher
1024 MB RAM or mor
135 MB hard disk space (includes application and documentation)
Super VGA video adapter
CD-ROM drive for installation
USB high-speed port (when using the USB Smart Cable)
RS-232 communication port with hardware flow control
Internet browser (Internet Explorer or Netscape)

Minimum Host System Configuration

Windows XP Professional SP2
Pentium IV 2.2 GHz processor
512 MB RAM
50 MB hard disk space (application only)
Super VGA video adapter
CD-ROM drive for installation
USB full-speed port (when using the USB Smart Cable)
RS-232 communication port with hardware flow control
Internet browser (Internet Explorer or Netscape)

When Using the Serial Smart Cable

RS-232 communication port with hardware flow and modem control signals
Some USB to RS-232 devices are not compatible because they lack the necessary hardware signals and/or they use proprietary auto-sensing mechanisms which prevent the Smart Cable from connecting.
Introduction UM013037-1212
Zilog Developer Studio II – Z8 Encore!
Note:
Note:

When Using the USB Smart Cable

High-speed USB (fully compatible with original USB)
Root (direct) or self-powered hub connection
The USB Smart Cable is a high-power USB device. Windows NT is not supported.

When Using the Opto-Isolated USB Smart Cable

High-speed USB (fully compatible with original USB)
Root (direct) or self-powered hub connection
User Manual
3
The USB Smart Cable is a high-power USB device. Windows NT is not supported.

When Using the Ethernet Smart Cable

Ethernet 10Base-T compatible connection

When Using the Z8 Encore! MC Emulator

Internet browser (Internet Explorer or Netscape)
Ethernet 10Base-T compatible connection
One or more RS-232 communication ports with hardware flow control

Z8 Encore! Product Support

CPU Family CPU Pin Count Evaluation Kit Name
Z8Encore_F0830_Series Z8F013x 20, 28 Not applicable
Z8F023x Z8F043x Z8F083x Z8F123x
Z8Encore_F083A_Series Z8F043A 20, 28 Z8F083A0128ZCOG
Z8F083A
UM013037-1212 When Using the USB Smart Cable
Zilog Developer Studio II – Z8 Encore! User Manual
4
CPU Family CPU Pin Count Evaluation Kit Name
Z8Encore_XP_64XX_Series Z8F1621 40, 44 Z8F64200100KITG
Z8Encore_XP_F0822_Series Z8F0411 20 Z8F08200100KITG
Z8Encore_XP_F0823_8Pin_Series Z8F0113XB 8 Z8F04A08100KITG
Z8F1622 64, 68 Z8F2421 40, 44 Z8F2422 64, 68 Z8F3221 40, 44 Z8F3222 64, 68 Z8F4821 40, 44 Z8F4822 64, 68 Z8F4823 80 Z8F6421 40, 44 Z8F6422 64, 68 Z8F6423 80
Z8F0412 28 Z8F0421 20 Z8F0422 28 Z8F0811 20 Z8F0812 28 Z8F0821 20 Z8F0822 28
Z8F0123XB Z8F0213XB Z8F0223XB Z8F0413XB Z8F0423XB Z8F0813XB Z8F0823XB
Introduction UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
CPU Family CPU Pin Count Evaluation Kit Name
Z8Encore_XP_F0823_Series Z8F0113 20, 28 Z8F04A28100KITG
Z8F0123 Z8F0213 Z8F0223 Z8F0413 Z8F0423 Z8F0813 Z8F0823
Z8Encore_XP_F082A_8Pin_Series Z8F011AXB 8 Z8F04A08100KITG
Z8F012AXB Z8F021AXB Z8F022AXB Z8F041AXB Z8F042AXB Z8F081AXB Z8F082AXB
Z8Encore_XP_F082A_Series Z8F011A 20, 28 Z8F04A28100KITG
Z8F012A Z8F021A Z8F022A Z8F041A Z8F042A Z8F081A Z8F08A28100KITG Z8F082A
Z8Encore_XP_F1680_Series_16K Z8F1680X
Z8F1681X
Z8Encore_XP_F1680_Series_24K Z8F2480X
Z8F2481X
Z8Encore_XP_F1680_Series_8K Z8F0880X
Z8F0881X
Z8Encore_Z8FMC16100_Series Z8FMC04100 28, 32 Z8FMC160100KITG
Z8FMC08100 Z8FMC16100
20, 28, 40, 44Z8F16800128ZCOG
Z8F16800144ZCOG
20, 28, 40, 44Z8F16800128ZCOG
Z8F16800144ZCOG
20, 28, 40, 44Z8F16800128ZCOG
Z8F16800144ZCOG
5
UM013037-1212 Z8 Encore! Product Support
Zilog Developer Studio II – Z8 Encore! User Manual
6

Zilog Technical Support

For technical questions about our products and tools, or for design assistance, please visit
http://www.zilog.com
the following information in your support ticket:
Product release number (Located in the heading of the toolbar)
Product serial number
Type of hardware you are using
Exact wording of any error or warning messages
Attach any applicable files to your email
Before Using Technical Support
, navigate via the Support menu to Technical Support, and provide
Before you use technical support, consult the following documentation:
readme.txt file Refer to the
mation about problems that might occur while installing or running ZDS II:
ZILOGINSTALL\ZDSII_product_version\
In the above filepath: – ZILOGINSTALL is the ZDS II installation directory. For example, the default
installation directory is
product is the specific Zilog product. For example, product can be Z8Encore!,
ZNEO, eZ80Acclaim!, Crimzon, or Z8GP.
version is the ZDS II version number. For example, version can be
5.0.0.
FAQ.html file The
FAQ.html file contains answers to frequently asked questions and other informa-
tion about good practices for getting the best results from ZDS II. The information in this file does not generally go out of date from release to release as quickly as the information in the directory:
readme.txt file in the following directory for last minute tips and infor-
C:\Program Files\Zilog.
4.11.0 or
readme.txt file. You can find the FAQ.html file in the following
ZILOGINSTALL\ZDSII_product_version\
In the above filepath: – ZILOGINSTALL is the ZDS II installation directory. For example, the default
installation directory is
Introduction UM013037-1212
C:\Program Files\Zilog.
Zilog Developer Studio II – Z8 Encore!
User Manual
product is the specific Zilog product. For example, product can be Z8Encore!,
ZNEO, eZ80Acclaim!, Crimzon, or Z8GP.
version is the ZDS II version number. For example, version can be
5.0.0.
Troubleshooting section – Appendix A. Zilog Standard Library Notes and Tips
on page 409
4.11.0 or
7
UM013037-1212 Zilog Technical Support
Zilog Developer Studio II – Z8 Encore! User Manual
8
Introduction UM013037-1212

Getting Started

This section provides a tutorial of the developer’s environment, so you can be working with the ZDS II graphical user interface in a short time. The following topics are covered:
Installing ZDS II – see page 9
Developer’s Environment Tutorial – see page 9

Installing ZDS II

There are two ways to install ZDS II:
From a CD a. Insert the CD in your CD-ROM drive. b. Follow the setup instructions on your screen. The installer displays a default loca-
tion for ZDS II. You can change the location if you want to.
Zilog Developer Studio II – Z8 Encore!
User Manual
9
From the home page of the Zilog website: a. Navigate to b. Click the link for the version that you want to download. c. Click d. In the e. Navigate to a location on your hard drive in which you want to save ZDS II. f. Click g. Double-click the executable file. h. Follow the setup instructions on your screen. The installer displays a default loca-
tion for ZDS II. You can change the location if you want to.
http://www.zilog.com/software/zds2.asp.
Download.
File Download dialog box, click Save.
Save.

Developer’s Environment Tutorial

This tutorial shows you how to use the Zilog Developer Studio II. To begin this tour, you need a basic understanding of Microsoft Windows. Estimated time for completing this exercise is 15 minutes.
In this tour, you’ll perform the following tasks:
Create a New Project – see page 10
Add a File to the Project – see page 14
Set Up the Project – see page 16
UM013037-1212 Getting Started
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
10
Save the Project – see page 22
When you complete this tour, you have a
Be sure to read the Using the Integrated Development Environment section on page 23 to learn more about all of the dialog boxes and their options discussed in this tutorial.
For the purpose of this quick tour , your Z8 Encore! developer’ s environment directory will be referred to as <ZDS Installation Directory>, which equates to the following path:
<ZILOGINSTALL>\ZDSII_Z8Encore!_<version>\
In the above filepath:
ZILOGINSTALL is the ZDS II installation directory. For example, the default installa­tion directory is
version is the ZDS II version number. For example, version can be 4.11.0 or 5.0.0.
C:\Program Files\Zilog.
sample.lod file that is used in debugging.

Create a New Project

1. To create a new projec t, select New Project from the File menu. The New Project
dialog box is displayed, as shown in Figure 1.
Figure 1. New Project Dialog Box
2. From the
directory into which you want to save your project. The box is displayed.
Getting Started UM013037-1212
New Project dialog box, click the Browse button ( ) to navigate to the
Select Project Name dialog
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
11
Figure 2. Select Project Name Dialog Box
3. Use the Look In drop-down list box to navigate to the directory in which you want to
save your project. For this tutorial, place your project in the following directory:
<ZDS Installation Directory>\samples\Tutorial
If Zilog Developer Studio was installed in the default directory, the following is the actual path:
C:\Program Files\Zilog\ZDSII_Z8Encore!_4.11.0\samples\Tutorial
You can create a new folder in which you want to save your project. For example:
C:\<New Folder>.
4. In the
5. Click
File Name field, enter sample for the name of your project. The Z8 Encore!
developer’s environment creates a project file. Project files have the sion (for example, <project name>
.zdsproj. It is added automatically.
Select to return to the New Project dialog box.
.zdsproj). You do not have to type the extension
.zdsproj exten-
6. In the
7. In the
8. In the
UM013037-1212 Create a New Project
Project Type field, select Standard because the sample project uses .c files. CPU Family drop-down list box, select Z8Encore_XP_F1680_Series_16K. CPU drop-down list box, select Z8F1680XJ.
Zilog Developer Studio II – Z8 Encore! User Manual
12
9. In the Build Type drop-down list box, select Executable to build an application.
Figure 3. New Project Dialog Box
10. Click
Continue. The New Project Wizard dialog box is displayed. It allows you to
modify the initial values for some of the project settings during the project creation process.
Figure 4. New Project Wizard Dialog Box, Build Options Step
Getting Started UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
11. Accept the defaults by clicking Next. The Target and Debug Tool Selection step of
New Project Wizard dialog box is displayed.
the
13
The options displayed in the selected in the
General page of the Project Settings dialog box (see the General Page section on
the
New Project dialog box (see the New Project section on page 49) or
Configure Target dialog box depend on the CPU you
page 69). For this tutorial project, there are two targets displayed. Z8F16800128ZCOG is the Z8F1680 28-Pin Development Kit’s evaluation board; Z8F16800144ZCOG is the Z8F1680 Dual 44-Pin Development Kit’s evaluation board. For more information about which products each target supports, see the Z8
Encore! Product Support section on page 3.
Clicking
Configure Target dialog box allows you to select the clock source and the appropriate
Setup in the Target area displays the Configure Target dialog box. The
clock frequency. For the emulator, this frequency must match the clock oscillator on Y4. For the development kit, this frequency must match the clock oscillator on Y1. For more information about configuring the target, see the Setup
section on page 111.
For details about the available debug tools and how to configure them, see the Debug
Tool section on page 114.
12. Select the
Z8F16800128ZCOG checkbox.
Figure 5. New Project Wizard Dialog Box, Target and Debug Tool Selection Step
UM013037-1212 Create a New Project
Zilog Developer Studio II – Z8 Encore! User Manual
14
13. Click Next.
The Target Memory Configuration step of the played.
New Project Wizard dialog box is dis-
Figure 6. New Project Wizard Dialog Box, Target Memory Configuration Step
14. Click
Finish.
ZDS II creates a new project named
Project Workspace window (Standard Project Files and External Dependencies) on
sample. Two empty folders are displayed in the
the left side of the integrated development environment (IDE).

Add a File to the Project

In this section, you add the provided C source file main.c file to the sample project.
1. From the
played.
Getting Started UM013037-1212
Project menu, select Add Files. The Add Files to Project dialog box is dis-
Zilog Developer Studio II – Z8 Encore!
User Manual
15
Figure 7. Add Files to Project Dialog Box
2. In the Add Files to Project dialog box, use the Look In drop-down list box to navi-
gate to the tutorial directory:
<ZDS Installation Directory>\samples\Tutorial
3. Select the main.c file and click Add.
The
main.c file is displayed under the Standard Project Files folder in the Project
Workspace
window on the left side of the IDE.
UM013037-1212 Add a File to the Project
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
16
Figure 8. Sample Project
To view any of the files in the Edit window during the quick tour, double-click the file in the Project Workspace window.

Set Up the Project

Before you save and build the sample project, check the settings in the Project Settings dialog box.
1. From the
played. It provides various project configuration pages that can be accessed by select­ing the page name in the pane on the left side of the dialog box. There are several
Getting Started UM013037-1212
Project menu, select Settings. The Project Settings dialog box is dis-
Zilog Developer Studio II – Z8 Encore!
User Manual
pages grouped together for the C (Compiler) and Linker that allow you to set up sub­settings for those tools. For more information, see the Settings
section on page 68.
17
2. In the
Configuration drop-down list box, make sure that the Debug build configura-
tion is selected. For your convenience, the Debug configuration is a predefined con­figuration of defaults set for debugging. For more information about project configurations such as adding your own configuration , se e the Set Active Configura-
tion section on page 118.
Figure 9. General Page of the Project Settings Dialog Box
3. Select the
4. Make sure that the
UM013037-1212 Set Up the Project
Assembler page.
Generate Assembly Listing Files (.lst) checkbox is selected.
Zilog Developer Studio II – Z8 Encore! User Manual
18
Figure 10. Assembler Page of the Project Settings Dialog Box
5. Select the Code Generation page.
6. Make sure that the
Getting Started UM013037-1212
Limit Optimizations for Easier Debugging checkbox is selected.
Zilog Developer Studio II – Z8 Encore!
User Manual
19
Figure 11. Code Ge neration Page of the Project Settings Dialog Box
7. Select the Advanced page.
8. Make certain that the
UM013037-1212 Set Up the Project
Generate Printfs Inline checkbox is selected.
Zilog Developer Studio II – Z8 Encore! User Manual
20
Figure 12. Advanced Page of the Project Settings Dialog Box
9. Select the Output page.
10. Make certain that both the IEEE 695 and Intel Hex32 - Records checkboxes are
selected.
Getting Started UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
21
Figure 13. Output Page of the Project Settings Dialog Box
The executable format defaults to IEEE 695 when you create an executable project
.lod). T o change the executable format, see the Linker: Output Page section on page
(
107.
11. Click
OK to save all of the settings on the Project Settings dialog box.
The Development Environment prompts you to build the project when changes are made to the project settings that would effect the resulting build program. The mes­sage is as follows: “
build. Would you like to rebuild the affected files?
12. Click
Yes to build the project.
The developer’s environment builds the
13. Watch the compilation process in the
UM013037-1212 Set Up the Project
The project settings have changed since the last
sample project.
Build Output window.
Zilog Developer Studio II – Z8 Encore! User Manual
22
Figure 14. Build Output Window
When the Build completed message is displayed in the Build Output window, you have successfully built the sample project and created a
sample.lod file to debug.

Save the Project

You must save your project. From the File menu, select Save Project.
Getting Started UM013037-1212
Zilog Developer Studio II – Z8 Encore!

Using the Integrated Development Environment

The following sections discuss how to use the integrated development environment (IDE):
Toolbars – see page 24
Windows – see page 38
Menu Bar – see page 47
Shortcut Keys – see page 146
To effectively understand how to use the developer’s environment, be sure to go through the tutorial in the Getting Started
section on page 9.
User Manual
23
After the discussion of the toolbars and windows, this section discusses the menu bar from left to right – File, Edit, View, Project, Build, Debug, Tools, Window, and Help – and the dialog boxes accessed from the menus. For example, the discussed as a part of the Project menu section.
Project Settings dialog box is
UM013037-1212 Using the Integrated Development Environment
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
24

Toolbars

Figure 15. Z8 Encore! Integrated Development Environment Window
For a table of all of the shortcuts used in the Z8 Encore! developer’s environment, see the
Shortcut Keys
The toolbars give you quick access to most features of the Z8 Encore! developer’s envi­ronment. You can use these buttons to perform any task.
There are cue cards for the toolbars. As you move the mouse pointer across the toolbars, the main function of the button is displayed. Also, you can drag and move the toolbars to different areas on the screen.
The following toolbars are available:
File Toolbar – see page 25
section on page 146.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
Build Toolbar – see page 26
Find Toolbar – see page 30
Command Processor Toolbar – see page 31
Bookmarks Toolbar – see page 32
Debug Toolbar – see page 32
Debug Windows Toolbar – see page 36
For more information about Debugging, see the Using the Debugger section on page 385.

File Toolbar

25
The File toolbar allows you to perform basic functions with your files u sing the foll owing buttons:
New Button – see page 25
Open Button – see page 26
Save Button – see page 26
Save All Button – see page 26
Cut Button – see page 26
Copy Button – see page 26
Paste Button – see page 26
Delete Button – see page 26
Print Button – see page 26
Workspace Window Button – see page 26
Output Window Button – see page 26
Figure 16. File Toolbar
New Button
The New button creates a new file.
UM013037-1212 File Too lbar
Zilog Developer Studio II – Z8 Encore! User Manual
26
Open Button
The Open button opens an existing file.
Save Button
The Save button saves the active file.
Save All Button
The Save All button saves all open files and the currently loaded project.
Cut Button
The Cut button deletes selected text from the active file and puts it on the Windows clip­board.
Copy Button
The Copy button copies selected text from the active file and puts it on the Windows clip­board.
Paste Button
The Paste button pastes the current contents of the clipboard into the active file at the cur­rent cursor position.
Delete Button
The Delete button deletes selected text from the active file.
Print Button
The Print button prints the active file.
Workspace Window Button
The Workspace Window button shows or hides the Project Workspace window.
Output Window Button
The Output Window button shows or hides the Output window.

Build Toolbar

The Build toolbar allows you to build your project, set breakpoints, and select a project configuration with the following controls and buttons:
Select Build Configuration List Box – see page 27
Using the Integrated Development Environment UM013037-1212
Compile/Assemble File Button – see page 27
Build Button – see page 27
Rebuild All Button – see page 27
Stop Build Button – see page 27
Connect to Target Button – see page 28
Download Code Button – see page 28
Reset Button – see page 34
Go Button – see page 29
Insert/Remove Breakpoint Button – see page 30
Enable/Disable Breakpoint Button – see page 30
Zilog Developer Studio II – Z8 Encore!
User Manual
27
Remove All Breakpoints Button – see page 30
Figure 17. Build Toolbar
Select Build Configuration List Box
The Select Build Configuration drop-down list box lets you activate the build configura­tion for your project. See the Set Active Configuration mation.
Compile/Assemble File Button
The Compile/Assemble File button compiles or assembles the active source file.
Build Button
The Build button builds your project by compiling and/or assembling any files that have changed since the last build and then links the project.
Rebuild All Button
section on page 118 for more infor -
The Rebuild All button rebuilds all files and links the project.
Stop Build Button
The Stop Build button stops a build in progress.
UM013037-1212 Build Toolbar
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
28
Connect to Target Button
The Connect to Target button starts a debug ses sion using the following process:
1. Initializes the communication to the target hardware.
2. Resets the device.
3. Configures the device using the settings in the
4. Configures and executes the debugger options selected in the
Options dialog box. The following options are ignored if selected:
Reset to Symbol 'main' (Where Applicable) checkbox
– –
Verify File Downloads – Read After Write checkbox
Verify File Downloads – Upon Completion checkbox
Configure Target dialog box.
Debugger tab of the
This button does not download the software. Use this button to access target registers, memory, and so on without loading new code or to avoid overwriting the target’s code with the same code. This button is not enabled when the target is the simulator. This button is available only when not in
Debug mode.
For the Serial Smart Cable, ZDS II performs an on-chip debugger reset and resets the CPU at the vector reset location.
Download Code Button
The Download Code button downloads the executable file for the currently open project to the target for debugging. The button also initializes the communication to the target hardware if it has not been done yet. Starting in version 4.10.0, the ton can also program Flash memory. A page erase is done instead of a mass erase for both internal and external Flash memory. Use this button anytime during a debug session. This button is not enabled when the target is the simulator.
Download Code but-
The current code on the target is overwritten.
If ZDS II is not in
Debug mode when the Download Code button is clicked, the following
process is executed:
1. Initializes the communication to the target hardware.
2. Resets the device with a hardware reset by driving pin #2 of the debug header low.
3. Configures the device using the settings in the
Configure Target dialog box.
4. Downloads the program.
5. Issues a software reset through the debug header serial interface.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
6. Configures and executes the debugger options selected in the Debugger tab of the
Options dialog box. If it is a C project, ZDS II resets to the main function if it is
found.
29
If ZDS II is already in
Debug mode when the Download Code button is clicked, the fol-
lowing process is executed:
1. Resets the device using a software reset.
2. Downloads the program. You might need to reset the device before execution because the program counter might
have been changed after the download.
Reset Button
Click the Reset button in the Build or Debug toolbar to reset the program counter to the beginning of the program.
If ZDS II is not in ing process:
1. Initializes the communication to the target hardware.
2. Resets the device.
3. Configures the device using the settings in the
4. Downloads the program.
5. Configures and executes the debugger options selected in the
Options dialog box. If it is a C project, ZDS II resets to the main function if it is
found.
Debug mode, the Reset button starts a debug session using the follow-
Configure Target dialog box.
Debugger tab of the
If ZDS II is already in
Debug mode, the Reset button uses the following process:
1. ZDS II performs a hardware reset.
2. Configures the device using the settings in the
Configure Target dialog box.
3. If files have been modified, ZDS II asks, “Would you like to rebuild the project?”
before downloading the modified program. If there has been no file modification, the code is not reloaded.
For the Serial Smart Cable, ZDS II performs an on-chip debugger reset.
Go Button
Click the Go button to execute project code from the current program counter. If not in
1. Initializes the communication to the target hardware.
2. Resets the device.
UM013037-1212 Build Toolbar
Debug mode when the Go button is clicked, the following process is executed:
Zilog Developer Studio II – Z8 Encore! User Manual
30
3. Configures the device using the settings in the Configure Target dialog box.
4. Downloads the program.
5. Configures and executes the debugger options selected in the
Options dialog box. If it is a C project, ZDS II resets to the main function if it is
found.
6. Executes the program from the reset location.
Debugger tab of the
Insert/Remove Breakpoint Button
The Insert/Remove Breakpoint button sets a new breakpoint or removes an existing break­point at the line containing the cursor in the active file or the breakpoint must be placed on a valid code line (a C source line with a blue dot displayed in the gutter or any instruction line in the about breakpoints, see the Using Breakpoints
Disassembly window). For more information
section on page 404.
Disassembly window. A
Enable/Disable Breakpoint Button
The Enable/Disable Breakpoint button activates or deactivates the existing breakpoint at the line containing the cursor in the active file or the indicates an enabled breakpoint; a white octagon indicates a disabled breakpoint. For more information about breakpoints, see the Using Breakpoints
Disassembly window . A red octagon
section on page 404.
Remove All Breakpoints Button
The Remove All Breakpoints button deletes all breakpoints in the currently loaded project. To deactivate breakpoints in your program, use the Disable All Breakpoints button.

Find Toolbar

The Find toolbar provides access to text search functions with the following controls:
Find in Files Button – see page 30
Find Field – see page 31
Figure 18. Find Toolbar
Find in Files Button
This button opens the Find in Files dialog box, allowing you to search for text in multiple files.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
Find Field
T o locate text in the active file, enter the text in the Find field and press the Enter key. The search term is highlighted in the file. To search again, press the
Enter key again.

Command Processor Toolbar

The Command Processor toolbar allows you to execute IDE and debugger commands with the following controls:
Run Command Button – see page 31
Stop Command Button – see page 31
Command Field – see page 31
31
Figure 19. Command Processor Toolbar
See the Supported Script File Commands mands.
section on page 495 for a list of supported com-
Run Command Button
The Run Command button executes the command in the Command field. Output from the execution of the command is displayed in the
Command tab of the Output window.
Stop Command Button
The Stop Command button stops any currently running commands.
Command Field
The Command field allows you to enter a new command. Click the Run Command but­ton or press the mand is displayed in the
To modify the width of the
1. Select
2. Click in the
Enter key to execute the command. Output from the execution of the com-
Command tab of the Output window.
Command field, perform the following tasks:
Customize from the Tools menu.
Command field. A hatched rectangle highlights the Command field.
3. Use your mouse to select and drag the side of the hatched rectangle. The new size of
Command field is saved with the project settings.
the
UM013037-1212 Command Processor Toolbar
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
32

Bookmarks Toolbar

The Bookmarks toolbar allows you to set, remove, and find bookmarks with the follow­ing buttons:
Set Bookmark Button – see page 32
Next Bookmark Button – see page 32
Previous Bookmark Button – see page 32
Delete Bookmarks Button – see page 32
Figure 20. Bookmarks Toolbar
This toolbar is not displayed in the default IDE window.
Set Bookmark Button
Click the Set Bookmark button to insert a bookmark in the active file for the line at which your cursor is located.
Next Bookmark Button
Click the Next Bookmark button to position the cursor at the line at which the next book­mark in the active file is located.
Previous Bookmark Button
Click the Previous Bookmark button to position the cursor at the line at which the next bookmark in the active file is located.
Delete Bookmarks Button
Click the Delete Bookmarks button to remove all of the bookmarks in the currently loaded project.

Debug Toolbar

The Debug toolbar allows you to perform debugger functions with the followi ng buttons:
Download Code Button – see page 33
Using the Integrated Development Environment UM013037-1212
Note:
Verify Download Button – see page 34
Reset Button – see page 34
Stop Debugging Button – see page 35
Go Button – see page 35
Run to Cursor Button – see page 35
Break Button – see page 35
Step Into Button – see page 35
Step Over Button – see page 36
Step Out Button – see page 36
Set Next Instruction Button – see page 36
Zilog Developer Studio II – Z8 Encore!
User Manual
33
Insert/Remove Breakpoint Button – see page 30
Enable/Disable Breakpoint Button – see page 30
Disable All Breakpoints Button – see page 36
Remove All Breakpoints Button – see page 36
Figure 21. The Debug Toolbar
Download Code Button
The Download Code button downloads the executable file for the currently open project to the target for debugging. The button also initializes the communication to the target hardware if it has not been done yet. Starting in version 4.10.0, the ton can also program Flash memory. A page erase is done instead of a mass erase for both internal and external Flash memory. Use this button anytime during a debug session. This button is not enabled when the target is the simulator.
The current code on the target is overwritten.
Download Code but-
If ZDS II is not in process is executed:
1. Initializes the communication to the target hardware.
2. Resets the device with a hardware reset by driving pin #2 of the debug header low.
UM013037-1212 Debug Toolbar
Debug mode when the Download Code button is clicked, the following
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
34
3. Configures the device using the settings in the Configure Target dialog box.
4. Downloads the program.
5. Issues a software reset through the debug header serial interface.
6. Configures and executes the debugger options selected in the
Options dialog box. If it is a C project, ZDS II resets to the main function if it is
Debugger tab of the
found.
If ZDS II is already in
Debug mode when the Download Code button is clicked, the fol-
lowing process is executed:
1. Resets the device using a software reset.
2. Downloads the program.
You might need to reset the device before execution because the program counter might have been changed after the download.
Verify Download Button
The Verify Download button determines download correctness by comparing executable file contents to target memory.
Reset Button
Click the Reset button in the Build or Debug toolbar to reset the program counter to the beginning of the program.
If ZDS II is not in
Debug mode, the Reset button starts a debug session using the follow-
ing process:
1. Initializes the communication to the target hardware.
2. Resets the device.
3. Configures the device using the settings in the
Configure Target dialog box.
4. Downloads the program.
5. Configures and executes the debugger options selected in the
Options dialog box. If it is a C project, ZDS II resets to the main function if it is
Debugger tab of the
found.
If ZDS II is already in
Debug mode, the Reset button uses the following process:
1. ZDS II performs a hardware reset.
2. Configures the device using the settings in the
Using the Integrated Development Environment UM013037-1212
Configure Target dialog box.
Zilog Developer Studio II – Z8 Encore!
User Manual
3. If files have been modified, ZDS II asks, “Would you like to rebuild the project?”
before downloading the modified program. If there has been no file modification, the code is not reloaded.
For the Serial Smart Cable, ZDS II performs an on-chip debugger reset.
Stop Debugging Button
The Stop Debugging button ends the current debug session.
35
To stop program execution, click the
Break button.
Go Button
Click the Go button to execute project code from the current program counter. If not in
Debug mode when the Go button is clicked, the following process is executed:
1. Initializes the communication to the target hardware.
2. Resets the device.
3. Configures the device using the settings in the
Configure Target dialog box.
4. Downloads the program.
5. Configures and executes the debugger options selected in the
Options dialog box. If it is a C project, ZDS II resets to the main function if it is
Debugger tab of the
found.
6. Executes the program from the reset location.
Run to Cursor Button
The Run to Cursor button executes the program code from the current program counter to the line containing the cursor in the active file or the must be placed on a valid code line (a C source line with a blue dot displayed in the gutter or any instruction line in the
Disassembly window).
Disassembly window. The cursor
Break Button
The Break button stops program execution at the current program counter.
Step Into Button
The Step Into button executes one statement or instruction from the current program counter, following the execution into function calls. When complete, the program counter resides at the next program statement or instruction unless a function was entered, in which case the program counter resides at the first statement or instruction in the function.
UM013037-1212 Debug Toolbar
Zilog Developer Studio II – Z8 Encore! User Manual
36
Step Over Button
The Step Over button executes one statement or instruction from the current program counter without following the execution into function calls. When complete, the program counter resides at the next program statement or instruction.
Step Out Button
The Step Out button executes the remaining statements or instructions in the current func­tion and returns to the statement or instruction following the call to the current function.
Set Next Instruction Button
The Set Next Instruction button sets the program counter to the line containing the cursor in the active file or the
Insert/Remove Breakpoint Button
Disassembly window.
The Insert/Remove Breakpoint button sets a new breakpoint or removes an existing breakpoint at the line containing the cursor in the active file or the A breakpoint must be placed on a valid code li ne (a C source line with a blue dot displayed in the gutter or any instruction line in the about breakpoints, see the Using Breakpoints
Disassembly window). For more information
section on page 404.
Disassembly window.
Enable/Disable Breakpoint Button
The Enable/Disable Breakpoint button activates or deactivates the existing breakpoint at the line containing the cursor in the active file or the indicates an enabled breakpoint; a white octagon indicates a disabled breakpoint. For more information about breakpoints, see the Using Breakpoints
Disassembly window . A red octagon
section on page 404.
Disable All Breakpoints Button
The Disable All Breakpoints button deactivates all breakpoints in the currently loaded project. To delete breakpoints from your program, use the ton.
Remove All Breakpoints but-
Remove All Breakpoints Button
The Remove All Breakpoints button deletes all breakpoints in the currently loaded proj­ect. To deactivate breakpoints in your program, use the
Disable All Breakpoints button.

Debug Windows Toolbar

The Debug Windows toolbar allows you to display the Debug windows with the follow­ing buttons:
Registers Window Button – see page 37
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
Special Function Registers Window Button – see page 37
Clock Window Button – see page 37
Memory Window Button – see page 37
Watch Window Button – see page 37
Locals Window Button – see page 38
Call Stack Window Button – see page 38
Symbols Window Button – see page 38
Disassembly Window Button – see page 38
Simulated UART Output Window Button – see page 38
User Manual
37
Figure 22. Debug Windows Toolbar
Registers Window Button
The Registers Window button displays or hides the Registers window. This window is described in the Registers Window
section on page 388.
Special Function Registers Window Button
The Special Function Registers Wind ow button displays or hides the Special Fu nction
Registers
section on page 389.
window. This window is described in the Special Function Registers Window
Clock Window Button
The Clock Window button displays or hides the Clock window . This window is described in the Clock Window
section on page 390.
Memory Window Button
The Memory Window button displays or hides the Memory window. This window is described in the Memory Window
section on page 391.
Watch Window Button
The Watch Window button displays or hides the Watch window. This window is described in the Watch Window
UM013037-1212 Debug Windows Toolbar
section on page 397.
Zilog Developer Studio II – Z8 Encore! User Manual
38
Locals Window Button
The Locals Window button displays or hides the Locals window. This window is described in the Locals Window
Call Stack Window Button
The Call Stack Window button displays or hides the Call Stack window. This window is described in the Call Stack Window
Symbols Window Button
The Symbols Window button displays or hides the Symbols window. This window is described in the Symbols Window
Disassembly Window Button
section on page 399.
section on page 400.
section on page 401.

Windows

Project Workspace Window

The Disassembly Window button displays or hides the Disassembly window. This win- dow is described in the Disassembly Window
section on page 402.
Simulated UART Output Window Button
The Simulated UART Output Window button displays or hides the Simulated UART
Output
tion on page 403.
The following ZDS II windows allow you to see various aspects of the tools while working with your project:
The Project Workspace window on the left side of the developer’s environment allows you to view your project files.
window. This window is described in the Simulated UART Output Window sec-
Project Workspace Window – see page 38 Edit Window – see page 40 Output Windows – see page 44
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
39
Figure 23. Project Workspace Window for Standard Projects
Figure 24. Project Workspace Window for Assembly Only Projects
The Project Workspace window provides access to related functions using context menus. To access context menus, right-click a file or folder in the window. Depending on
UM013037-1212 Project Workspace Window
Zilog Developer Studio II – Z8 Encore! User Manual
40
which file or folder is highlighted, the context menu allows you to perform the following tasks:
Dock the Project Workspace window
Hide the Project Workspace window
Add files to the project
Remove the highlighted file from the project
Build project files or external dependencies
Assemble or compile the highlighted file
Undock the Project Workspace window, allowing it to float in the Edit window

Edit Window

The Edit window on the right side of the developer’s environment allows you to edit the files in your project.
Figure 25. Edit Window
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
The Edit window supports the shortcuts listed in Table 35.
Table 35. Edit Window Shortcuts
Shortcuts Function
Ctrl + Z Undo Ctrl + Y Redo Ctrl + X Cut Ctrl + C Copy Ctrl + V Paste Ctrl + F Find F3 Repeat the previous search Ctrl + G Go to Ctrl + E
Ctrl + ]
Go to matching { or }. Place your cursor at the right or left of an opening or closing brace and press Ctrl + E or Ctrl +] to move the cursor to the matching opening or closing brace.
User Manual
41
This section covers the following topics:
Using the Context Menus – see page 41
Using Bookmarks – see page 42
Using the Context Menus
There are two context menus in the Edit window, depending on where you click. When you right-click in a file, the context menu allows you to perform the following actions (depending on whether you are running in
Cut, copy, and paste text
Show white space
Go to the Disassembly window
Show the program counter
Insert, edit, enable, disable, or remove breakpoints
Reset the debugger
Stop debugging
Start or continue running the program (Go)
Run to the cursor
Debug mode):
UM013037-1212 Edit Window
Zilog Developer Studio II – Z8 Encore! User Manual
42
Pause the debugging (Break)
Step into, over, or out of program instructions
Set the next instruction at the current line
Insert or remove bookmarks (see the Using Bookmarks section on page 42)
When you right-click outside of all files, the context menu allows you to perform the fol­lowing tasks:
Show or hide the output windows, Project Workspace window, status bar, File tool-
Build toolbar, Find toolbar, Command Processor toolbar, Debug toolbar,
bar,
Debug Windows toolbar
Toggle Workbook Mode When in
the
Customize the buttons and toolbars
Workbook mode, each open file has an associated tab along the bottom of
Edit windows area.
Using Bookmarks
A bookmark is a marker that identifies a position within a file. Bookmarks appear as cyan boxes in the gutter portion (left) of the file window. The cursor can be quickly positioned on a lines containing bookmarks.
Figure 26. Bookmark Example
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
To insert a bookmark, position the cursor on the appropriate line of the active file and per­form one of the following actions:
Right-click in the Edit window and select Insert Bookmark from the resulting context menu.
Select Toggle Bookmark from the Edit menu.
Type Ctrl+F2.
43
Figure 27. Inserting a Bookmark
To remove a bookmark, position the cursor on the line of the active file containing the bookmark to be removed and perform one of the following actions:
Right-click in the Edit window and select Remove Bookmark from the resulting con­text menu.
Select Toggle Bookmark from the Edit menu.
UM013037-1212 Edit Window
Zilog Developer Studio II – Z8 Encore! User Manual
44
Type Ctrl+F2.
To remove all bookmarks in the active file, right-click in the
Remove Bookmarks from the resulting context menu.
To remove all bookmarks in the current project, select
Edit menu.
T o position the cursor at the next bookmark in the active file, perform one of the following actions:
Right-click in the Edit window and select Next Bookmark from the resulting context menu.
Select Next Bookmark from the Edit menu.
Press the F2 key. The cursor moves forward through the file, starting at its current position and begin-
ning again when the end of file is reached, until a bookmark is encountered. If no bookmarks are set in the active file, this function has no effect.
To position the cursor at the previous bookmark in the active file, perform one of the fol­lowing actions:
Right-click in the Edit window and select Previous Bookmark from the resulting context menu.
Select Previous Bookmark from the Edit menu.
Edit window and select
Remove All Bookmarks from the
Press Shift+F2. The cursor moves backwards through the file, starting at its current position and start-
ing again at the end of the file when the file beginning is reached, until a bookmark is encountered. If no bookmarks are set in the active file, this function has no effect.

Output Windows

The Output windows display output, errors, and other feedback from various components of the Integrated Development Environment.
Select one of the tabs at the bottom of the Output windows:
Build Output Window – see page 45
Debug Output Window – see page 45
Find in Files Output Windows – see page 45
Message Output Window – see page 46
Command Output Window – see page 46
Using the Integrated Development Environment UM013037-1212
Output window to select one of following the
Zilog Developer Studio II – Z8 Encore!
User Manual
To dock the Output window with another window, click and hold the window’s grip bar and then move the window.
Double-click the window’s grip bar to cause it to become a floating window. Double-click the floating window’s title bar to change it to a dockable window.
45
Use the context menu to copy text from or to delete all text in the
Output window.
Build Output Window
The Build Output window holds all text messages generated by the compiler, assembler, librarian, and linker, including error and warning messages.
Figure 28. Build Output Window
Debug Output Window
The Debug Output window holds all text messages generated by the debugger while you
Debug mode. The Debug Output window also displays the chip revision identifier
are in and the Smart Cable firmware version.
Figure 29. Debug Output Window
Find in Files Output Windows
The two Find in Files Output windows display the results of the Find in Files command (available from the when the
Find in Files
UM013037-1212 Output Windows
Output to Pane 2 checkbox is selected in the Find in File dialog box (see the
section on page 60).
Edit menu and the Find toolbar). The File in Files 2 window is used
Zilog Developer Studio II – Z8 Encore! User Manual
46
Figure 30. Find in Files Output Window
Figure 31. Find in Files 2 Output Window
Message Output Window
The Message Output window holds informational messages intended for the user. The
Message Output window is activated (given focus) when error messages are added to the
window’s display. Warning and informational messages do not automatically activate the
Message Output window .
Figure 32. Message Output Window
Command Output Window
The Command Output window holds the output from the execution of commands.
Using the Integrated Development Environment UM013037-1212

Menu Bar

Zilog Developer Studio II – Z8 Encore!
User Manual
47
Figure 33. Command Output Window
The menu bar lists menu items that you use in the Z8 Encore! developer’s environment. Each menu bar item, when selected, displays a list of selection items. If an option on a menu item ends with an ellipsis (...), selecting the option displays a dialog box. The fol­lowing items are listed on the menu bar:
File Menu – see page 47
Edit Menu – see page 57
Vi ew Menu – see page 65
Project Menu – see page 66
Build Menu – see page 117
Debug Menu – see page 121
Tools Menu – see page 125
Window Menu – see page 145
Help Menu – see page 145

File Menu

The File menu enables you to perform basic commands in the developer’s environment:
New File – see page 48
Open File – see page 48
Close File – see page 49
New Project – see page 49
Open Project – see page 53
Save Project – see page 54
Close Project – see page 55
UM013037-1212 Menu Bar
Zilog Developer Studio II – Z8 Encore! User Manual
48
Save – see page 55
Save As – see page 55
Save All – see page 56
Print – see page 56
Print Preview – see page 56
Print Setup – see page 57
Recent Files – see page 57
Recent Projects – see page 57
Exit – see page 57
New File
Select New File from the File menu to create a new file in the Edit window.
Open File
Select Open File from the File menu to display the Open dialog box, which allows you to open the files for your project.
Figure 34. Open Dialog Box
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
To delete a file from your project, use the Open Project dialog box. Highlight the file and press the Delete key. Answer the prompt accordingly.
Close File
Select Close File from the File menu to close the selected file.
New Project
To create a new project, perform the following tasks:
49
1. Select
2. From the
New Project from the File menu. The New Project dialog box is displayed.
Figure 35. New Project Dialog Box
New Project dialog box, click the Browse button ( ) to navigate to the
directory in which you want to save your project. The box is displayed.
Select Project Name dialog
UM013037-1212 File Menu
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
50
Figure 36. Select Project Name Dialog Box
3. Use the Look In drop-down list box to navigate to the directory in which you want to
save your project.
4. In the
File Name field, enter the name of your project. You do not have to type the
extension
.zdsproj. The extension is added automatically.
The following characters cannot be used in a project name: ( ) $ , . - + [ ] ' &
5. Click
6. In the
Select to return to the New Project dialog box.
Project Type field, select Standard for a project that will include C language
source code. Select
Assembly Only for a project that will include only assembly
source code.
7. In the
8. In the
9. In the
CPU Family drop-down list box, select a product family. CPU drop-down list box, select a CPU. Build Type drop-down list box, select Executable to build an application or
select
Static Library to build a static library.
The default is more information, see the Linker: Output Page
Executable, which creates an IEEE 695 executable format (.lod). For
section on page 107.
10. Click
Using the Integrated Development Environment UM013037-1212
Continue to change the default project settings using the New Project Wizard.
To accept all default settings, click
Finish.
For static libraries, click Finish.
Note:
Zilog Developer Studio II – Z8 Encore!
User Manual
51
For a Standard project, the
New Project Wizard dialog box is displayed. For Assem-
bly-Only executable projects, continue to step 12.
Figure 37. New Project Dialog Box, Build Options
11. Select whether your project is linked to the standard C start-up module, C run-time
library, and floating-point library; select a small or large memory model (see the
Memory Models
section on page 199); select static or dynamic frames (see the Call
Frames section on page 200); and click Next.
For executable projects, the Target and Debug T ool Selection step of the
Wizard
UM013037-1212 File Menu
dialog box is displayed.
New Project
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
52
Figure 38. New Project Wizard Dialog Box, Target and Debug Tool Selection
12. Select the Use Page Erase Before Flashing checkbox if you want the internal Flash
to be page-erased. Deselect this checkbox if you want the internal Flash to be mass­erased.
13. Select the appropriate target from the Target list box.
14. Click
Setup in the Target area. Refer to the Setup section on page 111 for details on
configuring a target.
Click Add to create a new target (see the Add section on page 112) or click Copy to copy an existing target (see the Copy section on page 113).
15. Select the appropriate debug tool and (if you have not selected the Simulator) click
Setup in the Debug Tool area. Refer to the Debug Tool section on page 114 for
details about the available debug tools and how to configure them.
16. Click
Next. The Tar get Memory Configuration step of the New Project Wizard dialog
box is displayed.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
53
Figure 39. New Project Wizard Dialog Box, Target Memory Configuration
17. Enter the memory ranges appropriate for the target CPU.
18. Click
Finish.
Open Project
To open an existing project, use the following procedure:
1. Select
Open Project from the File menu. The Open Project dialog box is displayed.
UM013037-1212 File Menu
Zilog Developer Studio II – Z8 Encore!
Notes:
Note:
User Manual
54
Figure 40. Open Project Dialog Box
2. Use the Look In drop-down list box to navigate to the appropriate directory in which
your project is located.
3. Select the project to be opened.
4. Click
Open to open to open your project.
T o quickly open a project you were working in recently , see the Recent Projects section on page 57.
To delete a project file, use the
Open Project dialog box. Highlight the file and press the
Delete key. Answer the prompt accordingly.
Save Project
Select Save Project from the File menu to save the currently active project. By default, project files and configuration information are saved in a file named <project name>
.zdsproj. An alternate file extension is used if provided when the project is cre-
ated.
The <project name>.zdsproj.file contains all project data. If deleted, the project is no longer available.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
If the Save/Restore Project Workspace checkbox is selected (see the Options: General
Tab section on page 137), a file named <project name>.wsp is also created or updated
with workspace information such as window locations and bookmark details. The
.wsp
file supplements the project information. If it is deleted, the last known workspace data is lost, but this does not affect or harm the project.
Close Project
Select Close Project from the File menu to close the currently active project.
Save
Select Save from the File menu to save the active file.
Save As
To save a selected file with a new name, perform the following steps:
55
1. Select
2. Use the
Save As from the File menu. The Save As dialog box is displayed.
Figure 41. Save As Dialog Box
Save In drop-down list box to navigate to the appropriate folder.
3. Enter the new file name in the
File Name field.
4. Use the
5. Click
UM013037-1212 File Menu
Save as Type drop-down list box to select the file type.
Save. A copy of the file is saved with the name you entered.
Zilog Developer Studio II – Z8 Encore! User Manual
56
Save All
Select Save All from the File menu to save all open files and the currently loaded project.
Print
Select Print from the File menu to print the active file.
Print Preview
Select Print Preview from the File menu to display the file you want to print in Preview mode in a new window.
1. In the
2. From the
Edit window, highlight the file you want to show a Print Preview.
File menu, select Print Preview. The file is shown in Print Preview in a new
window. As shown in Figure 42,
main.c is in Print Preview mode.
Figure 42. Print Preview Window
Using the Integrated Development Environment UM013037-1212
3. To print the file, click Print.
Zilog Developer Studio II – Z8 Encore!
User Manual
57
To cancel the print preview, click window.
Print Setup
Select Print Setup from the File menu to display the Print Setup dialog box, which allows you to determine the printer’s setup before you print the file.
Recent Files
Select Recent Files from the File menu and then select a file from the resulting submenu to open a recently opened file.
Recent Projects
Select Recent Projects from the File menu and then select a project file from the result­ing submenu to quickly open a recently opened project.
Exit
Select Exit from the File menu to exit the application.
Close. The file returns to its edit mode in the Edit

Edit Menu

The Edit menu provides access to basic editing, text search, and breakpoint and bookmark manipulation features. The following options are available:
Undo – see page 58
Redo – see page 58
Cut – see page 58
Copy – see page 58
Paste – see page 58
Delete – see page 58
Select All – see page 58
Show Whitespaces – see page 58
Find – see page 59
Find Again – see page 59
Find in Files – see page 60
Replace – see page 61
UM013037-1212 Edit Menu
Zilog Developer Studio II – Z8 Encore! User Manual
58
Go to Line – see page 61
Manage Breakpoints – see page 62
Manage Abbreviations – see page 63
Toggle Bookmark – see page 65
Next Bookmark – see page 65
Previous Bookmark – see page 65
Remove All Bookmarks – see page 65
Undo
Select Undo from the Edit menu to undo the last edit made to the active file.
Redo
Select Redo from the Edit menu to redo the last edit made to the active file.
Cut
Select Cut from the Edit menu to delete selected text from the active file and put it on the Windows clipboard.
Copy
Select Copy from the Edit menu to copy selected text from the active file and put it on the Windows clipboard.
Paste
Select Paste from the Edit menu to paste the current contents of the clipboard into the active file at the current cursor position.
Delete
Select Delete from the Edit menu to delete selected text from the active file.
Select All
Choose Select All from the Edit menu to highlight all text in the active file.
Show Whitespaces
Select Show Whitespaces from the Edit menu to display all white-space characters such as spaces and tabs in the active file.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
Note:
Find
To find text in the active file, use the following procedure:
User Manual
59
1. Select
2. Enter the text to search for in the
Find from the Edit menu. The Find dialog box is displayed.
Figure 43. Find Dialog Box
Find What field or select a recent entry from the
Find What drop-down list box. (By default, the currently selected text in a source file
or the text in which your cursor is located in a source file is displayed in the
What
field.)
3. Select the
Match Whole Word Only checkbox if you want to ignore the search text
when it occurs as part of longer words.
4. Select the
Match Case checkbox if you want the search to be case-sensitive
Find
5. Select the
6. Select the direction of the search with the
7. Click
Regular Expression checkbox if you want to use regular expressions.
Up or Down button.
Find Next to jump to the next occurrence of the search text or click Mark All to
display a cyan box next to each line containing the search text.
After clicking Find Next, the dialog box closes. You can press the F3 key or use the Find
Again
command to find the next occurrence of the search term without displaying the Find
dialog box again.
Find Again
Select Find Again from the Edit menu to continue searching in the active file for text pre­viously entered in the
UM013037-1212 Edit Menu
Find dialog box.
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
60
Find in Files
This function searches the contents of the files on disk; therefore, unsaved data in open files are not searched.
To find text in multiple files, use the following procedure:
1. Select
2. Enter the text to search for in the
Find in Files from the Edit menu. The Find in Files dialog box is displayed.
Figure 44. Find in Files Dialog Box
Find field or select a recent entry from the Find
drop-down list box. (If you select text in a source file before displaying the log box, the text is displayed in the
3. Select or enter the file type(s) to search for in the
Find field.)
In File Types drop-down list box.
Separate multiple file types with semicolons.
4. Use the
Browse button ( ) or the In Folder drop-down list box to select the loca-
tion of the files that you want to search.
Find dia-
5. Select the
Match Whole Word Only checkbox if you want to ignore the search text
when it occurs as part of longer words.
6. Select the
7. Select the
8. Select the
Find in Files 2 Output window. If this button is not selected, the search results are
displayed in the
9. Click
Using the Integrated Development Environment UM013037-1212
Match Case checkbox if you want the search to be case-sensitive. Look in Subfolders checkbox if you want to search within subfolders. Output to Pane 2 checkbox if you want the search results displayed in the
Find in Files Output window.
Find to start the search.
Zilog Developer Studio II – Z8 Encore!
Replace
To find and replace text in an active file, use the following procedure:
User Manual
61
1. Select
2. Enter the text to search for in the
Replace from the Edit menu. The Replace dialog box is displayed.
Figure 45. Replace Dialog Box
Find What field or select a recent entry from the
Find What drop-down list box. (By default, the currently selected text in a source file
or the text in which your cursor is located in a source file is displayed in the
What
field.)
3. Enter the replacement text in the
Replace With drop-down list box.
4. Select the
Match Whole Word Only checkbox if you want to ignore the search text
Replace With field or select a recent entry from the
when it occurs as part of longer words.
Find
5. Select the
6. Select the
Match Case checkbox if you want the search to be case-sensitive. Regular Expression checkbox if you want to use regular expressions.
7. Select whether you want the text to be replaced in text currently selected or in the
whole file.
8. Click
Find Next to jump to the next occurrence of the search text and then click
Replace to replace the highlighted text or click Replace All to automatically replace
all instances of the search text.
Go to Line
To position the cursor at a specific line in the active file, select Go to Line from the Edit menu to display the
UM013037-1212 Edit Menu
Go to Line Number dialog box.
Zilog Developer Studio II – Z8 Encore! User Manual
62
Enter the appropriate line number in the edit field and click Go To.
Manage Breakpoints
To view, go to, or remove breakpoints, select Manage Breakpoints from the Edit menu. You can access the dialog box during
Figure 46. Go to Line Number Dialog Box
Debug mode and Edit mode.
Figure 47. Breakpoints Dialog Box
Breakpoints dialog box, shown in Figure 47, lists all existing breakpoints for the cur -
The rently loaded project. A check mark in the box to the left of the breakpoint description indicates that the breakpoint is enabled. The remainder of this section describes the action­able features of the
Breakpoints dialog.
Go to Code
To move the cursor to a particular breakpoint you have set in a file, highlight the break­point in the
Breakpoints dialog box and click Go to Code.
Enable All
To make all listed breakpoints active, click
Enable All. Individual breakpoints can be
enabled by clicking in the box to the left of the breakpoint description. Enabled break­points are indicated by a check mark in the box to the left of the breakpoint description.
Using the Integrated Development Environment UM013037-1212
Disable All
Note:
Zilog Developer Studio II – Z8 Encore!
User Manual
63
To make all listed breakpoints inactive, click
Disable All. Individual breakpoints can be
disabled by clicking in the box to the left of the breakpoint description. Disabled break­points are indicated by an empty box to the left of the breakpoint description.
Remove
To delete a particular breakpoint, highlight the breakpoint in the and click
Remove.
Breakpoints dialog box
Remove All
To delete all of the listed breakpoints, click
Remove All.
For more information about breakpoints, see the Using Breakpoints section on page 404.
Manage Abbreviations
An abbreviation is a shortened word that can be assigned to an expansion. An expansion can be a single line of code, a code block or a comment section, such as a function/file header, and can even be a combination of code and comments. To learn more, see the
Abbreviations and Expansions
T o manage abbreviations, select
viations
dialog box is displayed as shown in Figure 48. The remainder of this section
briefly describes the actionable features of the
section on page 161.
Manage Abbreviations from the Edit menu. The Abbre-
Manage Abbreviations dialog.
UM013037-1212 Edit Menu
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
64
f
Figure 48. Abbreviations Dialog Box
Abbreviation
Select an abbreviation from the abbreviation and expansion pair in the
Abbreviation: drop-down menu to display a current
Expansion: panel.
Add
Enter a new abbreviation in the segment that you wish to associate with this abbreviation into the
Add button to add the new abbreviation and expansion pair to the list of current abbre-
the
Abbreviation: drop-down menu, then enter the entire code
Expansion: panel. Click
viations.
Insert In File
Click the
Insert In File button to add an abbreviation and expansion pair to your codeset.
The expansion text will be inserted into the active open file at the current cursor position.
Remove
Click the
Remove button to delete an abbreviation and expansion pair from the list of cur-
rent abbreviations.
You cannot restore an abbreviation after it is deleted.
Using the Integrated Development Environment UM013037-1212
Save
Note:
Note:
Zilog Developer Studio II – Z8 Encore!
User Manual
65
Click the rent abbreviations.
Close
Click the
Save button to save the new abbreviation and expansion pair to the list of cur-
Close button to close the dialog.
Toggle Bookmark
Select Toggle Bookmark from the Edit menu to insert a bookmark in the active file for the line in which your cursor is located or to remove the bookmark for the line in which your cursor is located.
Next Bookmark
Select Next Bookmark from the Edit menu to position the cursor at the line in which the next bookmark in the active file is located.
The search for the next bookmark does not stop at the end of the file; the next bookmark might be the first bookmark in the file.
Previous Bookmark
Select Previous Bookmark from the Edit menu to position the cursor at the line in which the previous bookmark in the active file is located.
The search for the previous bookmark does not stop at the beginning of the file; the previ­ous bookmark might be the last bookmark in the file.
Remove All Bookmarks
Select Remove All Bookmarks from the Edit menu to delete all of the bookmarks in the currently loaded project.

View Menu

The V iew menu allows you to select the windows yo u want on the Z8 Encore! develo per’s environment.
The View menu contains these options:
Debug Windows – see page 66
UM013037-1212 View Menu
Zilog Developer Studio II – Z8 Encore! User Manual
66
Workspace – see page 66
Output – see page 66
Stat us Bar – see page 66
Debug Windows
When you are in Debug mode (running the debugger), you can select any of the ten de bug windows. From the window.
The Debug Windows submenu contains the following elements:
Registers Window – see page 388
Special Function Registers Window – see page 389
Clock Window – see page 390
View menu, select Debug Windows and then the appropriate debug
Memory Window – see page 391
Watch Window – see page 397
Locals Window – see page 399
Call Stack Window – see page 400
Symbols Window – see page 401
Disassembly Window – see page 402
Simulated UART Output Window – see page 403
Workspace
Select Workspace from the View menu to display or hide the Project Workspace win­dow.
Output
Select Output from the View menu to display or hide the Output windows.
Status Bar
Select Status Bar from the View menu to display or hide the status bar, which resides beneath the Output windows.

Project Menu

The Project menu allows you to add to your project, remove files from your project, set configurations for your project, and export a make file.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
The Project menu contains the following options:
Add Files – see page 67
Remove Selected File(s) – see page 67
Settings – see page 68
Export Makefile – see page 116
Add Files
To add files to your project, use the following procedure:
User Manual
67
1. From the
played.
2. Use the
the files you want to add are saved.
Project menu, select Add Files. The Add Files to Project dialog box is dis-
Figure 49. Add Files to Project Dialog Box
Look In drop-down list box to navigate to the appropriate directory in which
3. Click the file you want to add or highlight multiple files by clicking on each file while
holding down the Shift or Ctrl key.
4. Click
Add to add these files to your project.
Remove Selected File(s)
Select Remove Selected File(s) from the Project menu to delete highlighted files in the
Project Workspace window.
UM013037-1212 Project Menu
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
68
Settings
Select Settings from the Project menu to display the Project Settings dialog box, which allows you to change your active configuration as well as set up your project.
Select the active configuration for the project in the upper left corner of the Release configurations are predefined. For more informa tion a bout proje ct co nfig uratio ns such as adding your own configuration, see the
118. The Project Settings dialog box features a number of different pages you must use to set
up the project:
General Page – see page 69
Assembler Page – see page 71
C: Code Generation Page – see page 74 (not available for Assembly Only projects)
C: Listing Files Page – see page 78 (not available for Assembly Only projects)
C: Preprocessor Page – see page 80 (not available for Assembly Only projects)
C: Advanced Page – see page 82 (not available for Assembly Only projects)
C: Deprecated Page – see page 86 (not available for Assembly Only projects)
Librarian Page – see page 91 (available for Static Library projects only)
ZSL Page – see page 92 (not available for Assembly Only projects)
Linker: Commands Page – see page 94 (available for Executable projects only)
Linker: Objects and Libraries Page
only)
Project Settings
dialog box. For your convenience, the Debug a nd
– see page 98 (available for Executable projects
Configuration
Set Active Configuration
drop-down list box in the
section on page
Linker: Address Spaces Page – see page 103 (available for Executable projects only)
Linker: Warnings Page – see page 106 (available for Executable projects only)
Linker: Output Page – see page 107 (available for Executable projects only)
Debugger Page – see page 110 (available for Executable projects only)
Project Settings dialog box provides various project configuration pages that can be
The accessed by selecting the page name in the pane on the left side of the dialog box. There are several pages grouped together for the C (Compiler) and Linker that allow you to set up subsettings for those tools.
If you change project settings that affect the build, the following message is displayed when you click
Using the Integrated Development Environment UM013037-1212
OK to exit the Project Settings dialog box: “The project settings
Zilog Developer Studio II – Z8 Encore!
User Manual
have changed since the last build. Would you like to rebuild the affected files?” Click Yes to save and then rebuild the project.
General Page
From the Project Settings dialog box, select the General page. The options on the Gen-
eral
page are described in this section.
69
Figure 50. General Page of the Project Settings Dialog Box
CPU Family
CPU Family drop-down list box allows you to select the appropriate Z8 Encore! fam-
The ily. For a list of CPU families, see the Z8 Encore! Product Support
UM013037-1212 Project Menu
section on page 3.
Zilog Developer Studio II – Z8 Encore!
Note:
Note:
User Manual
70
CPU
The
CPU drop-down list box defines which CPU you want to define for the target. For a
list of CPUs, see the Z8 Encore! Product Support
section on page 3.
T o change the CPU for your project, select the appropriate CPU in the
CPU drop-down list
box.
Selecting a CPU does not automatically select include files for your C or assembly source code. Include files must be manually included in your code. Selecting a new CPU automat­ically updates the compiler preprocessor defines, assembler defines, and, where necessary, the linker address space ranges and selected debugger target based on the selected CPU.
Show Warnings
The
Show Warnings checkbox controls the display of warning messages during all
phases of the build. If the checkbox is enabled, warning messages from the assembler, compiler, librarian, and linker are displayed during the build. If the checkbox is disabled, all of these warnings are suppressed.
Generate Debug Information
Generate Debug Information checkbox makes the build generate debug informatio n
The that can be used by the debugger to allow symbolic debugging. Enable this option if you are planning to debug your code using the debugger. The checkbox enables debug infor­mation in the assembler, compiler, and linker.
Enabling this option usually increases your overall code size by a moderate amount for two reasons. First, if your code makes any calls to the C run-time libraries, the library ver­sion used is the one that was built using the Limit Optimizations for Easier Debugging set­ting (see the Limit Optimizations for Easier Debugging
section on page 77). Second, the generated code sets up the stack frame for every function in your own program. Many functions (those whose parameters and local variables are not too numerous and do not have their addresses taken in your code) would not otherwise require a stack frame in the Z8 Encore! architecture, so the code for these functions is slightly smaller if this checkbox is disabled.
This checkbox interacts with the Limit Optimizations for Easier Debugging chec kbox on
Code Generation page (see the Limit Optimizations for Easier Debugging section on
the page 77). When the debug information is always generated so that debugging can be performed. The
Debug Information Easier Debugging ging
checkbox is later deselected (even in a later ZDS II session), the Generate Debug
Using the Integrated Development Environment UM013037-1212
Limit Optimizations for Easier Debugging checkbox is selected,
Generate
checkbox is grayed out (disabled) when the Limit Optimizations for
checkbox is selected. If the Limit Optimizations for Easier Debug-
Zilog Developer Studio II – Z8 Encore!
User Manual
Information checkbox returns to the setting it had before the Limit Optimizations for Eas­ier Debugging checkbox was selected.
Ignore Case of Symbols
71
When the
Ignore Case of Symbols checkbox is enabled, the assembler and linker ignore
the case of symbols when generating and linking code. This checkbox is occasionally needed when a project contains source files with case-insensitive labels. This checkbox is only available for Assembly Only projects with no C code.
Intermediate Files Directory
This directory specifies the location in which all intermediate files produced during the build will be located. These files include make files, object files, and generated assembly source files and listings that are generated from C source code. This field is provided pri­marily for the convenience of users who might want to delete these files after building a project, while retaining the built executable and other, more permanent files. Those files are placed into a separate directory specified in the
Output page (see the Linker: Output
Page section on page 107).
Assembler Page
In the Project Settings dialog box, select the Assembler page. The assembler uses the contents of the assembled.
The options on the
Assembler page to determine which options are to be applied to the files
Assembler page are described in this section.
UM013037-1212 Project Menu
Zilog Developer Studio II – Z8 Encore! User Manual
72
Figure 51. Assembler Page of the Project Settings Dialog Box
Includes
The
Includes field allows you to specify the series of paths for the assembler to use when
searching for include files. The assembler first checks the current directory, then the paths in the
Includes field, and finally on the default ZDS II include directories.
The following is the ZDS II default include directory:
<ZDS Installation Directory>\include\std
In the above filepath, <ZDS Installation Directory> is the directory in which Zilog Devel­oper Studio was installed. By default, this directory is:
C:\Program Files\Zilog\ZDSII_Z8Encore!_<version>
In the above filepath, <version> may be 4.11.0 or 5.0.0.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
Defines
The
Defines field is equivalent to placing <symbol> EQU <value> in your assembly source
code. It is useful for conditionally built code. Each defined symbol must have a corre­sponding value (<name>=<value>). Multiple symbols can be defined and must be sepa­rated by commas.
Generate Assembly Listing Files (.lst)
73
When selected, the
Generate Assembly Listing Files (.lst) checkbox tells the assembler
to create an assembly listing file for each assembly source code module. This file displays the assembly code and directives, as well as the hexadecimal addresses and op codes of the generated machine code. The assembly listing files are saved in the directory specified by the Intermediate
Files Directory field in the General page (see the Intermediate Files
Directory section on page 71). By default, this checkbox is selected.
Expand Macros
When selected, the
Expand Macros checkbox tells the assembler to expand macros in the
assembly listing file.
Page Width
When the assembler generates the listing file, the
Page Width field sets the maximum
number of characters on a line. The default is 80; the maximum width is 132.
Page Length
When the assembler generates the listing file, the
Page Length field sets the maximum
number of lines between page breaks. The default is 56.
Jump Optimization
When selected, the
Jump Optimization checkbox allows the assembler to replace relative
jump instructions (JR and DJNZ) with absolute jump instructions when the target label is either
outside of the +127 to –128 range For example, when the target is out of range, the assembler changes
DJNZ r0, lab
to
DJNZ r0, lab1 JR lab2 lab1:JP lab lab2:
external to the assembly file
UM013037-1212 Project Menu
Zilog Developer Studio II – Z8 Encore!
Note:
User Manual
74
When the target label is external to the assembly file, the assembler always assumes that the target address is out of range.
It is usually preferable to allow the assembler to make these replacements because if the target of the jump is out of range, the assembler would otherwise not be able to generate correct code for the jump. However, if you are very concerned about monitoring the code size of your assembled application, you can deselect the You will then get an error message (from the assembler if the target label is in the same assembly file or from the linker if it is not) every time the assembler is unable to reach the target label with a relative jump. This might give you an opportunity to try to tune your code for greater efficiency.
The default is checked.
C: Code Generation Page
Jump Optimization checkbox.
For Assembly Only projects, the Code Generation page is not available.
The options in the
Code Generation page are described in this section.
Using the Integrated Development Environment UM013037-1212
Zilog Developer Studio II – Z8 Encore!
User Manual
75
Figure 52. Code Generation Page of the Project Settings Dialog Box
When this page is selected, the fundamental options related to code generation are shown at the bottom of the dialog box: Limit Optimizations for Easier Debugging, Memory Model, and Frames. For convenience, three of the most commonly used combinations of these options can be obtained by clicking one of the radio buttons: Safest, Small and Debuggable, or Smallest Possible. When one of these radio button settings is selected, the fundamental options in the bottom of the dialog box are updated to show their new values, but they are not available for individual editing. To edit the fundamental options individu­ally, select the
User Defined button. You can then update the fundamental settings to any
combination you prefer.
Safest
The Safest configuration sets the following values for the individual options: the
Optimizations for Easier Debugging
used, if available (see the Memory Model
UM013037-1212 Project Menu
checkbox is selected; the large memory model is
section on page 77); the frames are dynamic.
Limit
Zilog Developer Studio II – Z8 Encore! User Manual
76
This is the safest possible configuration in that using the l ar ge model avoid s possi ble prob­lems with running out of data space in the small model, and using dynamic frames avoids potential problems with static frames due to the use of recursion or function pointers. Also, because the optimizations are limited, you can proceed to debug your application with ease. However, this configuration definitely produces larger code than other combi­nations. Many users select this configuration initially when porting applications to Z8 Encore! so that they do not have to worry immediately about whether their projects can meet the requirements for using the small model or static frames. Particularly large and complex applications also often must use this configuration (perhaps deselecting the
Optimizations for Easier Debugging
Small and Debuggable
The Small and Debuggable configuration sets the following values for the individual options:
Limit Optimizations for Easier Debugging checkbox is selected; the memory
model is small; the frames are static. This is the same as the Smallest Possible configura­tion, except that optimizations are reduced to allow easier debugging. The other caveats to using the Smallest Possible configuration also apply to this configuration. If you can meet the other restrictions required by the Smallest Possible configuration, you might find it useful to work with this configuration when you are debugging the code and then switch to the Smallest Possible configuration for a production build.
Limit
checkbox for production builds).
Smallest Possible
This configuration sets the following values for the individual options:
tions for Easier Debugging
checkbox is deselected; the memory model is small; the
Limit Optimiza-
frames are static. This configuration generates the smallest possible code size, but this configuration does not work for every project. It is your responsibility to make sure these settings will work for you.
There are three issues to be aware of. First, all optimizations are applied, which can make debugging somewhat confusing; if this becomes troublesome, try changing to the Small But Debuggable configuration. Second, the use of the small model restricts the amount of data space that is available, which could cause problems; see the Memory Models
section on page 199 for details. Third, static frames can only be used if your entire application obeys certain restrictions, which are described in the Call Frames
section on page 200.
User Defined
When the User Defined configuration is selected, the individual settings for the Limit Optimizations for Easier Debugging, Memory Model, and Frames options can be changed individually. This gives you the maximum freedom to set up your project as you choose and to experiment with all possible settings.
Using the Integrated Development Environment UM013037-1212
Loading...