Download MSP430 Optimizing C/C++ Compiler User`s Guide
Transcript
www.ti.com 5.16 5.17 6 109 110 110 111 112 112 113 113 Run-Time Environment ...................................................................................................... 114 6.1 6.2 6.3 6.4 6.5 6.6 6.7 6.8 6.9 6.10 7 5.15.4 Enabling Embedded C++ Mode (--embedded_cpp Option) ............................................... GNU Language Extensions ............................................................................................. 5.16.1 Extensions ....................................................................................................... 5.16.2 Function Attributes .............................................................................................. 5.16.3 Variable Attributes .............................................................................................. 5.16.4 Type Attributes .................................................................................................. 5.16.5 Built-In Functions ............................................................................................... Compiler Limits ............................................................................................................ Memory Model ............................................................................................................ 6.1.1 Code Memory Models ........................................................................................... 6.1.2 Data Memory Models............................................................................................ 6.1.3 Support for Near Data ........................................................................................... 6.1.4 Sections ........................................................................................................... 6.1.5 C/C++ Software Stack .......................................................................................... 6.1.6 Dynamic Memory Allocation .................................................................................... Object Representation ................................................................................................... 6.2.1 Data Type Storage............................................................................................... 6.2.2 Character String Constants ..................................................................................... Register Conventions .................................................................................................... Function Structure and Calling Conventions .......................................................................... 6.4.1 How a Function Makes a Call .................................................................................. 6.4.2 How a Called Function Responds ............................................................................. 6.4.3 Accessing Arguments and Local Variables................................................................... Accessing Linker Symbols in C and C++ .............................................................................. Interfacing C and C++ With Assembly Language .................................................................... 6.6.1 Using Assembly Language Modules With C/C++ Code .................................................... 6.6.2 Accessing Assembly Language Functions From C/C++ ................................................... 6.6.3 Accessing Assembly Language Variables From C/C++ .................................................... 6.6.4 Sharing C/C++ Header Files With Assembly Source ....................................................... 6.6.5 Using Inline Assembly Language .............................................................................. Interrupt Handling ......................................................................................................... 6.7.1 Saving Registers During Interrupts ............................................................................ 6.7.2 Using C/C++ Interrupt Routines ............................................................................... 6.7.3 Using Assembly Language Interrupt Routines ............................................................... 6.7.4 Interrupt Vectors ................................................................................................. 6.7.5 Other Interrupt Information ..................................................................................... Using Intrinsics to Access Assembly Language Statements........................................................ 6.8.1 MSP430 Intrinsics ............................................................................................... 6.8.2 Deprecated Intrinsics ............................................................................................ 6.8.3 The __delay_cycle Intrinsic ..................................................................................... 6.8.4 The __never_executed Intrinsic................................................................................ System Initialization ...................................................................................................... 6.9.1 System Pre-Initialization ........................................................................................ 6.9.2 Run-Time Stack .................................................................................................. 6.9.3 Automatic Initialization of Variables ........................................................................... 6.9.4 Initialization Tables .............................................................................................. Compiling for 20-Bit MSP430X Devices ............................................................................... 115 115 115 116 116 117 118 119 119 120 121 122 123 123 124 124 124 124 125 126 127 127 127 127 128 128 128 128 129 129 130 130 131 133 133 133 134 138 140 Using Run-Time-Support Functions and Building Libraries ................................................... 141 7.1 C and C++ Run-Time Support Libraries ............................................................................... 7.1.1 Linking Code With the Object Library ......................................................................... 7.1.2 Header Files ...................................................................................................... 7.1.3 Modifying a Library Function ................................................................................... SLAU132K – September 2015 Submit Documentation Feedback Contents Copyright © 2015, Texas Instruments Incorporated 142 142 142 142 5