
IAR C/C++ Compiler Reference Guide for the Renesas R32C/100 Microcomputer Family CR32C-2 COPYRIGHT NOTICE Copyright © 2007–2009 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. R32C/100 is a trademark of Renesas Technology Corporation. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE Second edition: January 2009 Part number: CR32C-2 This guide applies to version 1.x of IAR Embedded Workbench® for R32C. Internal reference: R7, 5.4, IJOA CR32C-2 Brief contents Tables ..................................................................................................................... xxi Preface ................................................................................................................. xxiii Part 1. Using the compiler ......................................................... 1 Getting started .................................................................................................... 3 Data storage ...................................................................................................... 11 Functions ............................................................................................................... 21 Placing code and data .................................................................................... 27 The DLIB runtime environment .............................................................. 41 Assembler language interface ................................................................... 71 Using C++ ............................................................................................................ 91 Efficient coding for embedded applications ........................................ 99 Part 2. Reference information ........................................... 117 External interface details ............................................................................ 119 Compiler options ........................................................................................... 125 Data representation ...................................................................................... 153 Compiler extensions .................................................................................... 163 Extended keywords ....................................................................................... 173 Pragma directives ............................................................................................ 185 Intrinsic functions ........................................................................................... 199 The preprocessor ........................................................................................... 211 Library functions ............................................................................................. 217 iii CR32C-2 Segment reference ......................................................................................... 225 Implementation-defined behavior .......................................................... 239 Index ..................................................................................................................... 251 IAR C/C++ Compiler iv Reference Guide CR32C-2 Contents Tables ..................................................................................................................... xxi Preface ................................................................................................................. xxiii Who should read this guide ............................................................xxiii How to use this guide .......................................................................xxiii What this guide contains ................................................................xxiv Other documentation ......................................................................... xxv Further reading ................................................................................. xxv Document conventions .....................................................................xxvi Typographic conventions ................................................................xxvi Naming conventions ......................................................................xxvii Part 1. Using the compiler ......................................................... 1 Getting started .................................................................................................... 3 IAR language overview ........................................................................... 3 Supported R32C/100 devices ............................................................... 4 Building applications—an overview .................................................. 4 Compiling ............................................................................................. 4 Linking ................................................................................................ 4 Basic settings for project configuration .......................................... 5 Data model ........................................................................................... 6 Code model .......................................................................................... 6 Size of double floating-point type ........................................................ 6 Optimization for speed and size ........................................................... 7 Runtime environment ........................................................................... 7 Special support for embedded systems .......................................... 8 Extended keywords .............................................................................. 8 Pragma directives ................................................................................. 9 Predefined symbols .............................................................................. 9 Special function types .......................................................................... 9 Accessing low-level features ............................................................... 9 v CR32C-2 Data storage ...................................................................................................... 11 Introduction ............................................................................................. 11 Different ways to store data ............................................................... 11 Data models .............................................................................................. 12 Specifying a data model ..................................................................... 12 Memory types .......................................................................................... 13 Data16 ............................................................................................... 14 Data24 ............................................................................................... 14 Data32 ............................................................................................... 14 Sbdata16 ............................................................................................ 14 Sbdata24 ............................................................................................ 14 Using data memory attributes ............................................................ 14 Structures and memory types ............................................................ 16 More examples ................................................................................... 16 C++ and memory types ...................................................................... 17 Auto variables—on the stack ............................................................ 17 The stack ............................................................................................ 18 Dynamic memory on the heap ........................................................ 19 Functions ............................................................................................................... 21 Function-related extensions .............................................................. 21 Code models and memory attributes for function storage 21 Using function memory attributes ...................................................... 22 Primitives for interrupts, concurrency, and OS-related programming
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages301 Page
-
File Size-