Справочник Пользователя для Microchip Technology SW006021-2N
MPLAB
®
XC8 C Compiler User’s Guide
DS52053A-page 28
2012 Microchip Technology Inc.
2.5.4.3
MIGRATION TO THE CCI
For 8-bit compilers, change any occurrence of the near qualifier, as in the following
example:
example:
near char template[20];
to __near, i.e., __near char template[20];
In 16- and 32-bit compilers, change any occurrence of the near attribute, as in the fol-
lowing
lowing
void bar(void) __attribute__ ((near));
int tblIdx __attribute__ ((near));
to
void __near bar(void);
int __near tblIdx;
2.5.4.4
CAVEATS
None.
2.5.5
Persistent Objects
The __persistent qualifier may be used to indicate that variables should not be
cleared by the runtime startup code.
cleared by the runtime startup code.
Use the native keywords discussed in the Differences section to look up information on
the semantics of this qualifier.
the semantics of this qualifier.
2.5.5.1
EXAMPLE
The following shows a variable qualified using __persistent.
__persistent int serialNo;
2.5.5.2
DIFFERENCES
The 8-bit compilers have used the qualifier, persistent, to indicate this meaning.
The 16- and 32-bit compilers have used the persistent attribute with variables to
indicate they were not to be cleared.
indicate they were not to be cleared.
2.5.5.3
MIGRATION TO THE CCI
With 8-bit compilers, change any occurrence of the persistent qualifier, as in the fol-
lowing example:
lowing example:
persistent
char template[20];
to __persistent, i.e., __persistent char template[20];
For the 16- and 32-bit compilers, change any occurrence of the persistent attribute,
as in the following
as in the following
int tblIdx __attribute__ ((
persistent
));
to
int __
persistent
tblIdx;
2.5.5.4
CAVEATS
None.