SW500009 Microchip Technology, SW500009 Datasheet - Page 67

HI-TECH FOR DSPIC/PIC24

SW500009

Manufacturer Part Number
SW500009
Description
HI-TECH FOR DSPIC/PIC24
Manufacturer
Microchip Technology
Type
Compilerr
Series
PIC24 & DsPICr
Datasheet

Specifications of SW500009

Supported Families
PIC24
Core Architecture
PIC, DsPIC
Software Edition
Standard
Kit Contents
Software And Docs
Tool Type
Compiler
Mcu Supported Families
PIC24 MCUs And DsPIC DSCs
Lead Free Status / RoHS Status
Not applicable / RoHS Compliant
For Use With/related Products
DSPIC3X/PIC24
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
Other names
025
778-1003
778-1003
C Language Features
3.5.1.1 Auto Variables
Auto (short for automatic) variables are the default type of local variable. Unless explicitly declared
to be static a local variable will be made auto, however the auto keyword may be used if desired.
Auto variables are allocated in the auto-variable block and referenced by indexing off the symbol
that represents that block. The variables will not necessarily be allocated in the order declared - in
contrast to parameters which are always in lexical order. Note that most type qualifiers cannot be
used with auto variables, since there is no control over the storage location. The exceptions are const
and volatile.
objects of type auto.
are never called at the same time.
with a_function plus some offset, where function is the name of the function in which the object is
defined. For example, if the int object test is the first object placed in main’s auto-variable block it
will be accessed using the addresses ?a_main and ?a_main+1 since an int is two bytes long.
3.5.1.2 Static Variables
Uninitialized static variables are allocated in the rbss_n psect and occupy 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.5.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. Note that the compiler does not reserve
any storage, but merely equates the variable to that address, the compiler-generated assembler will
include a line of the form:
All auto variables are allocated memory in bank 0. The bank qualifiers cannot be used with
The auto-variable blocks for a number of functions are overlapped by the linker if those functions
Auto objects are referenced with a symbol that consists of a question mark, ?, concatenated
Static variables which are initialised are only done so once during the programs execution. Thus,
volatile unsigned char Portvar @ 0x06;
Storage Class and Object Placement
53

Related parts for SW500009