SW500010 Microchip Technology, SW500010 Datasheet - Page 89

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.4.1.2 Static Variables
Uninitialized static variables are allocated a fixed memory location which will not be overlapped
by storage for other functions. Static variables are local in scope to the function in which they are
declared, but may be accessed by other functions via pointers since they have permanent duration.
Static variables are guaranteed to retain their value between calls to a function, unless explicitly
modified via a pointer. Static variables are not subject to any architectural limitations on the PIC.
they may be preferable over initialised auto objects which are assigned a value every time the block
in which the definition is placed is executed.
3.4.2 Absolute Variables
A global or static variable can be located at an absolute address by following its declaration
with the construct @ address, for example:
will declare a variable called Portvar located at 06h. The compiler will reserve storage for this
object via the assembler DABS directive, and will equate the variable to that address. The compiler-
generated assembler will include a line of the form:
This construct is primarily intended for equating the address of a C identifier with a microprocessor
special function register, but can be used to place user-defined variables at an absolute address. The
compiler and linker do not make any checks for overlap of absolute variables with other absolute
variables.
3.4.3 Objects in Program Space
Const objects are usually placed in program space. On most PIC devices, the program space is
word-addressable but not directly readable by the device — the compiler stores one character per
Static variables which are initialised are only done so once during the programs execution. Thus,
volatile unsigned char Portvar @ 0x06;
_Portvar EQU 06h
Defining absolute objects can fragment memory and may make it impossible for the
linker to position other objects. Avoid absolute objects if at all possible. If absolute
object s must be defined, try to place them at one end of a memory bank.
Storage Class and Object Placement
89

Related parts for SW500010