21.1 Default Memory Spaces

The compiler defines several special purpose memory spaces to match architectural features of DSC devices. Static and external variables may be allocated in the special purpose memory spaces through use of the space attribute, described in 9.10 Variable Attributes.

data

General data space. Variables in general data space can be accessed using ordinary C statements. This is the default allocation.

xmemory

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

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 (PSV) window, or by qualifying with __prog__.

auto_psv - dsPIC33C/E/F and dsPIC30F devices only [DD]

A compiler-managed area in program space, designated for Program Space Visibility (PSV) 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- dsPIC33C/E/F and dsPIC30F devices only [DD]

Program space, designated for Program Space Visibility (PSV) 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 PSV 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 [DD]

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 (PSV) window. The __HAS_EEDATA__ manifest constant is defined for devices that support EEData

dma - DMA capable devices only [DD]

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.