Download TASKING VX-toolset for ARM User Guide

Transcript
Table of Contents
1. C Language .................................................................................................................. 1
1.1. Data Types ......................................................................................................... 1
1.2. Changing the Alignment: __unaligned, __packed__ and __align() ................................. 2
1.3. Placing an Object at an Absolute Address: __at() ....................................................... 3
1.4. Accessing Hardware from C .................................................................................. 4
1.5. Using Assembly in the C Source: __asm() ................................................................ 5
1.6. Attributes ......................................................................................................... 11
1.7. Pragmas to Control the Compiler .......................................................................... 14
1.8. Predefined Preprocessor Macros .......................................................................... 19
1.9. Switch Statement ............................................................................................... 21
1.10. Functions ....................................................................................................... 22
1.10.1. Calling Convention ................................................................................. 22
1.10.2. Inlining Functions: inline .......................................................................... 23
1.10.3. Interrupt Functions / Exception Handlers .................................................... 25
1.10.4. Intrinsic Functions ................................................................................. 27
2. C++ Language ............................................................................................................ 35
2.1. C++ Language Extension Keywords ...................................................................... 35
2.2. C++ Dialect Accepted ......................................................................................... 35
2.2.1. Standard Language Features Accepted ....................................................... 35
2.2.2. C++0x Language Features Accepted .......................................................... 38
2.2.3. Anachronisms Accepted ........................................................................... 42
2.2.4. Extensions Accepted in Normal C++ Mode ................................................... 43
2.3. GNU Extensions ................................................................................................ 45
2.4. Namespace Support .......................................................................................... 59
2.5. Template Instantiation ......................................................................................... 61
2.5.1. Automatic Instantiation ............................................................................. 62
2.5.2. Instantiation Modes ................................................................................. 63
2.5.3. Instantiation #pragma Directives ................................................................. 64
2.5.4. Implicit Inclusion ..................................................................................... 65
2.5.5. Exported Templates ................................................................................. 66
2.6. Inlining Functions ............................................................................................... 69
2.7. Extern Inline Functions ....................................................................................... 70
2.8. Pragmas to Control the C++ Compiler .................................................................... 70
2.9. Predefined Macros ............................................................................................. 71
2.10. Precompiled Headers ....................................................................................... 75
2.10.1. Automatic Precompiled Header Processing ................................................. 75
2.10.2. Manual Precompiled Header Processing .................................................... 78
2.10.3. Other Ways to Control Precompiled Headers ............................................... 78
2.10.4. Performance Issues ............................................................................... 79
3. Assembly Language ..................................................................................................... 81
3.1. Assembly Syntax ............................................................................................... 81
3.2. Assembler Significant Characters .......................................................................... 82
3.3. Operands of an Assembly Instruction ..................................................................... 83
3.4. Symbol Names .................................................................................................. 83
3.4.1. Predefined Preprocessor Symbols .............................................................. 84
3.5. Registers ......................................................................................................... 85
3.6. Assembly Expressions ........................................................................................ 85
3.6.1. Numeric Constants .................................................................................. 86
iii