IAR C/C++ Compiler User Guide

IAR C/C++ Compiler User Guide

IAR C/C++ Compiler User Guide for the 8051 Microcontroller Architecture C8051-7 COPYRIGHT NOTICE © 1991–2017 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, IAR Connect, C-SPY, C-RUN, C-STAT, visualSTATE, IAR KickStart Kit, IAR Experiment!, I-jet, I-jet Trace, I-scope, IAR Academy, IAR, and the logotype of IAR Systems are trademarks or registered trademarks owned by IAR Systems AB. Microsoft and Windows are registered trademarks of Microsoft Corporation. Intel® is a registered trademark of Intel Corporation. Adobe and Acrobat Reader are registered trademarks of Adobe Systems Incorporated. All other product names are trademarks or registered trademarks of their respective owners. EDITION NOTICE Seventh edition: March 2017 Part number: C8051-7 This guide applies to version 10.x of IAR Embedded Workbench® for the 8051 microcontroller architecture. Internal reference: M22, Mym8.0, tut2017.1, csrct2010.1, V_110411, IJOA. IAR C/C++ Compiler User Guide 2 for 8051 AFE1_AFE2-1:1 Brief contents Tables ..................................................................................................................... 29 Preface .................................................................................................................... 31 Part 1. Using the compiler ....................................................... 39 Introduction to the IAR build tools ........................................................ 41 Developing embedded applications ........................................................ 47 Understanding memory architecture .................................................... 59 Data storage ...................................................................................................... 67 Functions ............................................................................................................... 95 Banked functions ............................................................................................. 107 Linking overview ........................................................................................... 119 Linking your application .............................................................................. 127 The DLIB runtime environment ........................................................... 145 The CLIB runtime environment ............................................................ 181 Assembler language interface ................................................................. 191 Using C ................................................................................................................ 221 Using C++ .......................................................................................................... 229 Application-related considerations ....................................................... 247 Efficient coding for embedded applications ...................................... 257 Part 2. Reference information ........................................... 277 External interface details ............................................................................ 279 Compiler options ........................................................................................... 285 3 AFE1_AFE2-1:1 Data representation ...................................................................................... 325 Extended keywords ...................................................................................... 337 Pragma directives ........................................................................................... 361 Intrinsic functions ........................................................................................... 383 The preprocessor .......................................................................................... 387 C/C++ standard library functions .......................................................... 395 Segment reference ......................................................................................... 405 Implementation-defined behavior for Standard C ........................ 441 Implementation-defined behavior for C89 ....................................... 457 Index ..................................................................................................................... 471 IAR C/C++ Compiler User Guide 4 for 8051 AFE1_AFE2-1:1 Contents Tables ..................................................................................................................... 29 Preface .................................................................................................................... 31 Who should read this guide ............................................................... 31 Required knowledge .......................................................................... 31 How to use this guide .......................................................................... 31 What this guide contains ................................................................... 32 Part 1. Using the compiler .................................................................. 32 Part 2. Reference information ............................................................ 33 Other documentation ........................................................................... 33 User and reference guides .................................................................. 34 The online help system ...................................................................... 34 Further reading ................................................................................... 35 Web sites ............................................................................................ 35 Document conventions ........................................................................ 36 Typographic conventions ................................................................... 36 Naming conventions .......................................................................... 37 Part 1. Using the compiler ....................................................... 39 Introduction to the IAR build tools ........................................................ 41 The IAR build tools—an overview ................................................... 41 IAR C/C++ Compiler ......................................................................... 41 IAR Assembler ................................................................................... 42 The IAR XLINK Linker .................................................................... 42 External tools ..................................................................................... 42 IAR language overview ......................................................................... 42 Device support ......................................................................................... 43 Supported 8051 devices ..................................................................... 43 Preconfigured support files ................................................................ 43 Examples for getting started .............................................................. 44 5 AFE1_AFE2-1:1 Special support for embedded systems ........................................ 44 Extended keywords ............................................................................ 45 Pragma directives ............................................................................... 45 Predefined symbols ............................................................................ 45 Accessing low-level features ............................................................. 45 Developing embedded applications ........................................................ 47 Developing embedded software using IAR build tools .......... 47 Mapping of memory ........................................................................... 47 Communication with peripheral units ................................................ 48 Event handling ................................................................................... 48 System startup .................................................................................... 48 Real-time operating systems .............................................................. 48 The build process—an overview ...................................................... 49 The translation process ....................................................................... 49 The linking process ............................................................................ 50 After linking ....................................................................................... 52 Application execution—an overview ............................................. 52 The initialization phase .....................................................................

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    499 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