
TASKING VX-toolset for RH850 User Guide MA150-800 (v2.1) June 23, 2014 Copyright © 2014 Altium BV. All rights reserved.You are permitted to print this document provided that (1) the use of such is for personal use only and will not be copied or posted on any network computer or broadcast in any media, and (2) no modifications of the document is made. Unauthorized duplication, in whole or part, of this document by any means, mechanical or electronic, including translation into another language, except for brief excerpts in published reviews, is prohibited without the express written permission of Altium BV. Unauthorized duplication of this work may also be prohibited by local statute. Violators may be subject to both criminal and civil penalties, including fines and/or imprisonment. Altium, TASKING, and their respective logos are trademarks or registered trademarks of Altium Limited or its subsidiaries. All other registered or unregistered trademarks referenced herein are the property of their respective owners and no trademark rights to the same are claimed. Table of Contents 1. C Language .................................................................................................................. 1 1.1. Data Types ......................................................................................................... 1 1.2. Accessing Memory .............................................................................................. 2 1.2.1. Memory Qualifiers ..................................................................................... 3 1.2.2. Data Allocation Options and Pragmas ........................................................... 4 1.2.3. Allocation of Uninitialized Constants ............................................................. 5 1.2.4. Placing an Object at an Absolute Address: __at() ............................................ 5 1.3. Static Assertions ................................................................................................. 6 1.4. Shift JIS Kanji Support ......................................................................................... 6 1.5. Using Assembly in the C Source: __asm() ................................................................ 7 1.6. Attributes ......................................................................................................... 12 1.7. Pragmas to Control the Compiler .......................................................................... 17 1.8. Predefined Preprocessor Macros .......................................................................... 22 1.9. Switch Statement ............................................................................................... 23 1.10. Functions ....................................................................................................... 26 1.10.1. Calling Convention ................................................................................. 26 1.10.2. Inlining Functions: inline .......................................................................... 27 1.10.3. Floating-Point Unit Support: __fpu, __nofpu ................................................ 28 1.10.4. Interrupt Functions ................................................................................. 29 1.10.5. Intrinsic Functions ................................................................................. 35 1.11. Section Naming ............................................................................................... 38 2. Assembly Language ..................................................................................................... 41 2.1. Assembly Syntax ............................................................................................... 41 2.2. Assembler Significant Characters .......................................................................... 42 2.3. Operands of an Assembly Instruction ..................................................................... 43 2.4. Symbol Names .................................................................................................. 43 2.4.1. Predefined Preprocessor Symbols .............................................................. 44 2.5. Registers ......................................................................................................... 45 2.6. Assembly Expressions ........................................................................................ 46 2.6.1. Numeric Constants .................................................................................. 47 2.6.2. Strings .................................................................................................. 47 2.6.3. Expression Operators .............................................................................. 48 2.7. Working with Sections ......................................................................................... 49 2.8. Built-in Assembly Functions ................................................................................. 50 2.9. Assembler Directives .......................................................................................... 55 2.9.1. Overview of Assembler Directives ............................................................... 55 2.9.2. Detailed Description of Assembler Directives ................................................ 57 2.10. Macro Operations ........................................................................................... 102 2.10.1. Defining a Macro ................................................................................. 102 2.10.2. Calling a Macro ................................................................................... 102 2.10.3. Using Operators for Macro Arguments ..................................................... 103 2.11. Generic Instructions ........................................................................................ 106 3. Using the C Compiler .................................................................................................. 109 3.1. Compilation Process ......................................................................................... 109 3.2. Calling the C Compiler ...................................................................................... 110 3.3. The C Startup Code .......................................................................................... 112 3.4. How the Compiler Searches Include Files ............................................................. 112 3.5. Compiling for Debugging ................................................................................... 113 iii TASKING VX-toolset for RH850 User Guide 3.6. Compiler Optimizations ..................................................................................... 114 3.6.1. Generic Optimizations (frontend) .............................................................. 115 3.6.2. Core Specific Optimizations (backend) ....................................................... 116 3.6.3. Optimize for Code Size or Execution Speed ................................................ 117 3.7. Static Code Analysis ......................................................................................... 119 3.7.1. C Code Checking: CERT C ...................................................................... 120 3.7.2. C Code Checking: MISRA C .................................................................... 122 3.8. C Compiler Error Messages ............................................................................... 124 4. Using the Assembler ................................................................................................... 127 4.1. Assembly Process ............................................................................................ 127 4.2. Calling the Assembler ....................................................................................... 128 4.3. How the Assembler Searches Include Files ........................................................... 129 4.4. Assembler Optimizations ................................................................................... 130 4.5. Generating a List File ........................................................................................ 131 4.6. Assembler Error Messages ................................................................................ 131 5. Using the Linker ......................................................................................................... 133 5.1. Linking Process ............................................................................................... 133 5.1.1. Phase 1: Linking .................................................................................... 135 5.1.2. Phase 2: Locating .................................................................................. 136 5.2. Calling the Linker ............................................................................................. 137 5.3. Linking with Libraries ........................................................................................ 138 5.3.1. How the Linker Searches Libraries ............................................................ 140 5.3.2. How the Linker Extracts Objects from Libraries ............................................ 140 5.4. Incremental Linking .......................................................................................... 141 5.5. Importing Binary Files ....................................................................................... 142 5.6. Linker Optimizations ........................................................................................
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages620 Page
-
File Size-