SW500010 Microchip Technology, SW500010 Datasheet - Page 86

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
Supported Data Types and Variables
One positive aspect of tracking pointer targets is less of a dependence on pointer qualifiers. The
standard qualifiers const and volatile must still be used in pointer definitions to indicate a
read-only or externally-modifiable target object, respectively. However this is in strict accordance
with the ANSI standard. HI-TECH specific qualifiers, like near and far, do not need to be used
to indicate pointer targets, and should be avoided. The non-use of these qualifiers will result in
more portable and readable code, and lessen the chance of extraneous warnings being issued by the
compiler.
3.3.12.3 Pointers to Const
The const qualifier plays no direct part in specifying the pointer classification that the compiler
will allocate to a pointer. This qualifier should be used when the target, or targets, referenced by the
pointer should be read-only. The addresses of const objects assigned to a pointer will result in that
pointer having a classification capable of accessing the program space. The exact classification will
also depend on other factors.
this information to determine how large any pointers that can access const objects must be. Such
pointers may be either 1 or 2 bytes wide.
86
The code generator tracks the total size of const qualified variables that are defined. It uses
T
P
void main(void) {
const char in_table[20] = { / * values * / };
char * cp;
cp = &in_table;
}
If the array above is the only const data in the program, then there are 20 bytes of
const data used in the program. In this instance, the code generator will make the
pointer, cp, a one byte wide pointer to objects in the program space.
Later, the program is changed and another const array is added to the code:
const char out_table[240] = { / * values * / };
As the total size of const data for this program now exceeds 255 bytes, the size of any
pointer that can access const objects will be made 2 bytes long. Even if the pointer,
cp, is not assigned the address of this new array, out_table, its size will increase.
UT RIAL
OINTERS AND CONST DATA
Assume a program contains of the following:
C Language Features

Related parts for SW500010