# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MPLAB XC16 C-Compiler

- 1
- 2
…
- 134
- 135
- 136
- 137
- 138
…
- 365
- 366

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 136  2012-2013 Microchip Technology Inc.
prog
Allocate the variable in program space, in a section designated for executable
code. Variables in 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, the program space visibility window, or
by the methods described in Section 10.4.2 Access of objects in Program
Memory.
auto_psv
Allocate the variable in program space, in a compiler-managed section
designated for automatic program space visibility window access. Variables in
auto_psv space can be read (but not written) using ordinary C statements, and
are subject to a maximum of 32K total space allocated. When specifying
space(auto_psv), it is not possible to assign a section name using the sec-
tion attribute; any section name will be ignored with a warning. A variable in the
auto_psv space cannot be placed at a specific address or given a reverse
alignment.
dma - PIC24E/H MCUs, dsPIC33E/F DSCs only
Allocate the variable in DMA memory. Variables in DMA memory can be
accessed using ordinary C statements and by the DMA peripheral.
__builtin_dmaoffset() and __builtin_dmapage() can be used to find
the correct offset for configuring the DMA peripheral. See Appendix G. Built-in
Functions for details.
#include <p24Hxxxx.h>
unsigned int BufferA[8]
__attribute__((space(dma)));
unsigned int BufferB[8] __attribute__((space(dma)));
int main()
{
DMA1STA =
__builtin_dmaoffset(BufferA);
DMA1STB =
__builtin_dmaoffset(BufferB);
/* ... */
}
psv
Allocate the variable in program space, in a section designated for program space
visibility window access. The linker will locate the section so that the entire vari-
able can be accessed using a single setting of the PSVPAG register. Variables in
PSV space are not managed by the compiler and can not be accessed using ordi-
nary C statements. They must be explicitly accessed by the programmer, usually
using table-access inline assembly instructions, or using the program space
visibility window.
eedata - PIC24F, dsPIC30F/33F DSCs only
Allocate the variable in EEData space. Variables in EEData space 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.
pmp
Allocate the variable in off chip memory associated with the PMP peripheral. For
complete details please see Section 10.5 Parallel Master Port Access.
Note: Variables placed in the auto_psv section are not loaded into data
memory at startup. This attribute may be useful for reducing RAM
usage.
DD
DD

- 1
- 2
…
- 134
- 135
- 136
- 137
- 138
…
- 365
- 366