V850 IAR C/C++ Compiler Reference Guide

V850 IAR C/C++ Compiler Reference Guide

V850 IAR C/C++ Compiler Reference Guide for NEC Electronics’ V850 Microcontroller Family CV850-6 COPYRIGHT NOTICE © Copyright 1998–2007 IAR Systems. All rights reserved. No part of this document may be reproduced without the prior written consent of IAR Systems. 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, IAR Systems, IAR Embedded Workbench, IAR MakeApp, C-SPY, visualSTATE, From Idea To Target, IAR KickStart Kit and IAR PowerPac are trademarks or registered trademarks owned by IAR Systems AB. NEC is a registered trademark of NEC Corporation. V850 is a trademark of NEC Electronics Europe GmbH. Microsoft and Windows are registered trademarks of Microsoft Corporation. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE Sixth edition: March 2007 Part number: CV850-6 This guide applies to version 3.x of V850 IAR Embedded Workbench®. Internal reference: T7:7c, IJOA. CV850-6 Brief contents Tables ...................................................................................................................... xv Preface .................................................................................................................. xvii Part 1. Using the compiler ......................................................... 1 Getting started .................................................................................................... 3 Data storage ...................................................................................................... 11 Functions ............................................................................................................... 21 Placing code and data .................................................................................... 29 The DLIB runtime environment .............................................................. 47 Assembler language interface ................................................................... 77 Using C++ ............................................................................................................ 99 Efficient coding for embedded applications ...................................... 107 Part 2. Compiler reference .................................................... 121 Compiler usage ................................................................................................ 123 Compiler options ........................................................................................... 129 Data representation ...................................................................................... 161 Compiler extensions .................................................................................... 171 Extended keywords ....................................................................................... 183 Pragma directives ............................................................................................ 193 Intrinsic functions ........................................................................................... 207 The preprocessor ........................................................................................... 213 Library functions ............................................................................................. 219 iii CV850-6 Segment reference ......................................................................................... 225 Implementation-defined behavior .......................................................... 241 Index ..................................................................................................................... 253 V850 IAR C/C++ Compiler iv Reference Guide CV850-6 Contents Tables ...................................................................................................................... xv Preface .................................................................................................................. xvii Who should read this guide .............................................................xvii How to use this guide ........................................................................xvii What this guide contains ................................................................xviii Other documentation ..........................................................................xix Further reading ..................................................................................xix Document conventions ........................................................................ xx Typographic conventions ................................................................... xx Part 1. Using the compiler ......................................................... 1 Getting started .................................................................................................... 3 IAR language overview ........................................................................... 3 Supported V850 devices ........................................................................ 4 Building applications—an overview .................................................. 4 Compiling ............................................................................................. 4 Linking ................................................................................................ 4 Basic settings for project configuration .......................................... 5 Core ..................................................................................................... 5 Data model ........................................................................................... 6 Code model .......................................................................................... 6 Optimization for speed and size ........................................................... 6 Runtime environment ........................................................................... 7 Special support for embedded systems .......................................... 8 Extended keywords .............................................................................. 8 Pragma directives ................................................................................. 9 Predefined symbols .............................................................................. 9 Special function types .......................................................................... 9 Header files for I/O .............................................................................. 9 Accessing low-level features ............................................................... 9 v CV850-6 Data storage ...................................................................................................... 11 Introduction ............................................................................................. 11 Data models .............................................................................................. 11 Specifying a data model ..................................................................... 12 Memory types .......................................................................................... 13 Near .................................................................................................... 13 Brel (Base-relative) ........................................................................... 14 Huge .................................................................................................. 14 Saddr (Short addressing) ................................................................... 14 Using data memory attributes ............................................................ 15 Structures and memory types ............................................................ 16 C++ and memory types ...................................................................... 17 The stack and auto variables ............................................................. 18 Dynamic memory on the heap ........................................................ 19 Functions ............................................................................................................... 21 Function-related extensions .............................................................. 21 Code models and memory attributes for function storage 21 The normal code model ..................................................................... 22 The large code model ........................................................................ 22 The position-independent code model .............................................. 22 Using function memory attributes ...................................................... 22 Primitives for interrupts, concurrency, and OS-related programming ............................................................................................ 23 Interrupt functions ............................................................................. 23 Trap

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    295 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us