SW006010 Microchip Technology, SW006010 Datasheet - Page 58

no-image

SW006010

Manufacturer Part Number
SW006010
Description
MPLAB 17C SOFTWARE
Manufacturer
Microchip Technology
Datasheets

Specifications of SW006010

Tool Function
Compiler
Tool Type
Compiler
Processor Series
PIC17C
Lead Free Status / RoHS Status
Not applicable / Not applicable
For Use With/related Products
MPLAB®
Lead Free Status / Rohs Status
Lead free / RoHS Compliant
MPLAB
5.8
apRNOVM^-page 52
SOFTWARE STACK
C17 C Compiler User’s Guide
5.7.2
Data sections that have the
overlaps other overlay data sections. This feature can be useful for allowing a single
data range to be used for multiple variables that are never active simultaneously.
For example:
5.7.3
Data sections declared with the
that are defined as
be accessed without banking. Variables declared with the
accessed without banking.
For example:
5.7.4
Variables can be placed in either data or program memory with the MPLAB C17
compilers. Variables that are placed in on-chip program memory can be read but not
written without additional user-supplied code. Variables placed in external program
memory can be either read or written without additional user-supplied code.
For information on writing to on-chip program memory, see individual device data
sheets. For detailed examples of variable placement, see the MPLINK User’s Guide
portion of DS33014.
To specify to the compiler that a variable should be placed in program memory, use
the
type section.
For example:
The compiler uses a software stack for storing local variables and for passing
arguments to and returning values from functions. The software stack should not be
confused with the hardware stack that the PICmicro MCU uses for storing return
addresses during function calls and interrupts.
5.8.1
The stack is sized and placed in the linker script via the
directive has two arguments:
location respectively.
For example, to allocate a 128 byte stack and place that stack in the memory region
gpr3
#pragma udata overlay myOverlayData1=0x1fc
int intVar1, intVar2;
#pragma udata overlay myOverlayData2=0x1fc
long longVar;
#pragma udata shared unbankedRAM
near unsigned char cv1, cv2;
#pragma romdata constTable
const rom char myConstArray[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
STACK SIZE=0x80 RAM=gpr3
rom
:
keyword. The compiler will then allocate this variable into the current
Attributes – Overlay
Attributes – Shared
Locating Data in Program Memory
Changing Stack Size and Location
SHAREBANK
// 4 bytes will be located at 0x1fc
overlay
SIZE
// 4 bytes will be located at
// 0x1fc and 0x1fe
in the linker script file. These regions are those that can
shared
and
attribute can be located at an address that
// all accesses to these
// will be unbanked
RAM
attribute will be placed into memory regions
to control the allocated stack size and its
STACK
near
 2002 Microchip Technology Inc.
directive. The
keyword will be
romdata
STACK

Related parts for SW006010