SW500007 Microchip Technology, SW500007 Datasheet - Page 63

PICC-18 PRO

SW500007

Manufacturer Part Number
SW500007
Description
PICC-18 PRO
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC18r
Datasheets

Specifications of SW500007

Supported Families
PIC18
Core Architecture
PIC
Software Edition
Professional
Kit Contents
Software And Docs
Mcu Supported Families
PIC18
Tool Function
Compiler
Tool Type
Compiler
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
PIC18 Series
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
015P
778-1002
778-1002
C Language Features
3.4.9 Standard Type Qualifiers
Type qualifiers provide information regarding how an object may be used, in addition to its type
which defines it storage size and format. HI-TECH PICC-18 STD supports both ANSI qualifiers and
additional special qualifiers which are useful for embedded applications and which take advantage
of the PIC18 architecture.
3.4.9.1 Const and Volatile Type Qualifiers
HI-TECH PICC-18 STD supports the use of the ANSI type qualifiers const and volatile.
be modified. If any attempt is made to modify an object declared const, the compiler will issue
a warning. User-defined objects declared const are placed in special psects in the program space.
Obviously, a const object must be initialised when it is declared as it cannot be assigned a value at
any point at runtime. For example:
The volatile type qualifier is used to tell the compiler that an object cannot be guaranteed to retain
its value between successive accesses. This prevents the optimizer from eliminating apparently
redundant references to objects declared volatile because it may alter the behaviour of the program
to do so. All Input/Output ports and any variables which may be modified by interrupt routines
should be declared volatile, for example:
Volatile objects may be accessed using different generated code to non-volatile objects. For ex-
ample, when assigning a non-volatile object the value 1, the object may be cleared and then incre-
mented, but the same operation performed on a volatile object will load the W register with 1 and
then store this to the appropriate address.
3.4.10 Special Type Qualifiers
HI-TECH PICC-18 STD supports special type qualifiers, persistent, near and far to allow the
user to control placement of static and extern class variables into particular address spaces. If the
PICC18 option, --STRICT is used, these type qualifiers are changed to __persistent, __near and
__far, respectively. These type qualifiers may also be applied to pointers. These type qualifiers may
not be used on variables of class auto; if used on variables local to a function they must be combined
with the static keyword. For example, you may not write:
The const type qualifier is used to tell the compiler that an object is read only and will not
const int version = 3;
volatile static near unsigned char PORTA @ 0xF80;
Supported Data Types and Variables
49

Related parts for SW500007