SW500010 Microchip Technology, SW500010 Datasheet - Page 82

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
3.3.10.2 Near Type Qualifier
The near type qualifier is a recommendation to place static variables in the common memory of
the PIC MCU. Near objects are represented by 8 bit addresses and are always accessible regardless
of the currently selected RAM bank so accessing near objects may be faster than accessing other
objects, and typically results in smaller code sizes.
The memory allocation scheme used by HI-TECH C PRO for the PIC10/12/16 MCU Family auto-
matically allocates variables to the common memory. The common memory will be filled before
banked memory is used. The allocation scheme uses the number of times the each object is refer-
enced, as well the size of the object to determine which are given preference to the common memory.
The near qualifier increases the probability of a variable being placed in the common memory.
3.3.10.3 Bank1, Bank2 and Bank3 Type Qualifiers
The bank1, bank2 and bank3 type qualifiers are always recognised by HI-TECH C PRO for
the PIC10/12/16 MCU Family so that code may be easily ported from other compilers, however by
default, these qualifiers have no effect. If the --FORCEBANK option is used, the bank1, bank2
and bank3 qualifiers become a recommendation to place static variables in RAM bank 1, RAM
bank2 and RAM bank 3, respectively.
unsigned char in bank3:
3.3.11 Eeprom Type Qualifier
The eeprom qualifier is used to to place static variables into EEPROM. Since accessing EEPROM
memory is a lot less efficient than accessing RAM, only very basic C expressions are supported.
This qualifier is provided as a convenient way to store and access the EEPROM available on some
processors. Examples of use:
A double in eeprom:
82
Here is an example of an unsigned char object placed within the common memory:
Note that there is no bank0 qualifier. The following example of bank qualifier usage places an
An int stored in eeprom:
static near unsigned char fred;
static bank3 unsigned char fred;
eeprom int number = 0x1234;
eeprom double pi = 3.14;
C Language Features

Related parts for SW500010