Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 ユーザーズマニュアル

製品コード
SW006021-1
ページ / 518
 2012 Microchip Technology Inc.
DS52053B
MPLAB
®
 XC8 C Compiler
User’s Guide

ユーザーズマニュアル Microchip Technology XC8 Standard Compiler (Workstation) SW006021-1 SW006021-1 の仕様概要

  • ページ 1: MPLAB XC8 C Compiler User's Guide MPLAB® XC8 C Compiler User’s Guide  2012 Microchip Technology Inc. DS52053B
  • ページ 2Note the following details of the code protection feature on Microchip devices: • Microchip products meet the specification contained in...
  • ページ 3: Table of Contents MPLAB® XC8 C COMPILER USER’S GUIDE Table of Contents Preface ........................................................................................................................... 7 Chapter 1. Compiler Overview 1.1 Introduction ......................................................................................................
  • ページ 4MPLAB® XC8 C Compiler User’s Guide 5.6 Operators and Statements ......................................................................... 179 5.7 Register Usage ........................................................................................... 181 5.8 Functions .......................................................................................................
  • ページ 5 C.12 Statements (G.3.12) ................................................................................ 483 C.13 Preprocessing Directives (G.3.13) ........................................................... 484 C.14 Library Functions (G.3.14) ....................................................................... 485 Glossary ........................................................................................................................
  • ページ 6MPLAB® XC8 C Compiler User’s Guide NOTES: DS52053B-page 6  2012 Microchip Technology Inc.
  • ページ 7: Preface MPLAB® XC8 C COMPILER USER’S GUIDE Preface NOTICE TO CUSTOMERS All documentation becomes dated, and this manual is no...
  • ページ 8MPLAB® XC8 C Compiler User’s Guide CONVENTIONS USED IN THIS GUIDE This manual uses the following documentation conventions: DOCUMENTATION CONVENTIONS...
  • ページ 9 Preface Readme for Chapter Name For the latest information on using Chapter Name, read the “Readme for Chapter Name.txt”...
  • ページ 10MPLAB® XC8 C Compiler User’s Guide CUSTOMER SUPPORT Users of Microchip products can receive assistance through several channels: • Distributor...
  • ページ 11: Chapter 1. Compiler Overview MPLAB® XC8 C COMPILER USER’S GUIDE Chapter 1. Compiler Overview 1.1 INTRODUCTION This chapter is an overview of the...
  • ページ 12MPLAB® XC8 C Compiler User’s Guide 1.3 DEVICE DESCRIPTION This compiler supports 8-bit Microchip PIC devices with baseline, Mid-Range, Enhanced...
  • ページ 13: Chapter 2. Common C Interface MPLAB® XC8 C COMPILER USER’S GUIDE Chapter 2. Common C Interface 2.1 INTRODUCTION The Common C Interface (CCI) is...
  • ページ 14MPLAB® XC8 C Compiler User’s Guide 2.2.1 The ANSI Standard The ANSI C Standard has to reconcile two opposing goals:...
  • ページ 15 Common C Interface For freestanding implementations – or for what we typically call embedded applications – the standard allows...
  • ページ 16MPLAB® XC8 C Compiler User’s Guide 2.3 USING THE CCI The CCI allows enhanced portability by refining implementation-defined behavior and...
  • ページ 17 Common C Interface 2.4 ANSI STANDARD REFINEMENT The following topics describe how the CCI refines the implementation-defined behaviors outlined...
  • ページ 18MPLAB® XC8 C Compiler User’s Guide 2.4.3.2 DIFFERENCES Header file specifications that use directory separators have been allowed in previous...
  • ページ 19 Common C Interface 2.4.5 The Number of Significant Initial Characters in an Identifier At least the first 255 characters...
  • ページ 20MPLAB® XC8 C Compiler User’s Guide 2.4.7 Plain char Types The type of a plain char is unsigned char. It...
  • ページ 21 Common C Interface 2.4.9 Integer conversion When converting an integer type to a signed integer of insufficient size, the...
  • ページ 22MPLAB® XC8 C Compiler User’s Guide 2.4.11.2 DIFFERENCES All compilers have performed right shifting as described in this section. 2.4.11.3...
  • ページ 23 Common C Interface 2.4.13.2 DIFFERENCES The 8-bit compilers have previously issued a warning if type int was used for...
  • ページ 24MPLAB® XC8 C Compiler User’s Guide 2.4.15.1 EXAMPLE The following shows a structure containing bit-fields being defined. struct { unsigned...
  • ページ 25 Common C Interface 2.5 ANSI STANDARD EXTENSIONS The following topics describe how the CCI provides device-specific extensions to the...
  • ページ 26MPLAB® XC8 C Compiler User’s Guide 2.5.2.3 MIGRATION TO THE CCI Avoid making objects and functions absolute if possible. In...
  • ページ 27 Common C Interface 2.5.3.3 MIGRATION TO THE CCI For 8-bit compilers, change any occurrence of the far qualifier, as...
  • ページ 28MPLAB® XC8 C Compiler User’s Guide 2.5.4.3 MIGRATION TO THE CCI For 8-bit compilers, change any occurrence of the near...
  • ページ 29 Common C Interface 2.5.6 X and Y Data Objects The __xdata and __ydata qualifiers may be used to indicate...
  • ページ 30MPLAB® XC8 C Compiler User’s Guide 2.5.7.2 DIFFERENCES The 8-bit compilers have used the four qualifiers bank0, bank1, bank2 and...
  • ページ 31 Common C Interface 2.5.9 EEPROM Objects The __eeprom qualifier may be used to indicate that variables should be positioned...
  • ページ 32MPLAB® XC8 C Compiler User’s Guide save(symbol-list) Save on entry and restore on exit the listed symbols (XC16) irq(irqid) Specify...
  • ページ 33 Common C Interface to void __interrupt(auto_psv,(irq(52)))) myIsr(void); For 32-bit compilers, the __interrupt() keyword takes two parameters, the vector number...
  • ページ 34MPLAB® XC8 C Compiler User’s Guide 2.5.11.3 MIGRATION TO THE CCI No migration is required for XC8. For 16- and...
  • ページ 35 Common C Interface 2.5.13 Assigning Objects to Sections The __section() specifier may be used to indicate that an object...
  • ページ 36MPLAB® XC8 C Compiler User’s Guide 2.5.13.4 CAVEATS With XC8, the __section() specifier cannot be used with any interrupt function....
  • ページ 37 Common C Interface TABLE 2-1: MANIFEST MACROS DEFINED BY THE CCI Name Meaning if defined Example __CCI__ Compiler is...
  • ページ 38MPLAB® XC8 C Compiler User’s Guide 2.5.16 In-line Assembly The asm() statement may be used to insert assembly code in-line...
  • ページ 39 Common C Interface 2.6 COMPILER FEATURES The following items detail compiler options and features that are not directly associated...
  • ページ 40MPLAB® XC8 C Compiler User’s Guide NOTES: DS52053A-page 40  2012 Microchip Technology Inc.
  • ページ 41: Chapter 3. How To’s MPLAB® XC8 C COMPILER USER’S GUIDE Chapter 3. How To’s 3.1 INTRODUCTION This section contains help and references for...
  • ページ 42MPLAB® XC8 C Compiler User’s Guide 3.2.3 Can I Install More Than One Version of the Same Compiler? Yes, the...
  • ページ 43 How To’s 3.3 INVOKING THE COMPILER This section discusses how the compiler is run, both on the command-line and...
  • ページ 44MPLAB® XC8 C Compiler User’s Guide 3.3.4 How Can I Select Which Compiler I Want to Build With? The compilation...
  • ページ 45 How To’s 3.3.7 How Do I Know What Compiler Options Are Available and What They Do? A list of...
  • ページ 46MPLAB® XC8 C Compiler User’s Guide 3.4 WRITING SOURCE CODE This section presents issues pertaining to the source code you...
  • ページ 47 How To’s Only use a cast in situations where the types used by the compiler are not the types...
  • ページ 48MPLAB® XC8 C Compiler User’s Guide 3.4.2 Device-Specific Features This section discusses the code that needs to be written to...
  • ページ 49 How To’s 3.4.2.5 HOW DO I FIND THE NAMES USED TO REPRESENT SFRS AND BITS? Special function registers and...
  • ページ 50MPLAB® XC8 C Compiler User’s Guide 3.4.3.3 HOW DO I PLACE VARIABLES IN PROGRAM MEMORY? The const qualifier implies that...
  • ページ 51 How To’s 3.4.4.2 HOW CAN I ACCESS INDIVIDUAL BITS OF A VARIABLE? There are several ways of doing this....
  • ページ 52MPLAB® XC8 C Compiler User’s Guide 3.4.5 Functions This section examines questions that relate to functions. • What is the...
  • ページ 53 How To’s 3.4.6 Interrupts Interrupt and interrupt service routine questions are discussed in this section. • How Do I...
  • ページ 54MPLAB® XC8 C Compiler User’s Guide 3.4.7.2 WHAT DO I NEED OTHER THAN INSTRUCTIONS IN AN ASSEMBLY SOURCE FILE? Assembly...
  • ページ 55 How To’s • You must ensure that the address of the RAM variable you are accessing has been masked...
  • ページ 56MPLAB® XC8 C Compiler User’s Guide 3.5 GETTING MY APPLICATION TO DO WHAT I WANT This section provides programming techniques,...
  • ページ 57 How To’s The contents of the HEX file for the bootloader can be merged with the code of the...
  • ページ 58MPLAB® XC8 C Compiler User’s Guide 3.5.5 How Do I Share Data Between Interrupt and Main-line Code? Variables accessed from...
  • ページ 59 How To’s A stub for the putch function can be found in the compiler’s sources directory. Copy it into...
  • ページ 60MPLAB® XC8 C Compiler User’s Guide 3.6 UNDERSTANDING THE COMPILATION PROCESS This section tells you how to find out what...
  • ページ 61 How To’s 3.6.2 How Can I Make My Code Smaller? There are a number of ways that this can...
  • ページ 62MPLAB® XC8 C Compiler User’s Guide 3.6.3 How Can I Reduce RAM Usage? Use the smallest data types possible. (This...
  • ページ 63 How To’s 3.6.6 How Can I Make My Interrupt Routine Faster? Consider suggestions made in Section 3.6.2 “How Can...
  • ページ 64MPLAB® XC8 C Compiler User’s Guide 3.6.10 How Do I Utilize the Linear Memory on Enhanced Mid-range PIC Devices? The...
  • ページ 65 How To’s The list of functions, memory location and size is available in a file called funclist. Each function...
  • ページ 66MPLAB® XC8 C Compiler User’s Guide 3.6.17 How Do I Know How Much Memory Is Still Available? Although the memory...
  • ページ 67 How To’s 3.7 FIXING CODE THAT DOES NOT WORK This section examines issues relating to projects that do not...
  • ページ 68MPLAB® XC8 C Compiler User’s Guide Finally, there are errors that do not relate to any particular line of code...
  • ページ 69 How To’s • Make sure you do not have a "read-modify-write" problem. If the device you are using does...
  • ページ 70MPLAB® XC8 C Compiler User’s Guide 3.7.8 How Do I Fix a Fixup Overflow Error? Fixup — the process of...
  • ページ 71: Chapter 4. XC8 Command-line Driver MPLAB® XC8 C COMPILER USER’S GUIDE Chapter 4. XC8 Command-line Driver 4.1 INTRODUCTION The name of the command-line driver...
  • ページ 72MPLAB® XC8 C Compiler User’s Guide 4.2 INVOKING THE COMPILER This section explain how to invoke xc8 on the command...
  • ページ 73 XC8 Command-line Driver 4.2.2 Environment Variables When hosted on a Windows environment, the compiler uses the registry to store...
  • ページ 74MPLAB® XC8 C Compiler User’s Guide There are no compiler restrictions imposed on the names of source files, but be...
  • ページ 75 XC8 Command-line Driver 4.3 THE COMPILATION SEQUENCE When you compile a project, there are many internal applications that are...
  • ページ 76MPLAB® XC8 C Compiler User’s Guide Table 4-2 lists the compiler applications. The names shown are the names of the...
  • ページ 77 XC8 Command-line Driver FIGURE 4-2: MULTI-FILE COMPILATION Intermediate files preprocess p- C file & code parse preprocess p- code...
  • ページ 78MPLAB® XC8 C Compiler User’s Guide FIGURE 4-3: THE TRADITIONAL COMPILATION SEQUENCE Intermediate files preprocess code .obj C file &...
  • ページ 79 XC8 Command-line Driver 4.3.3 Multi-Step Compilation Make utilities and IDEs, such as MPLAB IDE, allow for an incremental build...
  • ページ 80MPLAB® XC8 C Compiler User’s Guide 4.3.4 Compilation of Assembly Source Since the code generator performs many tasks that were...
  • ページ 81 XC8 Command-line Driver 4.4 RUNTIME FILES In addition to the C and assembly source files specified on the command...
  • ページ 82MPLAB® XC8 C Compiler User’s Guide 4.4.1.2 USER-DEFINED LIBRARIES User-defined libraries may be created and linked in with programs as...
  • ページ 83 XC8 Command-line Driver Generation of the runtime startup code is an automatic process which does not require any user...
  • ページ 84MPLAB® XC8 C Compiler User’s Guide 4.5 COMPILER OUTPUT There are many files created by the compiler during the compilation....
  • ページ 85 XC8 Command-line Driver 4.5.2 Diagnostic Files Two valuable files produced by the compiler are the assembly list file, produced...
  • ページ 86MPLAB® XC8 C Compiler User’s Guide 4.6 COMPILER MESSAGES All compiler applications, including the command-line driver, xc8, use textual mes-...
  • ページ 87 XC8 Command-line Driver 4.6.2 Message Language xc8 supports more than one language for displayed messages. There is one MDF...
  • ページ 88MPLAB® XC8 C Compiler User’s Guide 4.6.4 Message Format By default, messages are printed in a human-readable format. This format...
  • ページ 89 XC8 Command-line Driver For example, a project is compiled, but, as shown, produces a warning from the parser and...
  • ページ 90MPLAB® XC8 C Compiler User’s Guide 4.6.5 Changing Message Behavior Both the attributes of individual messages and general settings for...
  • ページ 91 XC8 Command-line Driver 4.7 XC8 DRIVER OPTIONS This section looks at the general form of xc8 command-line options and...
  • ページ 92MPLAB® XC8 C Compiler User’s Guide 4.8 OPTION DESCRIPTIONS Most aspects of the compilation can be controlled using the command-line...
  • ページ 93 XC8 Command-line Driver TABLE 4-6: DRIVER OPTIONS (CONTINUED) Option Meaning --MSGDISABLE=list Disable warning messages --MSGFORMAT=specification Set advisory message format...
  • ページ 94MPLAB® XC8 C Compiler User’s Guide 4.8.2 -D: Define Macro The -D option is used to define a preprocessor macro...
  • ページ 95 XC8 Command-line Driver 4.8.4 -G: Generate Source-Level Symbol File The -G option allows specification of the filename used for...
  • ページ 96MPLAB® XC8 C Compiler User’s Guide 4.8.7 -L-: Adjust Linker Options Directly The -L driver option can be used to...
  • ページ 97 XC8 Command-line Driver 4.8.9 -N: Identifier Length This option allows the significant C identifier length (used by functions and...
  • ページ 98MPLAB® XC8 C Compiler User’s Guide 4.8.13 -S: Compile to Assembler Code The -S option stops compilation after generating an...
  • ページ 99 XC8 Command-line Driver 4.8.16 --ADDRQUAL: Set Compiler Response to Memory Qualifiers The --ADDRQUAL option indicates the compiler’s response to...
  • ページ 100MPLAB® XC8 C Compiler User’s Guide 4.8.19 --CHECKSUM: Calculate a Checksum This option will perform a checksum over the address...
  • ページ 101 XC8 Command-line Driver 4.8.22 --CODEOFFSET: Offset Program Code to Address In some circumstances, such as bootloaders, it is necessary...
  • ページ 102MPLAB® XC8 C Compiler User’s Guide 4.8.24 --DOUBLE: Select Kind of Double Types This option allows the kind of double-precision...
  • ページ 103 XC8 Command-line Driver 4.8.27 --ERRATA: Specify Errata Workarounds This option allows specification of software workarounds to documented silicon errata...
  • ページ 104MPLAB® XC8 C Compiler User’s Guide 4.8.28 --ERRFORMAT: Define Format for Compiler Messages If the --ERRFORMAT option is not used,...
  • ページ 105 XC8 Command-line Driver • The options following fill_expr result in the following behavior: - @unused (or nothing) fill all...
  • ページ 106MPLAB® XC8 C Compiler User’s Guide 4.8.34 --HTML: Generate HTML Diagnostic Files This option will generate a series of HTML...
  • ページ 107 XC8 Command-line Driver Only those modes permitted by the compiler license status will be accepted. For exam- ple if...
  • ページ 108MPLAB® XC8 C Compiler User’s Guide 4.8.42 --OPT: Invoke Compiler Optimizations The --OPT option allows control of all the compiler...
  • ページ 109 XC8 Command-line Driver 4.8.44 --OUTPUT= type: Specify Output File Type This option allows the type of the output file(s)...
  • ページ 110MPLAB® XC8 C Compiler User’s Guide 4.8.47 --PROTO: Generate Prototypes The --PROTO option is used to generate .pro files containing...
  • ページ 111 XC8 Command-line Driver 4.8.48 --RAM: Adjust RAM Ranges This option is used to adjust the default RAM, which is...
  • ページ 112MPLAB® XC8 C Compiler User’s Guide 4.8.49 --ROM: Adjust ROM Ranges This option is used to change the default ROM...
  • ページ 113 XC8 Command-line Driver Note that the code that clears or initializes variables, which is included by default, will clobber...
  • ページ 114MPLAB® XC8 C Compiler User’s Guide 4.8.51 --SCANDEP: Scan for Dependencies When this option is used, .dep and .d dependency...
  • ページ 115 XC8 Command-line Driver 4.8.55 --STRICT: Strict ANSI Conformance The --STRICT option is used to enable strict ANSI C conformance...
  • ページ 116MPLAB® XC8 C Compiler User’s Guide 4.8.59 --WARN: Set Warning Level The --WARN option is used to set the compiler...
  • ページ 117 XC8 Command-line Driver 4.9 MPLAB IDE V8 UNIVERSAL TOOLSUITE EQUIVALENTS When compiling from within Microchip’s MPLAB IDE, it is...
  • ページ 118MPLAB® XC8 C Compiler User’s Guide 4.9.1 Directories Tab The options in this dialog control the output and search directories...
  • ページ 119 XC8 Command-line Driver 4.9.2 Compiler Tab The options in this dialog control the aspects of compilation up to code...
  • ページ 120MPLAB® XC8 C Compiler User’s Guide 6. Verbose: This checkbox controls whether the full command-lines for the compiler applications are...
  • ページ 121 XC8 Command-line Driver 1. Runtime options: These checkboxes control the many runtime features the com- piler can employ. See...
  • ページ 122MPLAB® XC8 C Compiler User’s Guide 4.9.4 Global Tab The options in this dialog control aspects of compilation that are...
  • ページ 123 XC8 Command-line Driver 7. External memory: This option affect the code generated when accessing the external data interface on...
  • ページ 124MPLAB® XC8 C Compiler User’s Guide 4.10 MPLAB X UNIVERSAL TOOLSUITE EQUIVALENTS When compiling under the MPLAB X IDE, it...
  • ページ 125 XC8 Command-line Driver 4.10.2 Compiler Category The panels in this category control aspects of compilation of C source. 4.10.2.1...
  • ページ 126MPLAB® XC8 C Compiler User’s Guide 4.10.2.2 OPTIMIZATION These options, shown in Figure 4-11, relate to optimizations performed by the...
  • ページ 127 XC8 Command-line Driver 4.10.3 Linker Category The options in this dialog control the aspects of the second stage of...
  • ページ 128MPLAB® XC8 C Compiler User’s Guide 4.10.3.2 REPORTING These options, shown in Figure 4-14 relate to information produced during and...
  • ページ 129 XC8 Command-line Driver 4.10.3.3 ADDITIONAL These options, shown in Figure 4-15 relate to miscellaneous options. 1. Fill: This field...
  • ページ 130MPLAB® XC8 C Compiler User’s Guide NOTES: DS52053B-page 130  2012 Microchip Technology Inc.
  • ページ 131: Chapter 5. C Language Features MPLAB® XC8 C COMPILER USER’S GUIDE Chapter 5. C Language Features 5.1 INTRODUCTION MPLAB XC8 C Compiler supports a...
  • ページ 132MPLAB® XC8 C Compiler User’s Guide 5.2.3 Common Compiler Interface Standard This compiler conforms to the Microchip XC compiler Common...
  • ページ 133 C Language Features 5.3 DEVICE-RELATED FEATURES MPLAB XC8 has several features which relate directly to the 8-bit PIC architectures...
  • ページ 134MPLAB® XC8 C Compiler User’s Guide 5.3.3 Device Header Files There is one header file that is typically included into...
  • ページ 135 C Language Features 5.3.5 Configuration Bit Access The PIC devices have several locations which contain the configuration bits or...
  • ページ 136MPLAB® XC8 C Compiler User’s Guide 5.3.5.1 LEGACY SUPPORT FOR PIC18 DEVICES You may continue to use the PIC18 configuration...
  • ページ 137 C Language Features 5.3.6 Using SFRs From C Code The Special Function Registers (SFRs) are registers which control aspects...
  • ページ 138MPLAB® XC8 C Compiler User’s Guide 5.3.6.1 SPECIAL BASELINE/MID-RANGE REGISTER ISSUES Some SFRs are not memory mapped, do not have...
  • ページ 139 C Language Features 5.3.7 ID Locations The 8-bit PIC devices have locations outside the addressable memory area that can...
  • ページ 140MPLAB® XC8 C Compiler User’s Guide 5.3.8 Bit Instructions Wherever possible, the MPLAB XC8 C Compiler will attempt to use...
  • ページ 141 C Language Features 5.3.9.1 OSCILLATOR CALIBRATION CONSTANTS Some Baseline and Mid-range devices come with an oscillator calibration constant which...
  • ページ 142MPLAB® XC8 C Compiler User’s Guide 5.3.10 REAL ICE Support The compiler supports log and trace functions (instrumented trace) when...
  • ページ 143 C Language Features 5.4 SUPPORTED DATA TYPES AND VARIABLES 5.4.1 Identifiers A C variable identifier (the following is also...
  • ページ 144MPLAB® XC8 C Compiler User’s Guide Signed values are stored as a two’s complement integer value. The range of values...
  • ページ 145 C Language Features 5.4.2.1 BIT DATA TYPES AND VARIABLES The MPLAB XC8 C Compiler supports bit integral types which...
  • ページ 146MPLAB® XC8 C Compiler User’s Guide 5.4.3 Floating-Point Data Types The MPLAB XC8 compiler supports 24- and 32-bit floating-point types....
  • ページ 147 C Language Features Here are some examples of the IEEE 754 32-bit formats shown in Table 5-5. Note that...
  • ページ 148MPLAB® XC8 C Compiler User’s Guide Two sets of macros are available for float and double types, where XXX represents...
  • ページ 149 C Language Features 5.4.4 Structures and Unions MPLAB XC8 C Compiler supports struct and union types. Structures and unions...
  • ページ 150MPLAB® XC8 C Compiler User’s Guide 5.4.4.2 BIT-FIELDS IN STRUCTURES MPLAB XC8 C Compiler fully supports bit-fields in structures. Bit-fields...
  • ページ 151 C Language Features The MPLAB XC8 compiler supports anonymous unions. These are unions with no identifier and whose members...
  • ページ 152MPLAB® XC8 C Compiler User’s Guide 5.4.5 Pointer Types There are two basic pointer types supported by the MPLAB XC8...
  • ページ 153 C Language Features 5.4.5.2 DATA POINTERS The MPLAB XC8 compiler monitors and records all assignments of addresses to each...
  • ページ 154MPLAB® XC8 C Compiler User’s Guide Information about the pointers and their targets are shown in the pointer reference graph,...
  • ページ 155 C Language Features 5.4.5.2.1 Pointers to Both Memory Spaces When a pointer is assigned the address of one or...
  • ページ 156MPLAB® XC8 C Compiler User’s Guide 5.4.5.3 FUNCTION POINTERS The MPLAB XC8 compiler fully supports pointers to functions, which allows...
  • ページ 157 C Language Features Note that the const array does not need initial values to be specified in this instance,...
  • ページ 158MPLAB® XC8 C Compiler User’s Guide 5.4.6 Constant Types and Formats A constant is used to represent an immediate value...
  • ページ 159 C Language Features Here is an example of code that may fail because the default type assigned to a...
  • ページ 160MPLAB® XC8 C Compiler User’s Guide 5.4.6.3 CHARACTER AND STRING CONSTANTS Character constants are enclosed by single quote characters, ’,...
  • ページ 161 C Language Features 5.4.7 Standard Type Qualifiers Type qualifiers provide additional information regarding how an object may be used....
  • ページ 162MPLAB® XC8 C Compiler User’s Guide A C statement that consists only of a volatile variable’s name will produce code...
  • ページ 163 C Language Features This qualifier is controlled by the compiler option --ADDRQUAL, which determines its effect, see Section 4.8.16...
  • ページ 164MPLAB® XC8 C Compiler User’s Guide Although a few devices implement more than 4 banks of data RAM, bank qualifiers...
  • ページ 165 C Language Features 5.5 MEMORY ALLOCATION AND ACCESS There are two broad groups of RAM-based variables: auto/parameter variables, which...
  • ページ 166MPLAB® XC8 C Compiler User’s Guide Note: The terms “local” and “global” are commonly used to describe variables, but are...
  • ページ 167 C Language Features Note that the data psect used to hold initialized variables is the psect that holds the...
  • ページ 168MPLAB® XC8 C Compiler User’s Guide With any device, reserving memory in general purpose RAM (see Section 4.8.48 “--RAM: Adjust...
  • ページ 169 C Language Features 5.5.2.2 AUTO VARIABLE ALLOCATION AND ACCESS This section discusses allocation of auto variables (those with automatic...
  • ページ 170MPLAB® XC8 C Compiler User’s Guide Fundamental to the generation of the compiled stack is the call graph, which defines...
  • ページ 171 C Language Features Figure 5-3 graphically shows an example of how the compiled stack is formed. FIGURE 5-3: FORMATION...
  • ページ 172MPLAB® XC8 C Compiler User’s Guide The end result is a block of memory which forms the compiled stack. This...
  • ページ 173 C Language Features 5.5.3 Variables in Program Space The only variables that are placed into program memory are those...
  • ページ 174MPLAB® XC8 C Compiler User’s Guide 5.5.3.1 SIZE LIMITATIONS OF CONST VARIABLES Arrays of any type (including arrays of aggregate...
  • ページ 175 C Language Features 5.5.4 Absolute Variables Most variables can be located at an absolute address by following its declaration...
  • ページ 176MPLAB® XC8 C Compiler User’s Guide 5.5.4.2 ABSOLUTE OBJECTS IN PROGRAM MEMORY Non-auto objects qualified const can also be made...
  • ページ 177 C Language Features 5.5.5.2 EEPROM ACCESS FUNCTIONS The library functions eeprom_read() and eeprom_write(), can be called to read from,...
  • ページ 178MPLAB® XC8 C Compiler User’s Guide 5.5.6 Variables in Registers Allocating variables to registers, rather than to a memory location,...
  • ページ 179 C Language Features 5.6 OPERATORS AND STATEMENTS The MPLAB XC8 C Compiler supports all the ANSI operators. The exact...
  • ページ 180MPLAB® XC8 C Compiler User’s Guide The consequence of integral promotion as illustrated above is that operations are not performed...
  • ページ 181 C Language Features 5.7 REGISTER USAGE The assembly generated from C source code by the compiler will use certain...
  • ページ 182MPLAB® XC8 C Compiler User’s Guide 5.8 FUNCTIONS Functions may be written in the usual way in accordance with the...
  • ページ 183 C Language Features This specifier performs the same task as the #pragma inline directive, see Section 5.14.4.4 “The #pragma...
  • ページ 184MPLAB® XC8 C Compiler User’s Guide in one page to a label in another must use a longer sequence of...
  • ページ 185 C Language Features If this construct is used with interrupt functions it will only affect the position of the...
  • ページ 186MPLAB® XC8 C Compiler User’s Guide Unlike auto variables, parameter variables are allocated memory strictly in the order in which...
  • ページ 187 C Language Features 5.8.7 Function Return Values Function return values are passed to the calling function using either the...
  • ページ 188MPLAB® XC8 C Compiler User’s Guide 5.8.8.1 BANK SELECTION WITHIN FUNCTIONS A function can, and may, return with any RAM...
  • ページ 189 C Language Features 5.9 INTERRUPTS The MPLAB XC8 compiler incorporates features allowing interrupts to be fully handled from C...
  • ページ 190MPLAB® XC8 C Compiler User’s Guide An example of an interrupt function is shown here. int tick_count; void interrupt tc_int(void)...
  • ページ 191 C Language Features 5.9.3 Context Switching 5.9.3.1 CONTEXT SAVING ON INTERRUPTS Some registers are automatically saved by the hardware...
  • ページ 192MPLAB® XC8 C Compiler User’s Guide 5.9.4 Enabling Interrupts Two macros are available, once you have included <xc.h>, which control...
  • ページ 193 C Language Features Examination of the assembly list file will show assembly code for both the original and duplicate...
  • ページ 194MPLAB® XC8 C Compiler User’s Guide 5.10 MAIN, RUNTIME STARTUP AND RESET The identifier main is special. You must always...
  • ページ 195 C Language Features 5.10.1.1 INITIALIZATION OF OBJECTS One task of the runtime startup code is to ensure that any...
  • ページ 196MPLAB® XC8 C Compiler User’s Guide The psects used for storing these components are described in Section 5.15.2 “Compiler-Generated Psects”...
  • ページ 197 C Language Features 5.10.1.4 STATUS REGISTER PRESERVATION The resetbits suboption of the --RUNTIME option (see 4.8.50 “--RUNTIME: Spec- ify...
  • ページ 198MPLAB® XC8 C Compiler User’s Guide 5.11 LIBRARY ROUTINES 5.11.0.1 USING LIBRARY ROUTINES Library functions (and any associated variables) will...
  • ページ 199 C Language Features As more features of printf() are detected, the size of the code generated for the printf()...
  • ページ 200MPLAB® XC8 C Compiler User’s Guide 5.12 MIXING C AND ASSEMBLY CODE Assembly language code can be mixed with C...
  • ページ 201 C Language Features See Section 6.4.9.3 “PSECT” for detailed information on the flags used with the PSECT assembler directive....
  • ページ 202MPLAB® XC8 C Compiler User’s Guide Here is an example of the complete routine for a mid-range device which could...
  • ページ 203 C Language Features You may use the asm() form of inline assembly at any point in the C source...
  • ページ 204MPLAB® XC8 C Compiler User’s Guide 5.12.3.1 EQUIVALENT ASSEMBLY SYMBOLS Most C symbols map to an corresponding assembly equivalent. This...
  • ページ 205 C Language Features If there is more than one static function with the same name, and they contain defi-...
  • ページ 206MPLAB® XC8 C Compiler User’s Guide If you wish to access register definitions from assembly that is inline with C...
  • ページ 207 C Language Features 5.12.3.4 UNDEFINED SYMBOLS If a variable needs to be accessible from both assembly and C source...
  • ページ 208MPLAB® XC8 C Compiler User’s Guide 5.13 OPTIMIZATIONS The optimizations in MPLAB XC8 compiler can broadly be broadly grouped into...
  • ページ 209 C Language Features Variables assigned a value before being read are not cleared or initialized by the runtime startup...
  • ページ 210MPLAB® XC8 C Compiler User’s Guide 5.14 PREPROCESSING All C source files are preprocessed before compilation. The preprocessed file is...
  • ページ 211 C Language Features TABLE 5-11: PREPROCESSOR DIRECTIVES Directive Meaning Example # Preprocessor null directive, do nothing # #assert Generate...
  • ページ 212MPLAB® XC8 C Compiler User’s Guide 5.14.3 Predefined Macros The compiler drivers define certain symbols to the preprocessor, allowing conditional...
  • ページ 213 C Language Features TABLE 5-12: PREDEFINED MACROS (CONTINUED) Symbol When set Usage _EEPROMSIZE Always To indicate how many bytes...
  • ページ 214MPLAB® XC8 C Compiler User’s Guide TABLE 5-12: PREDEFINED MACROS (CONTINUED) Symbol When set Usage HI_TECH_C Always To indicate that...
  • ページ 215 C Language Features 5.14.4.1 THE #PRAGMA ADDRQUAL DIRECTIVE This directive allows you to control the compiler’s response to non-standard...
  • ページ 216MPLAB® XC8 C Compiler User’s Guide 5.14.4.7 THE #PRAGMA PRINTF_CHECK DIRECTIVE Certain library functions accept a format string followed by...
  • ページ 217 C Language Features This pragma affects the entire module in which it is located, regardless of the position of...
  • ページ 218MPLAB® XC8 C Compiler User’s Guide So it is allocated to a textn psect. The source code for the masher()...
  • ページ 219 C Language Features 5.14.4.9 THE #PRAGMA REGSUSED DIRECTIVE The #pragma regsused directive allows the programmer to indicate register usage...
  • ページ 220MPLAB® XC8 C Compiler User’s Guide Specifying the time option to the #pragma switch directive forces the compiler to generate...
  • ページ 221 C Language Features 5.14.4.11.2 The Warning Error/warning Pragma It is also possible to change the type of some messages....
  • ページ 222MPLAB® XC8 C Compiler User’s Guide 5.15 LINKING PROGRAMS The compiler will automatically invoke the linker unless the compiler has...
  • ページ 223 C Language Features 5.15.1.2 THE COMPILER EQUIVALENT Let’s now look at the similarities and differences between this situation and...
  • ページ 224MPLAB® XC8 C Compiler User’s Guide 5.15.1.2.2 Boxes, Labels and Sections In our analogy, the components for each order are...
  • ページ 225 C Language Features 5.15.1.2.3 Down the Conveyor Belt and Object files Once the robot has assembled an order and...
  • ページ 226MPLAB® XC8 C Compiler User’s Guide TABLE 5-15: SECTION NAMES FOR OUR SIMPLE EXAMPLE Section name Contents Linker class Memory...
  • ページ 227 C Language Features This process continues until all the program has been generated. The output is passed to the...
  • ページ 228MPLAB® XC8 C Compiler User’s Guide The compiler can, and often does, use more than one class to represent the...
  • ページ 229 C Language Features The assembly code associated with ordinary functions is still placed in a “text” section, but as...
  • ページ 230MPLAB® XC8 C Compiler User’s Guide Previously all uninitialized variables were placed in the bss0 section. Now the code generator...
  • ページ 231 C Language Features The hold of a ship or aircraft might be a very large space, but freight is...
  • ページ 232MPLAB® XC8 C Compiler User’s Guide If assembly code is not in a section, the compiler will actually place it...
  • ページ 233 C Language Features 5.15.2.1 PROGRAM SPACE PSECTS checksum This is a psect that is used to mark the position...
  • ページ 234MPLAB® XC8 C Compiler User’s Guide intentry Contains the entry code for the interrupt service routine which is linked to...
  • ページ 235 C Language Features stringtext The stringtext psect is used for const objects when compiling for baseline devices. This psect...
  • ページ 236MPLAB® XC8 C Compiler User’s Guide 5.15.3 Default Linker Classes The linker uses classes to represent memory ranges. For an...
  • ページ 237 C Language Features 5.15.3.2 DATA MEMORY CLASSES RAM consist of ranges that cover all the general purpose RAM memory...
  • ページ 238MPLAB® XC8 C Compiler User’s Guide All library source code is written in C, and the p-code library files that...
  • ページ 239 C Language Features 5.15.6 Linker-Defined Symbols The linker defines some special symbols that can be used to determine where...
  • ページ 240MPLAB® XC8 C Compiler User’s Guide NOTES: DS52053B-page 240  2012 Microchip Technology Inc.
  • ページ 241: Chapter 6. Macro Assembler MPLAB® XC8 C COMPILER USER’S GUIDE Chapter 6. Macro Assembler 6.1 INTRODUCTION Two macro assemblers are included with the...
  • ページ 242MPLAB® XC8 C Compiler User’s Guide 6.3 OPTIONS The command line options recognized by ASPIC[18] are given in Table 6-1,...
  • ページ 243 Macro Assembler 6.3.3 -E: Specify Error Format/File The default format for an error message is in the form: filename:...
  • ページ 244MPLAB® XC8 C Compiler User’s Guide 6.3.9 -O: Specify Output File By default the assembler determines the name of the...
  • ページ 245 Macro Assembler 6.3.16 --EDF: Set Message File Path This option is mainly used by the command-line driver, xc8, to...
  • ページ 246MPLAB® XC8 C Compiler User’s Guide 6.4 MPLAB XC8 ASSEMBLY LANGUAGE The source language accepted by the macro assembler, ASPIC[18],...
  • ページ 247 Macro Assembler For example, the following instructions show the W register being moved to first, an absolute location and...
  • ページ 248MPLAB® XC8 C Compiler User’s Guide 6.4.1.4 LONG JUMPS AND CALLS The assembler recognizes several mnemonics which expand into regular...
  • ページ 249 Macro Assembler 6.4.2 Statement Formats Legal statement formats are shown in Table Section Table 6-2: “ASPIC[18] Statement Formats”. The...
  • ページ 250MPLAB® XC8 C Compiler User’s Guide 6.4.4.1 SPECIAL COMMENT STRINGS Several comment strings are appended to compiler-generated assembly instructions by...
  • ページ 251 Macro Assembler 6.4.6 Identifiers Assembly identifiers are user-defined symbols representing memory locations or num- bers. A symbol may contain...
  • ページ 252MPLAB® XC8 C Compiler User’s Guide Any address offset added to $ has the native addressability of the target device....
  • ページ 253 Macro Assembler Labels may be used (and are preferred) in assembly code, rather than using an abso- lute address...
  • ページ 254MPLAB® XC8 C Compiler User’s Guide 6.4.8 Program Sections Program sections, or psects, are simply a section of code or...
  • ページ 255 Macro Assembler TABLE 6-5: ASPIC[18] ASSEMBLER DIRECTIVES (CONTINUED) Directive Purpose PAGESEL Generate set/clear instruction to set PCLATH bits for...
  • ページ 256MPLAB® XC8 C Compiler User’s Guide 6.4.9.3 PSECT The PSECT directive declares or resumes a program section. For an introductory...
  • ページ 257 Macro Assembler 6.4.9.3.3 Class The class flag specifies a corresponding linker class name for this psect. A class is...
  • ページ 258MPLAB® XC8 C Compiler User’s Guide 6.4.9.3.9 Ovrld A psect defined as ovrld will have the contribution from each module...
  • ページ 259 Macro Assembler 6.4.9.4 ORG The ORG directive changes the value of the location counter within the current psect. This...
  • ページ 260MPLAB® XC8 C Compiler User’s Guide 6.4.9.7 DB The DB directive is used to initialize storage as bytes. The argument...
  • ページ 261 Macro Assembler 6.4.9.11 DABS This directive allows one or more bytes of memory to be reserved at the specified...
  • ページ 262MPLAB® XC8 C Compiler User’s Guide 6.4.9.13 MACRO AND ENDM These directives provide for the definition of assembly macros, optionally...
  • ページ 263 Macro Assembler 6.4.9.14 LOCAL The LOCAL directive allows unique labels to be defined for each expansion of a given...
  • ページ 264MPLAB® XC8 C Compiler User’s Guide 6.4.9.17 IRP AND IRPC The IRP and IRPC directives operate in a similar way...
  • ページ 265 Macro Assembler 6.4.9.21 SIGNAT This directive is used to associate a 16-bit signature value with a label. At link...
  • ページ 266MPLAB® XC8 C Compiler User’s Guide 6.4.10.1 ASMOPT_OFF AND ASMOPT_ON These controls allow the assembler optimizer to be selectively disabled...
  • ページ 267 Macro Assembler 6.4.10.6 NOCOND Using this control will prevent conditional code from being included in the assembly list file...
  • ページ 268MPLAB® XC8 C Compiler User’s Guide 6.5 ASSEMBLY-LEVEL OPTIMIZATIONS The assembler performs optimizations on assembly code in addition to those...
  • ページ 269 Macro Assembler 6.6 ASSEMBLY LIST FILES The assembler will produce an assembly list file if instructed. The xc8 driver...
  • ページ 270MPLAB® XC8 C Compiler User’s Guide 6.6.2 Psect Information The assembly list file can be used to determine the name...
  • ページ 271 Macro Assembler FIGURE 6-2: FUNCTION INFORMATION 1 *************** function _render ***************** 4064 ;; 4065 ;; Defined at: 4066 ;;...
  • ページ 272MPLAB® XC8 C Compiler User’s Guide 6.6.4 Switch Statement Information Along with the generated code for each switch statement is...
  • ページ 273 Macro Assembler 6.6.6 Call Graph The other important information block in the assembly list file is the call graph...
  • ページ 274MPLAB® XC8 C Compiler User’s Guide All the functions that main() calls, or may call, are shown below. These have...
  • ページ 275 Macro Assembler The code generator also produces a warning if the maximum stack depth appears to have been exceeded....
  • ページ 276MPLAB® XC8 C Compiler User’s Guide NOTES: DS52053B-page 276  2012 Microchip Technology Inc.
  • ページ 277: Chapter 7. Linker MPLAB® XC8 C COMPILER USER’S GUIDE Chapter 7. Linker 7.1 INTRODUCTION This chapter describes the theory behind, and the...
  • ページ 278MPLAB® XC8 C Compiler User’s Guide TABLE 7-1: LINKER COMMAND-LINE OPTIONS (CONTINUED) Option Effect -I Ignore undefined symbols -J num...
  • ページ 279 Linker 7.2.1 -Aclass =low-high,... Normally psects are linked according to the information given to a -P option (see Section...
  • ページ 280MPLAB® XC8 C Compiler User’s Guide 7.2.7 -F Normally the linker will produce an object file that contains both program...
  • ページ 281 Linker 7.2.11 -I Usually failure to resolve a reference to an undefined symbol is a fatal error. Use of...
  • ページ 282MPLAB® XC8 C Compiler User’s Guide If present, the minimum value, min, is preceded by a + sign. It sets...
  • ページ 283 Linker The final link and load address of psects are shown in the map file. See Section 7.4.2.2 “Psect...
  • ページ 284MPLAB® XC8 C Compiler User’s Guide 7.2.28 --DISL=message numbers Disable Messages This option is mainly used by the command-line driver,...
  • ページ 285 Linker 7.3 RELOCATION AND PSECTS This section looks at the input files that the linker has to work with....
  • ページ 286MPLAB® XC8 C Compiler User’s Guide 7.4 MAP FILES The map file contains information relating to the relocation of psects...
  • ページ 287 Linker A typical map file may begin something like the following. This example has been cut down for clarity....
  • ページ 288MPLAB® XC8 C Compiler User’s Guide The load address, which is often the same as the link address, is the...
  • ページ 289 Linker 7.4.2.4 SEGMENT LISTING The class listing in the map file is followed by a listing of segments. A...
  • ページ 290MPLAB® XC8 C Compiler User’s Guide If the psect of a symbol is shown as (abs), this implies that the...
  • ページ 291: Chapter 8. Utilities MPLAB® XC8 C COMPILER USER’S GUIDE Chapter 8. Utilities 8.1 INTRODUCTION This chapters discusses some of the utility applications...
  • ページ 292MPLAB® XC8 C Compiler User’s Guide 8.2.2 Using the Librarian Library files can be built directly using the command-line driver,...
  • ページ 293 Utilities The o key takes a list of module names and re-orders the matching modules in the library file...
  • ページ 294MPLAB® XC8 C Compiler User’s Guide 8.2.5 Error Messages LIBR issues various error messages, most of which represent a fatal...
  • ページ 295 Utilities 8.3 OBJTOHEX The linker is capable of producing object files as output. Any other format required must be...
  • ページ 296MPLAB® XC8 C Compiler User’s Guide 8.3.1 Checksum Specifications If you are generating a HEX file output, use HEXMATE’s checksum...
  • ページ 297 Utilities 8.4 CREF The cross reference list utility, CREF, is used to format raw cross-reference information produced by the...
  • ページ 298MPLAB® XC8 C Compiler User’s Guide 8.4.4 -Ooutfile Allows specification of the output file name. By default the listing will...
  • ページ 299 Utilities 8.4.11 --VER: Print Version Number This option prints information relating to the version and build of CREF. CREF...
  • ページ 300MPLAB® XC8 C Compiler User’s Guide 8.5 CROMWELL The CROMWELL utility converts code and symbol files into different formats. These...
  • ページ 301 Utilities 8.5.1 -Pname[,architecture] The -P options takes a string which is the name of the device used. CROMWELL may...
  • ページ 302MPLAB® XC8 C Compiler User’s Guide 8.5.8 -L Use this option to show what file format types are supported. A...
  • ページ 303 Utilities 8.6 HEXMATE The HEXMATE utility is a program designed to manipulate Intel HEX files. HEXMATE is a post-link...
  • ページ 304MPLAB® XC8 C Compiler User’s Guide 8.6.1 HEXMATE Command Line Options HEXMATE is automatically called by the command line driver,...
  • ページ 305 Utilities 8.6.1.1 SPECIFICATIONS,FILENAME.HEX Intel HEX files that can be processed by HEXMATE should be in either INHX32 or INHX8M...
  • ページ 306MPLAB® XC8 C Compiler User’s Guide 8.6.1.5 -CK The -CK option is for calculating a checksum. The usage of this...
  • ページ 307 Utilities 8.6.1.6 -FILL The -FILL option is used for filling unused memory locations with a known value. The usage...
  • ページ 308MPLAB® XC8 C Compiler User’s Guide Here are some examples. The option -FIND=3412@0-7FFF/2w will detect the code sequence 1234h when...
  • ページ 309 Utilities 8.6.1.10 -FORMAT The -FORMAT option can be used to specify a particular variant of INHX format or adjust...
  • ページ 310MPLAB® XC8 C Compiler User’s Guide 8.6.1.13 -MASK Use this option to logically AND a memory range with a particular...
  • ページ 311 Utilities 8.6.1.17 -STRING The -STRING option will embed an ASCII string at a fixed address. The usage of this...
  • ページ 312MPLAB® XC8 C Compiler User’s Guide NOTES: DS52053B-page 312  2012 Microchip Technology Inc.
  • ページ 313: Appendix A. Library Functions MPLAB® XC8 C COMPILER USER’S GUIDE Appendix A. Library Functions The functions and preprocessor macros within the standard compiler...
  • ページ 314MPLAB® XC8 C Compiler User’s Guide __CONFIG (PIC18) Synopsis #include <xc.h> __CONFIG(num, data) Description This macro is provided for legacy...
  • ページ 315 Library Functions __EEPROM_DATA Synopsis #include <xc.h> __EEPROM_DATA(a,b,c,d,e,f,g,h) Description This macro is used to store initial values into the device’s...
  • ページ 316MPLAB® XC8 C Compiler User’s Guide See also __IDLOC7(), __CONFIG() __IDLOC7 Synopsis #include <xc.h> __IDLOC7(a,b,c,d) Description This macro is provided...
  • ページ 317 Library Functions Example #include <xc.h> void main (void) { control |= 0x80; _delay(10); // delay for 10 cycles control...
  • ページ 318MPLAB® XC8 C Compiler User’s Guide Example #include <stdio.h> #include <stdlib.h> void main (void) { int a = -5; printf(“The...
  • ページ 319 Library Functions ASCTIME Synopsis #include <time.h> char * asctime (struct tm * t) Description The asctime() function takes the...
  • ページ 320MPLAB® XC8 C Compiler User’s Guide Example #include <math.h> #include <stdio.h> void main (void) { float i, a; for(i =...
  • ページ 321 Library Functions ATAN Synopsis #include <math.h> double atan (double x) Description This function returns the arc tangent of its...
  • ページ 322MPLAB® XC8 C Compiler User’s Guide ATOF Synopsis #include <stdlib.h> double atof (const char * s) Description The atof() function...
  • ページ 323 Library Functions Example #include <stdlib.h> #include <stdio.h> void main (void) { char buf[80]; int i; gets(buf); i = atoi(buf);...
  • ページ 324MPLAB® XC8 C Compiler User’s Guide BSEARCH Synopsis #include <stdlib.h> void * bsearch (const void * key, void * base,...
  • ページ 325 Library Functions CEIL Synopsis #include <math.h> double ceil (double f) Description This routine returns the smallest whole number not...
  • ページ 326MPLAB® XC8 C Compiler User’s Guide See Also getch(), getche(), putch(), cputs() Return Value The return value is the character...
  • ページ 327 Library Functions Return Value A double in the range -1 to +1. COSH, SINH, TANH Synopsis #include <math.h> double...
  • ページ 328MPLAB® XC8 C Compiler User’s Guide Example #include <conio.h> #include <string.h> char buffer[80]; void main (void) { for(;;) { cgets(buffer);...
  • ページ 329 Library Functions DEVICE_ID_READ() Synopsis #include <xc.h> unsigned int device_id_read(void); Description This function returns the device ID code that is...
  • ページ 330MPLAB® XC8 C Compiler User’s Guide Example #include <xc.h> long count; void interrupt tick (void) { count++; } long getticks...
  • ページ 331 Library Functions EVAL_POLY Synopsis #include <math.h> double eval_poly (double x, const double * d, int n) Description The eval_poly()...
  • ページ 332MPLAB® XC8 C Compiler User’s Guide FABS Synopsis #include <math.h> double fabs (double f) Description This routine returns the absolute...
  • ページ 333 Library Functions FMOD Synopsis #include <math.h> double fmod (double x, double y) Description The function fmod returns the remainder...
  • ページ 334MPLAB® XC8 C Compiler User’s Guide FTOA Synopsis #include <stdlib.h> char * ftoa (float f, int * status) Description The...
  • ページ 335 Library Functions GETCHE Synopsis #include <conio.h> char getche (void) Description The getche() function is provided as an empty stub...
  • ページ 336MPLAB® XC8 C Compiler User’s Guide GETS Synopsis #include <stdio.h> char * gets (char * s) Description The gets() function...
  • ページ 337 Library Functions Example #include <xc.h> void main (void) { double x; unsigned char y; /* Get the slope reference...
  • ページ 338MPLAB® XC8 C Compiler User’s Guide Note The example will require the user to provide the time() routine as one...
  • ページ 339 Library Functions See Also toupper(), tolower(), toascii() ISDIG Synopsis #include <ctype.h> int isdig (int c) Description The isdig() function...
  • ページ 340MPLAB® XC8 C Compiler User’s Guide Return Value This routine returns a copy of the buffer into which the result...
  • ページ 341 Library Functions Return Value The return value is the integer i added to the exponent of the floating-point value...
  • ページ 342MPLAB® XC8 C Compiler User’s Guide Example #include <stdio.h> #include <time.h> char * wday[] = { "Sunday", "Monday", "Tuesday", "Wednesday",...
  • ページ 343 Library Functions Return Value Zero if the argument is negative. LONGJMP Synopsis #include <setjmp.h> void longjmp (jmp_buf buf, int...
  • ページ 344MPLAB® XC8 C Compiler User’s Guide Note The function which called setjmp() must still be active when longjmp() is called....
  • ページ 345 Library Functions Example #include <string.h> #include <stdio.h> unsigned int ary[] = {1, 5, 0x6789, 0x23}; void main (void) {...
  • ページ 346MPLAB® XC8 C Compiler User’s Guide See Also strncpy(), strncmp(), strchr(), memset(), memchr() Return Value Returns negative one, zero or...
  • ページ 347 Library Functions Return Value The function memmove() returns its first argument. MEMSET Synopsis #include <string.h> void * memset (void...
  • ページ 348MPLAB® XC8 C Compiler User’s Guide Example #include <time.h> #include <stdio.h> void main (void) { struct tm birthday; birthday.tm_year =...
  • ページ 349 Library Functions NOP Synopsis #include <xc.h> NOP(); Description Execute NOP instruction here. This is often useful to fine tune...
  • ページ 350MPLAB® XC8 C Compiler User’s Guide POW Synopsis #include <math.h> double pow (double f, double p) Description The pow() function...
  • ページ 351 Library Functions The printf() routine is passed a format string, followed by a list of zero or more argu-...
  • ページ 352MPLAB® XC8 C Compiler User’s Guide Example printf("Total = %4d%", 23); yields ’Total = 23%’ printf("Size is %lx", size); where...
  • ページ 353 Library Functions Example #include <conio.h> char * x = "This is a string"; void main (void) { char *...
  • ページ 354MPLAB® XC8 C Compiler User’s Guide PUTS Synopsis #include <stdio.h> int puts (const char * s) Description The puts() function...
  • ページ 355 Library Functions Example #include <stdio.h> #include <stdlib.h> int array[] = { 567, 23, 456, 1024, 17, 567, 66 };...
  • ページ 356MPLAB® XC8 C Compiler User’s Guide Example #include <stdlib.h> #include <stdio.h> #include <time.h> void main (void) { time_t toc; int...
  • ページ 357 Library Functions SETJMP Synopsis #include <setjmp.h> int setjmp (jmp_buf buf) Description The setjmp() function is used with longjmp() for...
  • ページ 358MPLAB® XC8 C Compiler User’s Guide Example #include <math.h> #include <stdio.h> #define C 3.141592/180.0 void main (void) { double i;...
  • ページ 359 Library Functions Description The sprintf() function operates in a similar fashion to printf(), except that instead of placing the...
  • ページ 360MPLAB® XC8 C Compiler User’s Guide SRAND Synopsis #include <stdlib.h> void srand (unsigned int seed) Description The srand() function initializes...
  • ページ 361 Library Functions STRCAT Synopsis #include <string.h> char * strcat (char * s1, const char * s2) Description This function...
  • ページ 362MPLAB® XC8 C Compiler User’s Guide Example #include <strings.h> #include <stdio.h> void main (void) { static char temp[] = "Here...
  • ページ 363 Library Functions See Also strlen(), strncmp(), strcpy(), strcat() Return Value A signed integer less than, equal to or greater...
  • ページ 364MPLAB® XC8 C Compiler User’s Guide Example #include <stdio.h> #include <string.h> void main (void) { static char set[] = "xyz";...
  • ページ 365 Library Functions STRNCAT Synopsis #include <string.h> char * strncat (char * s1, const char * s2, size_t n) Description...
  • ページ 366MPLAB® XC8 C Compiler User’s Guide Example #include <stdio.h> #include <string.h> void main (void) { int i; i = strncmp("abcxyz",...
  • ページ 367 Library Functions See Also strcpy(), strcat(), strlen(), strcmp() Return Value The destination buffer s1 is returned. STRPBRK Synopsis #include...
  • ページ 368MPLAB® XC8 C Compiler User’s Guide Example #include <stdio.h> #include <string.h> void main (void) { char * str = "This...
  • ページ 369 Library Functions Description The strstr() function locates the first occurrence of the sequence of characters in the string pointed...
  • ページ 370MPLAB® XC8 C Compiler User’s Guide STRTOL Synopsis #include <stdlib.h> double strtol (const char * s, const char ** res,...
  • ページ 371 Library Functions Example #include <stdio.h> #include <string.h> void main (void) { char * ptr; char buf[] = "This is...
  • ページ 372MPLAB® XC8 C Compiler User’s Guide TIME Synopsis #include <time.h> time_t time (time_t * t) Description This function is not...
  • ページ 373 Library Functions Example #include <stdio.h> #include <ctype.h> #include <string.h> void main (void) { char * array1 = "aBcDE"; int...
  • ページ 374MPLAB® XC8 C Compiler User’s Guide Example #include <stdlib.h> void main (void) { udiv_t result; unsigned num = 1234, den...
  • ページ 375 Library Functions Description The function utoa() converts the unsigned contents of val into a string which is stored into...
  • ページ 376MPLAB® XC8 C Compiler User’s Guide Example #include <stdio.h> #include <stdarg.h> void pf (int a, ...) { va_list ap; va_start(ap,...
  • ページ 377: Appendix B. Error and Warning Messages MPLAB® XC8 C COMPILER USER’S GUIDE Appendix B. Error and Warning Messages This chapter lists the MPLAB XC8 C...
  • ページ 378MPLAB® XC8 C Compiler User’s Guide (101) #* may not follow #else (Preprocessor) A #else or #elif has been used...
  • ページ 379 Error and Warning Messages (107) illegal # directive "*" (Preprocessor, Parser) The compiler does not understand the # directive....
  • ページ 380MPLAB® XC8 C Compiler User’s Guide (116) end of file within preprocessor macro argument from line * (Preprocessor) A macro...
  • ページ 381 Error and Warning Messages (125) illegal character (* decimal) in #if (Preprocessor) There is a non-printable character in a...
  • ページ 382MPLAB® XC8 C Compiler User’s Guide (132) no type specified in #[el]if sizeof() (Preprocessor) Sizeof() was used in a preprocessor...
  • ページ 383 Error and Warning Messages (141) can’t open * file "*": * (Any) An output file could not be created....
  • ページ 384MPLAB® XC8 C Compiler User’s Guide (161) control line "*" within preprocessor macro expansion (Preprocessor) A preprocessor control line (one...
  • ページ 385 Error and Warning Messages (171) wrong number of preprocessor macro arguments for "*" (* instead of *) (Preprocessor) A...
  • ページ 386MPLAB® XC8 C Compiler User’s Guide (180) unterminated comment in included file (Preprocessor) Comments begun inside an included file must...
  • ページ 387 Error and Warning Messages (188) constant expression required (Parser) In this context an expression is required that can be...
  • ページ 388MPLAB® XC8 C Compiler User’s Guide (198) undefined struct/union "*" (Parser) The specified structure or union tag is undefined, for...
  • ページ 389 Error and Warning Messages (204) void function can’t return a value (Parser) A void function cannot return a value....
  • ページ 390MPLAB® XC8 C Compiler User’s Guide (215) missing argument to pragma "switch" (Parser) The pragma switch requires an argument of...
  • ページ 391 Error and Warning Messages (224) illegal "#" directive (Parser) An illegal # preprocessor has been detected. Likely a directive...
  • ページ 392MPLAB® XC8 C Compiler User’s Guide (237) function "*" redefined (Parser) More than one definition for a function has been...
  • ページ 393 Error and Warning Messages (243) inappropriate break/continue (Parser) A break or continue statement has been found that is not...
  • ページ 394MPLAB® XC8 C Compiler User’s Guide (247) duplicate label "*" (Parser) The same name is used for a label more...
  • ページ 395 Error and Warning Messages (253) argument list conflicts with prototype (Parser) The argument list in a function definition is...
  • ページ 396MPLAB® XC8 C Compiler User’s Guide (262) struct/union "*" redefined (Parser) A structure or union has been defined more than...
  • ページ 397 Error and Warning Messages (267) bad storage class (Code Generator) The code generator has encountered a variable definition whose...
  • ページ 398MPLAB® XC8 C Compiler User’s Guide (276) type specifier required for prototyped argument (Parser) A type specifier is required for...
  • ページ 399 Error and Warning Messages (285) no identifier in declaration (Parser) The identifier is missing in this declaration. This error...
  • ページ 400MPLAB® XC8 C Compiler User’s Guide (294) can’t allocate * bytes of memory (Code Generator, Hexmate) This is an internal...
  • ページ 401 Error and Warning Messages (310) "]" expected (Parser) A closing square bracket was expected in an array declaration or...
  • ページ 402MPLAB® XC8 C Compiler User’s Guide (319) while expected (Parser) The keyword while is expected at the end of a...
  • ページ 403 Error and Warning Messages (327) long long int argument required in printf-style format string (Parser) A long long argument...
  • ページ 404MPLAB® XC8 C Compiler User’s Guide (336) string concatenation across lines (Parser) Strings on two lines will be concatenated. Check...
  • ページ 405 Error and Warning Messages (345) unreachable code (Parser) This section of code will never be executed, because there is...
  • ページ 406MPLAB® XC8 C Compiler User’s Guide (350) unused * "*" (from line *) (Parser) The indicated object was never used...
  • ページ 407 Error and Warning Messages (357) illegal conversion of integer to pointer (Parser) An integer has been assigned to or...
  • ページ 408MPLAB® XC8 C Compiler User’s Guide (360) array index out of bounds (Parser) An array is being indexed with a...
  • ページ 409 Error and Warning Messages (365) pointer to non-static object returned (Parser) This function returns a pointer to a non-static...
  • ページ 410MPLAB® XC8 C Compiler User’s Guide (371) missing basic type; int assumed (Parser) This declaration does not include a basic...
  • ページ 411 Error and Warning Messages (383) text record has length (*) too small (Linker) This is an internal compiler error....
  • ページ 412MPLAB® XC8 C Compiler User’s Guide (400) bad object code format (Linker) This is an internal compiler error. The object...
  • ページ 413 Error and Warning Messages (417) seek error in "*" (Linker) This is an internal compiler error. Contact Microchip Technical...
  • ページ 414MPLAB® XC8 C Compiler User’s Guide (432) usage: objtohex [-ssymfile] [object-file [exe-file]] (Objtohex) Improper usage of the command-line tool objtohex....
  • ページ 415 Error and Warning Messages (442) missing address in -A spec (Linker) The format of a -A specification, giving address...
  • ページ 416MPLAB® XC8 C Compiler User’s Guide (447) bad load address "*" in -A spec (Linker) The load address given in...
  • ページ 417 Error and Warning Messages (454) link and load address can’t both be set to "." in -P option (Linker)...
  • ページ 418MPLAB® XC8 C Compiler User’s Guide (469) undefined symbol "*" in FNROOT record (Linker) The linker has found an undefined...
  • ページ 419 Error and Warning Messages (474) no psect specified for function variable/argument allocation (Linker) The FNCONF assembler directive which specifies...
  • ページ 420MPLAB® XC8 C Compiler User’s Guide MOVWF (_foo&0ffh) which masks out the top bits of the address containing the bank...
  • ページ 421 Error and Warning Messages (485) unknown "with" psect referenced by psect "*" (Linker) The specified psect has been placed...
  • ページ 422MPLAB® XC8 C Compiler User’s Guide The second cause of this message is when the total amount of memory needed...
  • ページ 423 Error and Warning Messages (494) bad -P format "*/*" (Linker) The -P option given to the linker is malformed....
  • ページ 424MPLAB® XC8 C Compiler User’s Guide (505) no end record found inobject file (Linker) An object file did not contain...
  • ページ 425 Error and Warning Messages (522) library "*" is badly ordered (Linker) This library is badly ordered. It will still...
  • ページ 426MPLAB® XC8 C Compiler User’s Guide (600) No chip arch given for COFF write (Cromwell) CROMWELL requires that the chip...
  • ページ 427 Error and Warning Messages (616) option -Cbaseaddr is illegal with options -R or -L (Linker) The linker option -Cbaseaddr...
  • ページ 428MPLAB® XC8 C Compiler User’s Guide (634) error dumping "*" (Cromwell) Either the input file to CROMWELL is of an...
  • ページ 429 Error and Warning Messages (681) bad common spec in -P option (Code Generator) This is an internal compiler error....
  • ページ 430MPLAB® XC8 C Compiler User’s Guide (693) interrupt level may only be 0 (default) or 1 (Code Generator) The only...
  • ページ 431 Error and Warning Messages (702) regused(): bad arg to G (Code Generator) This is an internal compiler error. Contact...
  • ページ 432MPLAB® XC8 C Compiler User’s Guide (716) bad argument to -M option "*" (Code Generator) The code generator has been...
  • ページ 433 Error and Warning Messages (733) bad string "*" in pragma "psect" (Code Generator) The code generator has been passed...
  • ページ 434MPLAB® XC8 C Compiler User’s Guide (743) divide by zero (Code Generator) An expression involving a division by zero has...
  • ページ 435 Error and Warning Messages MESSAGES 750-999 (750) constant operand to || or && (Code Generator) One operand to the...
  • ページ 436MPLAB® XC8 C Compiler User’s Guide (754) bitfield comparison out of range (Code Generator) This is the result of comparing...
  • ページ 437 Error and Warning Messages A similar situation arises with for loops, for example: { int a, b; /* this...
  • ページ 438MPLAB® XC8 C Compiler User’s Guide (761) sizeof yields 0 (Code Generator) The code generator has taken the size of...
  • ページ 439 Error and Warning Messages (768) constant relational expression (Code Generator) There is a relational expression that will always be...
  • ページ 440MPLAB® XC8 C Compiler User’s Guide (787) can’t handle "v_rtype" of * in copyexpr (Assembler) This is an internal compiler...
  • ページ 441 Error and Warning Messages (804) write error on object file (Assembler) The assembler failed to write to an object...
  • ページ 442MPLAB® XC8 C Compiler User’s Guide (822) duplicate ROMSIZE for "*" in chipinfo file at line * (Assembler) The chipinfo...
  • ページ 443 Error and Warning Messages (835) form length must be >= 15 (Assembler) The form length specified using the -F...
  • ページ 444MPLAB® XC8 C Compiler User’s Guide (848) symbol has been declared EXTERN (Assembler) An assembly label uses the same name...
  • ページ 445 Error and Warning Messages (862) symbol is not external (Assembler) A symbol has been declared as EXTRN but is...
  • ページ 446MPLAB® XC8 C Compiler User’s Guide (872) psect flag "space" redefined (Assembler) The space flag to the PSECT assembler directive...
  • ページ 447 Error and Warning Messages (884) please ensure you have write permissions to the configuration file (Driver) The compiler was...
  • ページ 448MPLAB® XC8 C Compiler User’s Guide (899) can’t open option file "*" for application "*": * (Driver) An option file...
  • ページ 449 Error and Warning Messages (922) chip "*" not present in chipinfo file "*" (Driver) The chip selected does not...
  • ページ 450MPLAB® XC8 C Compiler User’s Guide (944) data conflict at address *h between * and * (Hexmate) Sources to Hexmate...
  • ページ 451 Error and Warning Messages (965) -STRPACK option not yet implemented, option will be ignored (Hexmate) This option currently is...
  • ページ 452MPLAB® XC8 C Compiler User’s Guide (979) this identifier is already a struct tag (Parser) This identifier following a union...
  • ページ 453 Error and Warning Messages (989) module has code below file base of *h (Linker) This module has code below...
  • ページ 454MPLAB® XC8 C Compiler User’s Guide MESSAGES 1000-1249 (1015) missing "*" specification in chipinfo file "*" at line * (Driver)...
  • ページ 455 Error and Warning Messages (1029) compiler not installed correctly - error code (*) (Driver) This compiler has failed to...
  • ページ 456MPLAB® XC8 C Compiler User’s Guide (1044) end of file encountered (Cromwell, Linker) The end of the file was found...
  • ページ 457 Error and Warning Messages (1059) rewrite loop (Code Generator) This is an internal compiler error. Contact Microchip Technical Support...
  • ページ 458MPLAB® XC8 C Compiler User’s Guide (1118) bad string "*" in getexpr(J) (Code Generator) This is an internal compiler error....
  • ページ 459 Error and Warning Messages (1187) invalid activation request ( Driver) The compiler has not been correctly activated. (1188) network...
  • ページ 460MPLAB® XC8 C Compiler User’s Guide (1203) unpaired nibble in * value will be truncated (Hexmate) Data to this option...
  • ページ 461 Error and Warning Messages (1230) dereferencing uninitialized pointer "*" (Code Generator) A pointer that has not yet been assigned...
  • ページ 462MPLAB® XC8 C Compiler User’s Guide (1247) no access RAM defined for variable placement (Code Generator) No memory has been...
  • ページ 463 Error and Warning Messages (1260) macro "*" redefined (Assembler) More than one definition for a macro with the same...
  • ページ 464MPLAB® XC8 C Compiler User’s Guide (1278) omitting "*" which does not have a location (Cromwell) A variable has no...
  • ページ 465 Error and Warning Messages (1295) there are * days left until this license will expire (Driver) The compiler is...
  • ページ 466MPLAB® XC8 C Compiler User’s Guide (1308) missing/conflicting interrupts sub-option, defaulting to "*" (Driver) The suboptions to the --INTERRUPT option...
  • ページ 467 Error and Warning Messages (1319) invalid type "*" for attribute "*" (Parser) This indicated a bad option passed to...
  • ページ 468MPLAB® XC8 C Compiler User’s Guide (1330) only functions or function pointers may have an instruction set architecture qualifier (Code...
  • ページ 469 Error and Warning Messages (1339) operand must be a * bit * value (Assembler) The constant operand to an...
  • ページ 470MPLAB® XC8 C Compiler User’s Guide (1352) truncation of operand value (0x*) to * bits (Assembler) The operand to an...
  • ページ 471 Error and Warning Messages (1363) unknown configuration setting (* = *) used (Driver) The configuration value and setting is...
  • ページ 472MPLAB® XC8 C Compiler User’s Guide (1376) initial value (*) too large for bitfield width (*) (Code Generator) A structure...
  • ページ 473 Error and Warning Messages (1387) inline delay argument must be constant (Code Generator) The __delay inline function can only...
  • ページ 474MPLAB® XC8 C Compiler User’s Guide (1395) notable code sequence candidate suitable for compiler validation suite detected (*) (Code Generator)...
  • ページ 475 Error and Warning Messages (1406) auto eeprom variables are not supported (Code Generator) Variables qualified as eeprom cannot be...
  • ページ 476MPLAB® XC8 C Compiler User’s Guide (1414) option * is defunct and has no effect (Driver) The option used is...
  • ページ 477 Error and Warning Messages (1424) short long integer types are not supported (Parser) The use of the short long...
  • ページ 478MPLAB® XC8 C Compiler User’s Guide (1433) function "*" could not be inlined (Assembler) The specified function could not be...
  • ページ 479: Appendix C. Implementation-Defined Behavior MPLAB® XC8 C COMPILER USER’S GUIDE Appendix C. Implementation-Defined Behavior This section discusses implementation-defined behavior for this implementation of...
  • ページ 480MPLAB® XC8 C Compiler User’s Guide C.3 IDENTIFIERS (G.3.3) C.3.1 The number of significant initial characters (beyond 31) in an...
  • ページ 481 Implementation-Defined Behavior C.5 INTEGERS (G.3.5) C.5.1 The representations and sets of values of the various types of integers (6.1.2.5)...
  • ページ 482MPLAB® XC8 C Compiler User’s Guide C.6 FLOATING-POINT (G.3.6) C.6.1 The representations and sets of values of the various types...
  • ページ 483 Implementation-Defined Behavior C.9 STRUCTURES, UNIONS, ENUMERATIONS, AND BIT-FIELDS (G.3.9) C.9.1 A member of a union object is accessed using...
  • ページ 484MPLAB® XC8 C Compiler User’s Guide C.13 PREPROCESSING DIRECTIVES (G.3.13) C.13.1 Whether the value of a single-character character constant in...
  • ページ 485 Implementation-Defined Behavior C.14 LIBRARY FUNCTIONS (G.3.14) C.14.1 The null constant to which the macro NULL expands (7.1.6) The macro...
  • ページ 486MPLAB® XC8 C Compiler User’s Guide C.14.8 The output for %p conversion in the fprintf function (7.9.6.1) The address is...
  • ページ 487: Glossary MPLAB® XC8 C COMPILER USER’S GUIDE Glossary A Absolute Section A GCC compiler section with a fixed (absolute) address...
  • ページ 488MPLAB® XC8 C Compiler User’s Guide ANSI American National Standards Institute is an organization responsible for formulating and approving standards...
  • ページ 489 Glossary C C\C++ C is a general-purpose programming language which features economy of expression, modern control flow and data...
  • ページ 490MPLAB® XC8 C Compiler User’s Guide Cross Reference File A file that references a table of symbols and a list...
  • ページ 491 Glossary E EEPROM Electrically Erasable Programmable Read Only Memory. A special type of PROM that can be erased electrically....
  • ページ 492MPLAB® XC8 C Compiler User’s Guide Extended Mode (PIC18 MCUs) In Extended mode, the compiler will utilize the extended instructions...
  • ページ 493 Glossary Free-Standing An implementation that accepts any strictly conforming program that does not use complex types and in which...
  • ページ 494MPLAB® XC8 C Compiler User’s Guide Import Bring data into the MPLAB IDE from an outside source, such as from...
  • ページ 495 Glossary Linker A language tool that combines object files and libraries to create executable code, resolving references from one...
  • ページ 496MPLAB® XC8 C Compiler User’s Guide Macro Macro instruction. An instruction that represents a sequence of instructions in abbrevi- ated...
  • ページ 497 Glossary MPLAB ICD Microchip’s in-circuit debuggers that works with MPLAB IDE. See ICE/ICD. MPLAB IDE Microchip’s Integrated Development Environment....
  • ページ 498MPLAB® XC8 C Compiler User’s Guide NOP No Operation. An instruction that has no effect when executed except to advance...
  • ページ 499 Glossary PIC MCUs PIC microcontrollers (MCUs) refers to all Microchip microcontroller families. PICkit 2 and 3 Microchip’s developmental device...
  • ページ 500MPLAB® XC8 C Compiler User’s Guide Prologue A portion of compiler-generated code that is responsible for allocating stack space, pre-...
  • ページ 501 Glossary Relaxation The process of converting an instruction to an identical, but smaller instruction. This is useful for saving...
  • ページ 502MPLAB® XC8 C Compiler User’s Guide Simulator A software program that models the operation of devices. Single Step This command...
  • ページ 503 Glossary Static RAM or SRAM Static Random Access Memory. Program memory you can read/write on the target board that...
  • ページ 504MPLAB® XC8 C Compiler User’s Guide Target Application Software residing on the target board. Target Board The circuitry and programmable...
  • ページ 505 Glossary V Vector The memory locations that an application will jump to when either a Reset or interrupt occurs....
  • ページ 506MPLAB® XC8 C Compiler User’s Guide NOTES: DS52053B-page 506  2012 Microchip Technology Inc.
  • ページ 507: Index MPLAB® XC8 C COMPILER USER’S GUIDE Index Symbols _EEPROMSIZE macro................................... 177, 213 _ assembly label character .............................204, 251 _ERRATA_TYPES...
  • ページ 508MPLAB® XC8 C Compiler User’s Guide #asm directive ........................................................ 202 maximum number of errors ............................. 245 #define directive ....................................................... 94...
  • ページ 509 Index format...............................................243, 244, 266 byte addressable memory...................................... 257 hexadecimal constants ................................... 243 C including conditional code............................... 266 macros .............................................243,...
  • ページ 510MPLAB® XC8 C Compiler User’s Guide CONFIG class ........................................................ 237 device support .......................................... 64, 100, 133 config pragma ........................................................ 135...
  • ページ 511 Index none.................................................................. 91 ERRATA_TYPES macro........................................ 103 O ....................................................................... 97 error counter............................................................. 86 OBJDIR........................................................... 107 error files ................................................................ 279 OPT...
  • ページ 512MPLAB® XC8 C Compiler User’s Guide return bank ...................................................... 188 HTC_MSG_FORMAT environment variable ............ 88 return values ................................................... 187 HTC_WARN_FORMAT...
  • ページ 513 Index islower function ...................................................... 338 location counter.............................................. 251, 259 itoa function............................................................ 339 log function............................................................. 342 log10 function......................................................... 342 J...
  • ページ 514MPLAB® XC8 C Compiler User’s Guide warning, see warning messages speed vs space ............................................... 108 messaging system.............................................. 86–90 option instruction...
  • ページ 515 Index containing strings .............................................. 94 function ........................................................... 184 defining ............................................................. 94 linking.............................................................. 285 predefined ..................................................36, 212 listing............................................................... 115 undefining...
  • ページ 516MPLAB® XC8 C Compiler User’s Guide read-modify-write problems...................................... 69 size limits.................................................................. 63 read-only variables ................................................. 161 auto variables.................................................. 172 REAL...
  • ページ 517 Index sorting ............................................................. 281 initialization ..................................................... 195 symbol-only object file............................................ 280 location of.......................................................... 65 symbols maximum size of ..................................................
  • ページ 518: Worldwide Sales and Service Worldwide Sales and Service AMERICAS ASIA/PACIFIC ASIA/PACIFIC EUROPE Corporate Office Asia Pacific Office India - Bangalore Austria - Wels...
downloadlike
ArtboardArtboardArtboard
Report Bug