
IAR C/C++ Compiler Reference Guide for Renesas M16C/1X–3X, 5X–6X and R8C Series of CPU cores CM16C-3 COPYRIGHT NOTICE Copyright © 1995–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. M16C/R8C Series is a trademark of Renesas Technology Corporation. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE Third edition: July 2009 Part number: CM16C-3 This guide applies to version 3.x of IAR Embedded Workbench® for M16C/R8C. Internal reference: R8, 5.5, IMAE. CM16C-3 Brief contents Tables ..................................................................................................................... xxi Preface ................................................................................................................. xxiii Part 1. Using the compiler ......................................................... 1 Getting started .................................................................................................... 3 Data storage ........................................................................................................ 11 Functions ............................................................................................................... 23 Placing code and data .................................................................................... 31 The DLIB runtime environment .............................................................. 45 The CLIB runtime environment .............................................................. 77 Assembler language interface ................................................................... 87 Using C++ .......................................................................................................... 109 Efficient coding for embedded applications ...................................... 123 Part 2. Reference information ........................................... 143 External interface details ............................................................................ 145 Compiler options ........................................................................................... 151 Data representation ...................................................................................... 183 Compiler extensions .................................................................................... 195 Extended keywords ....................................................................................... 205 Pragma directives ............................................................................................ 217 Intrinsic functions ........................................................................................... 231 The preprocessor ........................................................................................... 241 iii CM16C-3 Library functions ............................................................................................. 247 Segment reference ......................................................................................... 257 Implementation-defined behavior .......................................................... 273 Index ..................................................................................................................... 287 IAR C/C++ Compiler iv Reference Guide CM16C-3 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 ................................................................................xxvi Document conventions .....................................................................xxvi Typographic conventions ...............................................................xxvii Naming conventions ......................................................................xxvii Part 1. Using the compiler ......................................................... 1 Getting started .................................................................................................... 3 IAR language overview ........................................................................... 3 Supported M16C/R8C Series devices .............................................. 4 Building applications—an overview .................................................. 4 Compiling ............................................................................................. 4 Linking ................................................................................................ 5 Basic settings for project configuration .......................................... 5 CPU core .............................................................................................. 6 Data model ........................................................................................... 6 Size of double floating-point type ........................................................ 7 Optimization for speed and size ........................................................... 7 Runtime environment ........................................................................... 7 Special support for embedded systems .......................................... 9 Extended keywords .............................................................................. 9 Pragma directives ................................................................................. 9 Predefined symbols ............................................................................ 10 Special function types ........................................................................ 10 Accessing low-level features ............................................................. 10 v CM16C-3 Data storage ........................................................................................................ 11 Introduction .............................................................................................. 11 Different ways to store data ............................................................... 11 Data models .............................................................................................. 12 Specifying a data model ..................................................................... 12 Memory types .......................................................................................... 13 Data13 ................................................................................................ 14 Data16 ................................................................................................ 14 Far ...................................................................................................... 14 Data20 ................................................................................................ 14 Using data memory attributes ............................................................ 15 Pointers and memory types ................................................................ 16 Structures and memory types ............................................................ 17 More examples ................................................................................... 17 C++ and memory types ...................................................................... 18 Auto variables—on the stack ............................................................ 19 The stack ............................................................................................ 19 Dynamic memory on the heap ........................................................ 20 Functions ............................................................................................................... 23 Function-related extensions .............................................................. 23 Special page functions .......................................................................... 23 Primitives
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages338 Page
-
File Size-