Zilog Z80380 Manual de usuario

Busca en linea o descarga Manual de usuario para Sensores Zilog Z80380. Zilog Z80380 User Manual Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 116
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente

Indice de contenidos

Pagina 1 - User’s Manual

UM004001-COR1103380 C-CompilerUser’s Manual

Pagina 3 - ABOUT THIS MANUAL

ASCII Character SetB–6 UM004001-COR1103p 112 70 Lowercase Pq 113 71 Lowercase Qr 114 72 Lowercase Rs 115 73 Lowercase St 116 74 Lowercase Tu 117 75 L

Pagina 4

UM004001-COR1103 C–1380 C-COMPILER USER’S MANUALAPPENDIX C PROBLEM/SUGGESTION REPORT FORMIf you experience any problems while using this product, or i

Pagina 6 - Linking Files

UM004001-COR1103 Glossary-1380 C-COMPILER USER’S MANUALGLOSSARYAABS Absolute ValueAddress Space Physical or logical area of the target system’s Memory

Pagina 7 - Run Time Environment

GlossaryGlossary-2 UM004001-COR1103Bit A digit of a binary system. It has only two possible values: 0 or 1.BPS Bits Per Second. Number of binary digi

Pagina 8

UM004001-COR1103 Glossary-3GlossaryControl Section A continuous logical area containing code or user data. Each control section has a name. The linke

Pagina 9 - LIST OF TABLES

GlossaryGlossary-4 UM004001-COR1103IM Immediate Data Addressing Mode.IMASK Interrupt Mask Register.IMR Interrupt Mask Register.INC Increment.INCW Incr

Pagina 10

UM004001-COR1103 Glossary-5GlossaryJP Jump.JR Jump Range.Library A File Created by a Librarian. This file contains a collection of object modules that

Pagina 11 - LIST OF FIGURES

GlossaryGlossary-6 UM004001-COR1103OPC Operation Code.Op Code Operation Code.OTP One-Time Programmable.PCON Port configuration register.PER Peripheral

Pagina 12

UM004001-COR1103 Glossary-7GlossaryPublic/Global Symbol A programming variable that is available to more than one program file.PUSH Store a Value In t

Pagina 13 - INTRODUCTION

UM004001-COR1103 xiFigure Page380 C-COMPILER USER’S MANUALLIST OF FIGURESFIGURE 1-1 DEVELOPMENT FLOW . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 14 - ZDS ENVIRONMENT

GlossaryGlossary-8 UM004001-COR1103SMR Stop Mode Recovery.SN Serial Number.SOIC Small Outline IC.SP Stack Pointer.SPH Stack Pointer High.SPI Serial Pe

Pagina 15 - MINIMUM REQUIREMENTS

UM004001-COR1103 Glossary-9GlossarySWI Software Interrupt.Symbol Definition Symbol defined when the symbol name is associ- ated with a certain amount

Pagina 16 - REGISTRY KEYS

GlossaryGlossary-10 UM004001-COR1103USART Universal Synchronous/Asynchronous Receiver/Transmitter. Can handle synchronous as well as asynchronous tra

Pagina 17 - INSTALLING ZDS

UM004001-COR1103 Glossary-11GlossaryZASM ZiLOG Assembler. ZiLOG’s program development environment for DOS.ZDS ZiLOG Developer Studio. ZiLOG’s program

Pagina 19 - Introduction Sample Session

UM004001-COR1103 Index-1380 C-COMPILER USER’S MANUALINDEXA–DASCII Character Set . . . . . . . . . . . .B-1Assembly FileGeneration . . . . . . . . . .

Pagina 20 - Create a File

IndexIndex-2 UM004001-COR1103strpbrk function . . . . . . . . . . . . 4-19strrchr function. . . . . . . . . . . . . 4-20strspn function . . . . . . .

Pagina 22 - 1–10 UM004001-COR1103

UM004001-COR1103 1–1380 C-COMPILER USER’S MANUALCHAPTER 1 INTRODUCTIONINTRODUCTIONThe 380 C-Compiler conforms to the ANSI’s definition of a “freestand

Pagina 23 - CONFIGURE SETTINGS

Introduction Introduction1–2 UM004001-COR1103FIGURE 1-1. DEVELOPMENT FLOWZDS ENVIRONMENTZiLOG Developer Studio is an integrated development environme

Pagina 24 - • Optimization levels

UM004001-COR1103 1–3Introduction Minimum Requirements• Build and link a project file• Compile, assemble and link files• Prepare code for ROM release (

Pagina 25 - UM004001-COR1103 1–13

Installing the 380 C-compiler Introduction1–4 UM004001-COR1103INSTALLING THE 380 C-COMPILERTo install the 380 C-Compiler, insert the 380 C-Compiler CD

Pagina 26 - Configuring Warnings

INSTALLING ZDSPerform the following steps to install ZDS: 1. Insert the ZiLOG Developer Studio CD-ROM into the host CD ROM drive. The Emulator Softwa

Pagina 27 - UM004001-COR1103 1–15

Sample Session Introduction1–6 UM004001-COR1103SAMPLE SESSIONThe 380 C-Compiler is a modular component that is part of the ZDS development environ-men

Pagina 28 - 1–16 UM004001-COR1103

UM004001-COR1103 1–7Introduction Sample Session9. Click Save. The file name appears in the Project Name field in the New Project dialog box.10.Select

Pagina 29

ii UM004001-COR1103©2003 by ZiLOG, Inc. All rights reserved. No part of this document may be copied or reproduced in any form or by any means without

Pagina 30 - Code Generation Configuration

Sample Session Introduction1–8 UM004001-COR11032. Select Set default include path to compiler settings in the Settings window. Selecting this option s

Pagina 31 - COMPILE A PROJECT

UM004001-COR1103 1–9Introduction Sample Session5. Type the following code in the edit window:#include <stdlib.h>int randnum;int main(){ srand

Pagina 32 - DOWNLOADING A COMPILED FILE

Sample Session Introduction1–10 UM004001-COR11037. Hold the Control key and select the following files:– libc.lib (standard C library) – lhf.lib (libr

Pagina 33 - TECHNICAL SUPPORT

UM004001-COR1103 1–11Introduction Sample Session16.Type the following code in the edit window:#include <stdlib.h>int randnum;int main(){ sran

Pagina 34

Sample Session Introduction1–12 UM004001-COR1103• Warnings• Optimization levels• Preprocessor symbol definitions• Code generation configurationPerform

Pagina 35 - OVERVIEW

UM004001-COR1103 1–13Introduction Sample Session• The Generate debug information option generates symbolic debug information in the output object modu

Pagina 36 - DEFAULT MEMORY QUALIFIERS

Sample Session Introduction1–14 UM004001-COR1103Configuring WarningsThe C-Compiler Optimizations page allows the user to control the informational and

Pagina 37 - I/O ADDRESS SPACES

UM004001-COR1103 1–15Introduction Sample SessionConfiguring Optimization LevelsThe C-Compiler Optimizations page allows the user to select an optimiza

Pagina 38 - ACCCESING I/O ADDRESS SPACE

Sample Session Introduction1–16 UM004001-COR1103• The Level 2 optimization option performs:– constant propagation– copy propagation– dead code elimina

Pagina 39 - INTERRUPT FUNCTIONS

UM004001-COR1103 1–17Introduction Sample SessionDefining Preprocessor SymbolsThe C-Compiler Preprocessor page allows you to define preprocessor defini

Pagina 40 - COMMAND LINE FORMAT

UM004001-COR1103 iii380 C-COMPILER USER’S MANUAL PREFACEABOUT THIS MANUALWe recommend that you read and understand everything in this manual before s

Pagina 41 - COMMAND LINE SWITCHES

Sample Session Introduction1–18 UM004001-COR1103• The Additional Include Directories field is used to enter additional search paths the C-compiler sho

Pagina 42 - COMMAND LINE EXAMPLES

UM004001-COR1103 1–19Introduction Compiling and DownloadingCOMPILING AND DOWNLOADINGThe following section shows how to compile a C file using ZDS and

Pagina 43 - • Level 2 optimization

Compiling and Downloading Introduction1–20 UM004001-COR1103DOWNLOADING A COMPILED FILEPerform the following steps to load the a HEX file.NOTE: A term

Pagina 44 - LEVEL 2 OPTIMIZATIONS

UM004001-COR1103 1–21Introduction Technical SupportDownload a HEX filePerform the following steps to download a HEX file into the EEPROM memory on top

Pagina 46 - OBJECT SIZES

UM004001-COR1103 2–1380 C-COMPILER USER’S MANUALCHAPTER 2 C-COMPILER OVERVIEWOVERVIEWThe 380 C compiler is an optimizing compiler that translates stan

Pagina 47 - • Code Section (.text)

Language Extensions C-Compiler Overview2–2 UM004001-COR1103– Support for interrupt functions– Intrinsic functions are provided for in-line assembly.•

Pagina 48 - INCORPORATING C WITH ASSEMBLY

UM004001-COR1103 2–3C-Compiler Overview pointers POINTERSA pointer to a qualified memory type can not be converted to a different qualified memory typ

Pagina 49 - Referenced C file

I/O ADDRESS SPACES C-Compiler Overview2–4 UM004001-COR1103ACCCESING I/O ADDRESS SPACEThe Z380 instruction set does not allow indirect acess of the int

Pagina 50

UM004001-COR1103 2–5C-Compiler Overview INTERRUPT FUNCTIONSINTERRUPT FUNCTIONSInterrupt functions are declared by preceding their definition with #pra

Pagina 52

INTERRUPT FUNCTIONS C-Compiler Overview2–6 UM004001-COR1103USING THE DOS COMMAND LINEThe z380 C compiler can be invoked from the DOS command line.COMM

Pagina 53 - • COFF Format Executable File

UM004001-COR1103 2–7C-Compiler Overview INTERRUPT FUNCTIONSCOMMAND LINE SWITCHESThe following command-line switches are recognized.TABLE 2-2. COMMAND

Pagina 54 - USING THE LINKER IN ZDS

INTERRUPT FUNCTIONS C-Compiler Overview2–8 UM004001-COR1103NOTE: Other switches are for ZiLOG use only in this version.COMMAND LINE EXAMPLESCompiling

Pagina 55

UM004001-COR1103 2–9C-Compiler Overview Optimization LevelsOPTIMIZATION LEVELSThe Z380 C-compiler allows the user to manually specify the level of opt

Pagina 56 - LINKER SYMBOLS

Optimization Levels C-Compiler Overview2–10 UM004001-COR1103Level 1 OptimizationsThe following is a description of the optimizations that are performe

Pagina 57 - LINKER COMMAND FILE

UM004001-COR1103 2–11C-Compiler Overview Understanding errorsJump to Jump OptimizationTargets in the control statement are replaced by the ultimate ta

Pagina 58 - Linker Command DEFINE

Included Files C-Compiler Overview2–12 UM004001-COR1103INCLUDED FILESA path to included files must be defined before the C-Compiler can recognize incl

Pagina 59

UM004001-COR1103 2–13C-Compiler Overview Section NamesSECTION NAMESThe compiler places code and data into separate sections in the object file. Every

Pagina 60 - LINKER COMMAND LINE

Incorporating Assembly with C C-Compiler Overview2–14 UM004001-COR1103INCORPORATING ASSEMBLY WITH CThe Z380- C-Compiler allows the user to incorporate

Pagina 61 - COMMAND LINE SPECIFICATIONS

UM004001-COR1103 2–15C-Compiler Overview Incorporating C with assemblycall.ib _imul; (hl)=productadd sp,4; clean the stackret; return result in (hl)Re

Pagina 62 - LINKER COMMAND LINE OPTIONS

UM004001-COR1103 vChapter Title and Subsections Page380 C-COMPILER USER’S MANUALTABLE OF CONTENTSChapter 1 IntroductionINTRODUCTION . . . . . . . .

Pagina 64 - COMMAND LINE OPTIONS

UM004001-COR1103 3–1380 C-COMPILER USER’S MANUALCHAPTER 3 LINKING FILESINTRODUCTIONThe purpose of the Zilog cross linker is to read relocatable object

Pagina 65 - CHAPTER 4

Introduction Linking Files3–2 UM004001-COR1103• Reads in Relocatable object modules and library files in Common Object File Format (COFF) or ZiLOG Obj

Pagina 66 - IGURE 4-1. FRAME LAYOUT

UM004001-COR1103 3–3Linking Files Using the Linker with the C-compilerOutputting OMF FilesDepending upon the options specified by the user, the linker

Pagina 67 - USING THE RUN-TIME LIBRARY

Invoking the Linker Linking Files3–4 UM004001-COR1103RUN TIME INITIALIZATION FILEThe C run-time initialization file is an assembly program that initia

Pagina 68

UM004001-COR1103 3–5Linking Files Invoking the LinkerNOTE: The user needs to include the C-run time initialization file that is appropriate for the

Pagina 69 - abs FUNCTION

Linker symbols Linking Files3–6 UM004001-COR1103• linker-command-file is the command file to be linked by the linker. Sample command files are provide

Pagina 70 - atof, atoi, atol FUNCTIONS

UM004001-COR1103 3–7Linking Files Linker Command File LINKER COMMAND FILEThe linker command file is text file that contains the linker command and opt

Pagina 71 - FUNCTIONS

Linker Command File Linking Files3–8 UM004001-COR1103make a copy of an initialized RAM data section in a ROM address space, so that the RAM may be ini

Pagina 72 - Parameter Description

UM004001-COR1103 3–9Linking Files Linker Command File The “Expression Formats” section, which follows, explains different types of expressions that ca

Pagina 73

vi UM004001-COR1103Chapter Title and Subsections Page POINTERS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 74

Linker Command Line Linking Files3–10 UM004001-COR1103Linker Command RANGEThis command sets the lower and upper limits of a control section or an addr

Pagina 75

UM004001-COR1103 3–11Linking Files Linker Command LineCOMMAND LINE SPECIFICATIONSThe following rules govern the command line specification:• ZLD exami

Pagina 76

Linker Command Line Linking Files3–12 UM004001-COR1103LINKER COMMAND LINE OPTIONSLinker options are specified by prefixing an option word with a minus

Pagina 77 - srand FUNCTION

UM004001-COR1103 3–13Linking Files Using the LibrarianSymbol File In Zilog Symbol Format A symbol file in the Zilog symbol format is generated when th

Pagina 78

COMMAND LINE OPTIONSCommand line options are specified by prefixing an option letter with a minus (-). The com-mand line options are summarized in Ta

Pagina 79

UM004001-COR1103 4–1380 C-COMPILER USER’S MANUALCHAPTER 4 RUN TIME ENVIRONMENTFUNCTION CALLSThe C-compiler imposes a strict set of rules on function c

Pagina 80

Function Calls Run Time Environment4–2 UM004001-COR1103FIGURE 4-1. FRAME LAYOUT RESPONSIBILITIES OF A CALLED FUNCTIONA called function must perform t

Pagina 81

UM004001-COR1103 4–3Run Time Environment Using the Run-Time LibrarySPECIAL CASES FOR A CALLED FUNCTIONThe following exceptions apply to special cases

Pagina 82

Using the Run-Time Library Run Time Environment4–4 UM004001-COR1103INSTALLED FILESThe following header files are installed in the C-Compiler installat

Pagina 83

UM004001-COR1103 4–5Run Time Environment Library FunctionsLIBRARY FUNCTIONSRun-time library routines are provided for the following:• Buffer Manipulat

Pagina 84

UM004001-COR1103 viiChapter Title and Subsections PageLINKER COMMAND LINE . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 85

Library Functions Run Time Environment4–6 UM004001-COR1103 atof, atoi, atol FUNCTIONS Header file statement: #include <stdlib.h>Syntax: double

Pagina 86

UM004001-COR1103 4–7Run Time Environment Library Functionsdiv FUNCTIONHeader file statement: #include <stdlib.h>Syntax: div_t div( int num, int

Pagina 87 - Return Value

Library Functions Run Time Environment4–8 UM004001-COR1103int isspace( int c );int isupper( int c );int isxdigit( int c );Each function in the is fami

Pagina 88

UM004001-COR1103 4–9Run Time Environment Library FunctionsFunction Test Conditionisalnum Alphanumeric (‘A’-‘Z’, ‘a’-‘z’, or ‘0’-‘9’)isalpha Letter (‘A

Pagina 89

Library Functions Run Time Environment4–10 UM004001-COR1103memchr FUNCTIONHeader file statement: #include <string.h>Syntax: void *memchr( const

Pagina 90 - 4–26 UM004001-COR1103

UM004001-COR1103 4–11Run Time Environment Library Functionsmemcpy FUNCTIONHeader file statement: #include <string.h>Syntax: void *memcpy (void *

Pagina 91 - APPENDIX A

Library Functions Run Time Environment4–12 UM004001-COR1103memset FUNCTIONHeader file statement: #include <string.h>Syntax: void *memset (void

Pagina 92

UM004001-COR1103 4–13Run Time Environment Library Functions srand FUNCTIONHeader file statement: #include <stdlib.h>Syntax: void srand( unsigne

Pagina 93 - LINK FILE

Library Functions Run Time Environment4–14 UM004001-COR1103strchr FUNCTIONHeader file statement: #include <string.h> Syntax: char *strchr (const

Pagina 94

UM004001-COR1103 4–15Run Time Environment Library Functionsstrcmp FUNCTIONHeader file statement: #include <string.h> Syntax: int strcmp (const

Pagina 95 - APPENDIX B

viii UM004001-COR1103Chapter Title and Subsections Pagestrrchr FUNCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Pagina 96

Library Functions Run Time Environment4–16 UM004001-COR1103strcpy FUNCTIONHeader file statement: #include <string.h> Syntax: char *strcpy (char

Pagina 97

UM004001-COR1103 4–17Run Time Environment Library Functionsstrlen FUNCTIONHeader file statement: #include <string.h> Syntax: size_t strlen (cons

Pagina 98

Library Functions Run Time Environment4–18 UM004001-COR1103strncmp FUNCTIONHeader file statement: #include <string.h> Syntax: int strncmp (const

Pagina 99

UM004001-COR1103 4–19Run Time Environment Library Functionsstrncpy FUNCTIONHeader file statement: #include <string.h> Syntax: char *strncpy (cha

Pagina 100

Library Functions Run Time Environment4–20 UM004001-COR1103strrchr FUNCTIONHeader file statement: #include <string.h> Syntax: char *strrchr (con

Pagina 101 - APPENDIX C

UM004001-COR1103 4–21Run Time Environment Library Functionsstrstr FUNCTIONHeader file statement: #include <string.h> Syntax: char *strstr( cons

Pagina 102

Library Functions Run Time Environment4–22 UM004001-COR1103Return ValueThe first time strtok is called, it returns a pointer to the first token in str

Pagina 103 - GLOSSARY

UM004001-COR1103 4–23Run Time Environment Library Functions[whitespace] [{ + | -}] [0 [{ x | X }]] [digits]If base is between 2 and 36, then it is use

Pagina 104 - Glossary-2 UM004001-COR1103

Library Functions Run Time Environment4–24 UM004001-COR1103tolower, toupper FUNCTIONSHeader file statement: #include <ctype.h>Syntax: int tolowe

Pagina 105 - UM004001-COR1103 Glossary-3

UM004001-COR1103 4–25Run Time Environment Library Functions va_arg, va_end, va_start FUNCTIONS Header file statement: #include <stdarg.h> Syntax

Pagina 106 - Glossary-4 UM004001-COR1103

UM004001-COR1103 ixTable Page380 C-COMPILER USER’S MANUALLIST OF TABLESTABLE 2-1 I/O MACHINE INSTRUCTIONS . . . . . . . . . . . . . . . . . . . . . .

Pagina 107 - UM004001-COR1103 Glossary-5

Library Functions Run Time Environment4–26 UM004001-COR1103• The va_arg macro does the following:– Retrieves a value of type from the location given b

Pagina 108 - Glossary-6 UM004001-COR1103

UM004001-COR1103 A–1380 C-COMPILER USER’S MANUALAPPENDIX A INITIALIZATION AND LINK FILES;-------------------------------------------------------------

Pagina 109 - UM004001-COR1103 Glossary-7

Initialization File Initialization and Link FilesA–2 UM004001-COR1103ld.ib hl,.BSS_LENGTH; Check for non-zero lengthld bc,hl ; *ld de,hl ; *swap de ;

Pagina 110 - Glossary-8 UM004001-COR1103

UM004001-COR1103 A–3Initialization and Link Files Link file__exit:jr $ ; ?;***********************************************************************.de

Pagina 112 - Glossary-10 UM004001-COR1103

UM004001-COR1103 B–1380 C-COMPILER USER’S MANUALAPPENDIX B ASCII CHARACTER SETTABLE B-1. ASCII CHARACTER SET Graphic Decimal Hexadecimal Comments0 0

Pagina 113 - UM004001-COR1103 Glossary-11

ASCII Character SetB–2 UM004001-COR110316 10 Data Link Escape17 11 Device Control 118 12 Device Control 219 13 Device Control 320 14 Device Control 4

Pagina 114

UM004001-COR1103 B–3ASCII Character Set ( 40 28 Opening (Left) Parenthesis) 41 29 Closing (Right) Parenthesis* 42 2A Asterisk+ 43 2B Plus, 44 2C Comm

Pagina 115 - UM004001-COR1103 Index-1

ASCII Character SetB–4 UM004001-COR1103@ 64 40 Commercial AtA 65 41 Uppercase AB 66 42 Uppercase BC 67 43 Uppercase CD 68 44 Uppercase DE 69 45 Up

Pagina 116 - Index-2 UM004001-COR1103

UM004001-COR1103 B–5ASCII Character Set X 88 58 Uppercase XY 89 59 Uppercase YZ 90 5A Uppercase Z[ 91 5B Opening (Left) Bracket\ 92 5C Reverse Sl

Comentarios a estos manuales

Sin comentarios