SW500010 Microchip Technology, SW500010 Datasheet - Page 105

HI-TECH C PRO FOR PIC10/12/16

SW500010

Manufacturer Part Number
SW500010
Description
HI-TECH C PRO FOR PIC10/12/16
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC10/12/16r
Datasheets

Specifications of SW500010

Supported Families
PIC10, PIC12, PIC16
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC10/12/16
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
PIC10, PIC12, PIC14, PIC16, PIC16E
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
019P
778-1006
778-1006
C Language Features
3.10.4.2 Undefined Symbols
Variables can be defined in assembly code if required, but in some instances it is easier to do so in
C source code, in other cases, the symbols may need to be accessable from both assembly and C
source code.
the entire the C program. In this case, the code generator may remove the variable believing it is
unused. If assembly code is relying on this definition an error will result.
assembly-derived object files for symbols which are undefined. These will typically be symbols that
are used, but not defined, in assembly code. The code generator is informed of these symbols, and if
they are encountered in the C code the variable is automatically marked as being volatile. This is the
equivalent of the programmer having qualified the variable as being volatile in the source code,
see Section 3.3.9. Variables qualified as volatile will never be removed by the code generator,
even if they appear to be unused throughout the program.
A problem can occur if there is a variable defined in C code, but is never referenced throughout
To work around this issue, HI-TECH C PRO for the PIC10/12/16 MCU Family also searches
generator to ensure that these address spaces are not used by C code. The linker will
also be told to remove these ranges from those available, and this reservation will be
observable in the map file. The RAM class definition, for example, may look like:
-ARAM=020-06Fh,0A0h-0EFh,130h-16Fh,0190h-01EFh
for an 16F877 device, showing that addresses 110h through 12F were reserved from this
class range.
T
P
as follows:
int input;
but this variable is only ever used in assembly code. The assembly module(s) can simply
declare and link in to this symbol using the GLOBAL assembler directive, and them make
use of the symbol.
GLOBAL _input
PSECT text,class=CODE,delta=2
movf _input,w
In this instance the C variable input will not be removed and be treated as if it was
qualified volatile.
UT RIAL
ROCESSING OF UNDEFINED SYMBOLS
A C source module defines a global variable
Mixing C and Assembler Code
105

Related parts for SW500010