
IAR C/C++ Development Guide Compiling and Linking for the Renesas SH Microcomputer Family DSH-1 DSH-1 COPYRIGHT NOTICE Copyright © 1999–2010 IAR Systems AB. No part of this document may be reproduced without the prior written consent of IAR Systems AB. The software described in this document is furnished under a license and may only be used or copied in accordance with the terms of such a license. DISCLAIMER The information in this document is subject to change without notice and does not represent a commitment on any part of IAR Systems. While the information contained herein is assumed to be accurate, IAR Systems assumes no responsibility for any errors or omissions. In no event shall IAR Systems, its employees, its contractors, or the authors of this document be liable for special, direct, indirect, or consequential damage, losses, costs, charges, claims, demands, claim for lost profits, fees, or expenses of any nature or kind. TRADEMARKS IAR Systems, IAR Embedded Workbench, C-SPY, visualSTATE, From Idea To Target, IAR KickStart Kit, IAR PowerPac, IAR YellowSuite, IAR Advanced Development Kit, IAR, and the IAR Systems logotype are trademarks or registered trademarks owned by IAR Systems AB. J-Link is a trademark licensed to IAR Systems AB. Microsoft and Windows are registered trademarks of Microsoft Corporation. Renesas is a registered trademark of Renesas Technology Corporation. SH is a trademark of Renesas Technology Corporation. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE First edition: February 2010 Part number: DSH-1 This guide applies to version 2.x of IAR Embedded Workbench® for SH. The IAR C/C++ Development Guide for SH replaces all versions of the SH IAR C/C++ Compiler Reference Guide and the IAR Linker and Library Tools Reference Guide Internal reference: M2, IJOA. DSH-1 Brief contents Tables .................................................................................................................... xxv Preface ................................................................................................................ xxvii Part 1. Using the build tools ..................................................... 1 Introduction to the IAR build tools .......................................................... 3 Developing embedded applications ........................................................... 9 Data storage ...................................................................................................... 23 Functions ............................................................................................................... 31 Linking using ILINK ........................................................................................ 39 Linking your application ................................................................................ 49 The DLIB runtime environment .............................................................. 61 Assembler language interface ................................................................... 89 Using C ................................................................................................................ 107 Using C++ .......................................................................................................... 117 Application-related considerations ....................................................... 125 Efficient coding for embedded applications ...................................... 133 Part 2. Reference information ........................................... 151 External interface details ............................................................................ 153 Compiler options ........................................................................................... 163 Linker options .................................................................................................. 193 Data representation ...................................................................................... 211 Extended keywords ....................................................................................... 223 iii DSH-1 Pragma directives ............................................................................................ 237 Intrinsic functions ........................................................................................... 255 The preprocessor ........................................................................................... 261 Library functions ............................................................................................. 267 The linker configuration file ...................................................................... 275 Section reference ............................................................................................ 297 IAR utilities ........................................................................................................ 307 Implementation-defined behavior .......................................................... 337 Index ..................................................................................................................... 353 IAR C/C++ Development Guide iv Compiling and Linking for SH DSH-1 Contents Tables .................................................................................................................... xxv Preface ................................................................................................................ xxvii Who should read this guide ...........................................................xxvii How to use this guide ......................................................................xxvii What this guide contains ..............................................................xxviii Other documentation ........................................................................xxix Further reading ................................................................................. xxx Document conventions ...................................................................... xxx Typographic conventions ................................................................xxxi Naming conventions .......................................................................xxxi Part 1. Using the build tools ..................................................... 1 Introduction to the IAR build tools .......................................................... 3 The IAR build tools—an overview ..................................................... 3 IAR C/C++ Compiler ........................................................................... 3 IAR Assembler ..................................................................................... 4 The IAR ILINK Linker ........................................................................ 4 Specific ELF tools ................................................................................ 4 External tools ....................................................................................... 4 IAR language overview ........................................................................... 5 Device support ........................................................................................... 6 Supported SH devices .......................................................................... 6 Preconfigured support files .................................................................. 6 Examples for getting started ................................................................ 6 Special support for embedded systems .......................................... 7 Extended keywords .............................................................................. 7 Pragma directives ................................................................................. 7 Predefined symbols .............................................................................. 7 Special function types .......................................................................... 7 Accessing low-level features ............................................................... 8 v DSH-1 Developing embedded applications ........................................................... 9 Developing embedded software using IAR build tools ............ 9 Mapping of internal and external memory ........................................... 9 Communication with peripheral units ................................................ 10 Event handling ................................................................................... 10 System startup .................................................................................... 10 Real-time operating systems .............................................................. 10 The build process—an overview ...................................................... 11 The translation process ....................................................................... 11 The linking process ............................................................................ 12 After linking ....................................................................................... 13 Application execution—an overview ............................................. 14 The initialization phase ...................................................................... 14 The execution phase ........................................................................... 18 The termination phase ........................................................................ 18 Building applications—an overview ...............................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages410 Page
-
File Size-