Vault 7: Projects

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

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 222 2012-2013 Microchip Technology Inc.
EXAMPLE 19-3: SPECIFY A VARIABLE TO BE PLACED IN PROGRAM
MEMORY
EXAMPLE 19-4: LOCATE THE FUNCTION PRINTSTRING AT ADDRESS
0X8000 IN PROGRAM MEMORY
EXAMPLE 19-5: COMPILER AUTOMATICALLY SAVES AND RESTORES THE
VARIABLES VAR1 AND VAR2
PICC18 const char my_const_array[10] = {0,1,2,3,4,5,6,7,8,9};
C18 #pragma romdata const_table
const rom char my_const_array[10] =
{0,1,2,3,4,5,6,7,8,9};
XC16 const or
__attribute__((space(auto_psv)))
char my_const_array[10] = {0,1,2,3,4,5,6,7,8,9};
PICC18 int PrintString(const char *s)@ 0x8000 {...}
C18 #pragma code myTextSection=0x8000;
int PrintString(const char *s){...}
XC16 int __attribute__((address(0x8000))) PrintString
(const char *s) {...}
PICC18 No equivalent
C18 #pragma interrupt isr0 save=var1, var2
void isr0(void)
{
/* perform interrupt function here */
}
XC16 void __attribute__((__interrupt__(__save__(var1,var2))))
isr0(void)
{
/* perform interrupt function here */
}

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh