|
Home     News     Contact | |
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| This page as a PDF  ColdFire Development Suite  Try It Now  Buy It Now  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
ColdFire C/C++ Compiler Details |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Compiler  Simulator  Debugger  Environment  Tutorials  Variants  | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
The Crossware ColdFire C/C++ compiler generates code for the Freescale ColdFire MCF52xx, MCF53xx and MCF54xx families of microprocessors and microcontrollers. It comes as part of the Crossware ColdFire Development Suite and runs under Windows 9x, Windows NT 4.0, Windows 2000, Windows XP and Windows Vista.
HIGHLIGHTS
C Language DefinitionThe C compiler conforms to the 1989 ANSI C specification and in addition provides a number of general enhancements including:
It also supports a number of features from the 1999 ANSI C Standard including:
In addition, the compiler supports the C++ feature that allows variables to be defined within the conditional expressions of the for loop, while loop, if statement and switch statement The support libraries are a subset of the ANSI standard libraries. The supported functions are listed below. C++ Language DefinitionThe C++ compiler supports the Embedded C++ language. Embedded C++ is a subset of C++ specifically formulated for embedded systems. It is defined at http://www.caravan.net/ec2plus. Embedded C++ excludes templates, exceptions, namespaces, run-time type information, localization, file operations and some other features. Also Embedded C++ does not support multiple-inheritance and virtual base classes. However the Crossware compiler does support multiple-inheritance but does not support virtual base classes. Since Embedded C++ does not support templates, basic_string is not supported. As an alternative, Embedded C++ provides the string class. The Crossware C++ library includes the string class. The Crossware C++ library also includes the operators new, delete, new[], delete[], placement new and placement new[]. Other Embedded C++ library features such as streams and complex are not yet available in the Crossware library. Data SizesThe compiler uses the following sizes for the various C data types:
OptimizationsOptimizations include:
Since the introduction of C compiler version 3 of the C compiler, additional optimizations can be enabled by instructing the compiler to perform a data flow analysis. Enabling this ‘advanced features’ option leads to:
The ‘advanced features’ option is always enabled for C++ source code. Function Calling ConventionsWhen the ‘advanced features’ option is enabled, the compiler supports three calling conventions: 1. Arguments declared with the register keyword will be passed in registers if an appropriate register is available. Integer arguments are passed in registers D1 and D0. Pointer arguments are passed in registers A1 and A0. If the chip has a floating point unit, floating point arguments are passed in floating point registers FP1 and FP0. The arguments are popped from the stack after the called function returns. (Caller pops stack.) 2. As above except that arguments are popped from the stack by the called function before it returns. (Callee pops stack.) 3. If an appropriate register is available, an argument will be passed in a register. Integer arguments are passed in registers D1 and D0. Pointer arguments are passed in registers A1 and A0. If the chip has a floating point unit, floating point arguments are passed in floating point registers FP1 and FP0. The register keyword will be ignored. The arguments are popped from the stack by the called function before it returns. (Callee pops stack.) In-Line AssemblerAssembler code can be embedded in your C source code using two methods. The _asm keyword can be used to embed assembler into C functions. The #asm/#endasm directive allows assembler to be placed anywhere within a C source file, not just within functions. Strings inserted using the _asm keyword are scanned by the C preprocessor and so assembler statements can be generated using C macros with full macro token replacement. Additionally, the compiler can replace C variable names with the appropriate sub-string allowing easy access to global, static and local variables and parameters. On the other hand, assembler macros are best defined outside of functions and the #asm/#endasm directive allows this. Example in-line assembler code:
Code and data locationCompiler generated code and data are automatically located in appropriate memory segments. Linker options allow these segments to be located at user defined memory locations. String constants and objects declared as const are located in code space. Initialised and uninitialised data are located in separate segments and initialisation of these segments is automatically carried out at run time. Directives are also available allowing you to tell the compiler to place code and data in your own named segments. This gives you further control on where code and data are placed and how data space is initialised. The Diab Data section and use_section pragmas are also supported allowing code that uses these to be compiled unchanged. Source Code BrowsingThe compiler optionally generates information on all of the definitions of and references to the identifiers used in your program. This includes functions, function parameters, local variables, global and static variables, enum identifiers, typedefs, goto labels and the tag names of structures, unions and enums. The Embedded Development Studio will then use this information to allow you to quickly navigate through your source code. Debug RecordsComprehensive debug records are generated by the compiler and embedded in the object files for each module. These are output by the linker to the final program file. C Library Routines
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||