22.1 Default Memory Spaces
The compiler defines several special purpose memory spaces to match
architectural features of 16-bit devices. Static and external variables may be allocated in
the special purpose memory spaces through use of the space
attribute,
described in Variable Attributes.
data
General data space. Variables in general data space can be accessed using ordinary C statements. This is the default allocation.
xmemory
- dsPIC30F, dsPIC33EP/F devices only
X data address space. Variables in X data space can be accessed using ordinary C statements. X data address space has special relevance for DSP-oriented libraries and/or assembly language instructions.
ymemory
- dsPIC30F, dsPIC33EP/F devices only
Y data address space. Variables in Y data space can be accessed using ordinary C statements. Y data address space has special relevance for DSP-oriented libraries and/or assembly language instructions.
prog
General program space, which is normally reserved for executable code.
Variables in this program space can not be accessed using ordinary C statements. They must
be explicitly accessed by the programmer, usually using table-access inline assembly
instructions, using the program space visibility window, or by qualifying with
__prog__
.
auto_psv
A compiler-managed area in program space, designated for program space visibility window access. Variables in this space can be read (but not written) using ordinary C statements and are subject to a maximum of 32K total space allocated.
psv
Program space, designated for program space visibility window access.
Variables in PSV space are not managed by the compiler and can not be accessed using
ordinary C statements. They must be explicitly accessed by the programmer, usually using
table-access inline assembly instructions, or using the program space visibility window.
Variables in PSV space can be accessed using a single setting of the PSVPAG register or by
qualifying with __psv__
.
eedata
- Devices with EEPROM Data (EEData) Memory
only
EEData space, a region of 16-bit wide non-volatile memory located at high
addresses in program memory. Variables in EEData space cannot be accessed using ordinary C
statements. They must be explicitly accessed by the programmer, usually using table-access
inline assembly instructions, or using the program space visibility window. The
__HAS_EEDATA__
manifest constant is defined for devices that support
EEData
dma
- DMA capable devices only
DPSRAM DMA memory. Variables in DMA memory can be accessed using ordinary
C statements and by the DMA peripheral. The __HAS_DMA__
manifest constant
is defined for devices that support DMA. If the device supports DMA but does not have
special DPSRAM available, the linker will not be able to allocate the space and will output
an error.