This manual and the CC5X compiler is protected by Norwegian
If more than one person want to use the compiler for each license ..... Arrays, structures and unions. ...... #pragma char @ . ...... m: modify symbols ... -V[rnuD] : generate variable file, .var, sorted by address as default. ...... CC5X use an advanced algorithm to update the bank selection bits.
COMPILER BUG REPORTS: The compiler has been carefully tested and debugged. It is, however, not possible to guarantee a 100 % error free product. If the compiler generates application code bugs, it is almost always possible to rewrite the program slightly in order to avoid the bug. #pragma optimize can be used to avoid optimization bugs. Other #pragma statements are also useful. Please report cases of bad generated code and other serious program errors. 1) Investigate and describe the problem. If possible, please provide a complete C example program that demonstrates the problem. A fragment from the generated assembly file is sometimes enough. 2) This service is intended for difficult compiler problems (not application problems). 3) Language: English 4) State the compiler version. 5) Send your report to [email protected].
Document version: H
2
CC5X C Compiler
B Knudsen Data
CONTENTS 1 INTRODUCTION ..................................................................................................................................7 1.1 SUPPORTED DEVICES ..........................................................................................................................8 1.2 INSTALLATION AND SYSTEM REQUIREMENTS ....................................................................................8 Support for long file names ..................................................................................................................8 User interface .......................................................................................................................................8 1.3 MPLAB SUPPORT ..............................................................................................................................9 1.4 SUMMARY OF DELIVERED FILES ........................................................................................................9 1.5 SHORT PROGRAM EXAMPLE .............................................................................................................10 1.6 DEFINING THE PICMICRO DEVICE ....................................................................................................11 1.7 WHAT TO DO NEXT ...........................................................................................................................12 2 VARIABLES.........................................................................................................................................13 2.1 INFORMATION ON RAM ALLOCATION ..............................................................................................13 2.2 DEFINING VARIABLES ......................................................................................................................14 Integer variables.................................................................................................................................14 Floating point .....................................................................................................................................15 IEEE754 interoperability ...................................................................................................................15 Fixed point variables..........................................................................................................................16 Assigning variables to RAM addresses...............................................................................................18 Supported type modifiers....................................................................................................................19 Local variables ...................................................................................................................................20 Temporary variables ..........................................................................................................................21 Arrays, structures and unions.............................................................................................................21 Bitfields...............................................................................................................................................22 Typedef ...............................................................................................................................................22 2.3 USING RAM BANKS.........................................................................................................................22 The bank type modifier .......................................................................................................................23 RAM bank selection bits .....................................................................................................................23 Local user update regions ..................................................................................................................24 2.4 POINTERS .........................................................................................................................................24 Pointer models....................................................................................................................................25 The 12 bit Core...................................................................................................................................25 The 14 bit core: the IRP bit ................................................................................................................27 2.5 CONST DATA SUPPORT.....................................................................................................................28 Storing 14 bit data ..............................................................................................................................28 Data of size 16 bit or more .................................................................................................................29 Code pages .........................................................................................................................................29 Merging data ......................................................................................................................................29 Examples ............................................................................................................................................30 3 SYNTAX................................................................................................................................................31 3.1 STATEMENTS ....................................................................................................................................31 if statement .........................................................................................................................................31 while statement ...................................................................................................................................31 for statement .......................................................................................................................................31 do statement........................................................................................................................................32 switch statement..................................................................................................................................32 break statement...................................................................................................................................32 continue statement..............................................................................................................................33 return statement..................................................................................................................................33 goto statement.....................................................................................................................................33 3.2 ASSIGNMENT AND CONDITIONS .......................................................................................................33