Compiler HC08

Download Compiler HC08

Post on 14-Jul-2016

236 views

Category:

Documents

0 download

Embed Size (px)

DESCRIPTION

lh

TRANSCRIPT

  • HC(S)08 Compiler Manual

    Revised: 5 November 2005

    compiler.book Page 1 Friday, November 18, 2005 7:45 AM

  • Freescale and the Freescale logo are trademarks of Freescale Semiconductor, Inc. CodeWarrior is a trademark or reg-istered trademark of Freescale Semiconductor, Inc. in the United States and/or other countries. All other product or ser-vice names are the property of their respective owners. Copyright 2005 by Freescale Semiconductor, Inc. All rights reserved.Information in this document is provided solely to enable system and software implementers to use Freescale Semicon-ductor products. There are no express or implied copyright licenses granted hereunder to design or fabricate any inte-grated circuits or integrated circuits based on the information in this document.Freescale Semiconductor reserves the right to make changes without further notice to any products herein. FreescaleSemiconductor makes no warranty, representation or guarantee regarding the suitability of its products for any partic-ular purpose, nor does Freescale Semiconductor assume any liability arising out of the application or use of any productor circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental dam-ages. Typical parameters that may be provided in Freescale Semiconductor data sheets and/or specifications can anddo vary in different applications and actual performance may vary over time. All operating parameters, including Typ-icals, must be validated for each customer application by customer's technical experts. Freescale Semiconductor doesnot convey any license under its patent rights nor the rights of others. Freescale Semiconductor products are not de-signed, intended, or authorized for use as components in systems intended for surgical implant into the body, or otherapplications intended to support or sustain life, or for any other application in which the failure of the Freescale Semi-conductor product could create a situation where personal injury or death may occur. Should Buyer purchase or useFreescale Semiconductor products for any such unintended or unauthorized application, Buyer shall indemnify and holdFreescale Semiconductor and its officers, employees, subsidiaries, affiliates, and distributors harmless against allclaims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim ofpersonal injury or death associated with such unintended or unauthorized use, even if such claim alleges that FreescaleSemiconductor was negligent regarding the design or manufacture of the part.

    How to Contact Us

    Corporate Headquarters Freescale Semiconductor, Inc.7700 West Parmer Lane

    Austin, TX 78729

    U.S.A.

    World Wide Web http://www.freescale.com/codewarrior

    Technical Support http://www.freescale.com/support

    compiler.book Page 2 Friday, November 18, 2005 7:45 AM

  • 3HC(S)08 Compiler Manual

    Table of Contents

    I Overview

    II Using the Compiler1 Introduction 27

    Compiler environment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27Project directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Editor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    Creating a project for your application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28Using CodeWarrior to create a project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29CodeWarrior groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39Analysis of some files in the project window . . . . . . . . . . . . . . . . . . . . . . . . 41

    Compilation with the Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43Application Programs (Build Tools) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 58Startup Command-Line Options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59Highlights . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60CodeWarrior Integration of the Build Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60

    Combined or Separated Installations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60Target Settings preference panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61Build Extras preference panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65Assembler for HC08 preference panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67Burner for HC08 preference panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68Compiler for HC08 preference panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69Importer for HC08 preference panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Linker for HC08 preference panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72Libmaker for HC08 preference panel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73CodeWarrior Tips and Tricks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74

    Integration into Microsoft Visual Studio (Visual C++ V5.0 or later) . . . . . . . . . 74

    compiler.book Page 3 Friday, November 18, 2005 7:45 AM

  • Table of Contents

    4 HC(S)08 Compiler Manual

    Integration as Additional Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .74Integration with Visual Studio Toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . .76

    Object-File Formats. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77HIWARE Object-File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77ELF/DWARF Object-File Format . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .77Tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78Mixing Object-File Formats . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .78

    2 Graphical User Interface 79Launching the Compiler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .79

    Interactive Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80Batch Mode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .80

    Tip of the Day . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .81Main Window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82Window Title . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82Content Area . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .82Toolbar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .84Status Bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85Menu Bar. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .85

    File Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .86Compiler Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .96View Menu. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97Help Menu . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .97

    Standard Types dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .98Option Settings dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .99Compiler Smart Control dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .101Message Settings dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .103

    Changing the Class associated with a Message. . . . . . . . . . . . . . . . . . . . . .105Retrieving Information about an Error Message . . . . . . . . . . . . . . . . . . . . .106

    About... dialog box . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106Specifying the Input File . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .106

    Use the Command Line in the Toolbar to Compile . . . . . . . . . . . . . . . . . . .107Message/Error Feedback . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .107Use Information from the Compiler Window . . . . . . . . . . . . . . . . . . . . . . .108Use a User-Defined Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .108

    compiler.book Page 4 Friday, November 18, 2005 7:45 AM

  • Table of Contents

    5HC(S)08 Compiler Manual

    3 Environment 109Current Directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110Environment Macros. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111Global Initialization File (mcutools.ini) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112Local Configuration File (usually project.ini) . . . . . . . . . . . .