TASKING VX-Toolset for MCS User Guide

TASKING VX-Toolset for MCS User Guide

TASKING VX-toolset for MCS User Guide MA162-800 (v6.2r2) March 06, 2018 Copyright © 2018 TASKING 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 TASKING 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 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.1.1. Floating-point Types .................................................................................. 3 1.2. Special Function Registers .................................................................................... 4 1.3. Address Space Qualifiers ...................................................................................... 5 1.4. Shift JIS Kanji Support ......................................................................................... 6 1.5. Using Assembly in the C Source: __asm() ................................................................ 7 1.6. Attributes ......................................................................................................... 13 1.7. Pragmas to Control the Compiler .......................................................................... 17 1.8. Predefined Preprocessor Macros .......................................................................... 21 1.9. Functions ......................................................................................................... 23 1.9.1. Calling Convention .................................................................................. 23 1.9.2. Register Usage ....................................................................................... 25 1.9.3. Stack Usage .......................................................................................... 25 1.9.4. Variable Length Arrays ............................................................................. 26 1.9.5. Inlining Functions: inline ........................................................................... 26 1.9.6. Channel Functions .................................................................................. 28 1.9.7. Intrinsic Functions ................................................................................... 29 1.10. Section Naming ............................................................................................... 36 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 .................................................................................. 46 2.6.2. Strings .................................................................................................. 47 2.6.3. Expression Operators .............................................................................. 47 2.7. Working with Sections ......................................................................................... 49 2.8. Built-in Assembly Functions ................................................................................. 50 2.9. Assembler Directives and Controls ........................................................................ 56 2.9.1. Assembler Directives ............................................................................... 57 2.9.2. Assembler Controls ................................................................................. 97 2.10. Macro Operations ........................................................................................... 108 2.10.1. Defining a Macro ................................................................................. 108 2.10.2. Calling a Macro ................................................................................... 108 2.10.3. Using Operators for Macro Arguments ..................................................... 109 2.11. Generic Instructions ........................................................................................ 112 3. Using the C Compiler .................................................................................................. 115 3.1. Compilation Process ......................................................................................... 115 3.2. Calling the C Compiler ...................................................................................... 116 3.3. How the Compiler Searches Include Files ............................................................. 118 3.4. Compiling for Debugging ................................................................................... 119 3.5. Compiler Optimizations ..................................................................................... 120 3.5.1. Generic Optimizations (frontend) .............................................................. 121 3.5.2. Core Specific Optimizations (backend) ....................................................... 122 iii TASKING VX-toolset for MCS User Guide 3.5.3. Optimize for Code Size or Execution Speed ................................................ 124 3.6. Static Code Analysis ......................................................................................... 127 3.6.1. C Code Checking: CERT C ...................................................................... 129 3.6.2. C Code Checking: MISRA C .................................................................... 130 3.7. C Compiler Error Messages ............................................................................... 132 4. Using the Assembler ................................................................................................... 135 4.1. Assembly Process ............................................................................................ 135 4.2. Calling the Assembler ....................................................................................... 136 4.3. How the Assembler Searches Include Files ........................................................... 137 4.4. Generating a List File ........................................................................................ 138 4.5. Assembler Error Messages ................................................................................ 139 5. Using the Linker ......................................................................................................... 141 5.1. Linking Process ............................................................................................... 141 5.1.1. Phase 1: Linking .................................................................................... 143 5.1.2. Phase 2: Locating .................................................................................. 144 5.2. Calling the Linker ............................................................................................. 145 5.3. Linking with Libraries ........................................................................................ 146 5.3.1. How the Linker Searches Libraries ............................................................ 148 5.3.2. How the Linker Extracts Objects from Libraries ............................................ 149 5.4. Incremental Linking .......................................................................................... 149 5.5. Importing Binary Files ....................................................................................... 150 5.6. Linker Optimizations ......................................................................................... 150 5.7. Controlling the Linker with a Script ....................................................................... 152 5.7.1. Purpose of the Linker Script Language ...................................................... 152 5.7.2. Eclipse and LSL .................................................................................... 152 5.7.3. Preprocessor Macros

View Full Text

Details

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