MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip
MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip
MPLAB C Compiler for PIC24 MCUs and dsPIC DSCs ... - Microchip
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Run Time Environment<br />
The compiler arranges <strong>for</strong> registers W8-W15 to be preserved across ordinary function<br />
calls. Registers W0-W7 are available as scratch registers. For interrupt functions, the<br />
compiler arranges <strong>for</strong> all necessary registers to be preserved, namely W0-W15 <strong>and</strong><br />
RCOUNT.<br />
4.12 REGISTER CONVENTIONS<br />
Specific registers play specific roles in the C run-time environment. Register variables<br />
use one or more working registers, as shown in Table 4-3.<br />
TABLE 4-3: REGISTER CONVENTIONS<br />
Variable Working Register<br />
char, signed char, unsigned char W0-W13, <strong>and</strong> W14 if not used as a Frame<br />
Pointer.<br />
short, signed short, unsigned W0-W13, <strong>and</strong> W14 if not used as a Frame<br />
short<br />
Pointer.<br />
int, signed int,unsigned int W0-W13, <strong>and</strong> W14 if not used as a Frame<br />
Pointer.<br />
void * (or any pointer) W0-W13, <strong>and</strong> W14 if not used as a Frame<br />
Pointer.<br />
long, signed long, unsigned long A pair of contiguous registers, the first of which<br />
is a register from the set {W0, W2, W4, W6, W8,<br />
W10, W12}. The lower-numbered register<br />
contains the least significant 16-bits of the value.<br />
long long, signed long long, A quadruplet of contiguous registers, the first of<br />
unsigned long long<br />
which is a register from the set {W0, W4, W8}.<br />
The lower-numbered register contains the least<br />
significant 16-bits of the value. Successively<br />
higher-numbered registers contain successively<br />
more significant bits.<br />
float A pair of contiguous registers, the first of which<br />
is a register from the set {W0, W2, W4, W6, W8,<br />
W10, W12}. The lower-numbered register<br />
contains the least significant 16-bits of the<br />
significant.<br />
double* A pair of contiguous registers, the first of which<br />
is a register from the set {W0, W2, W4, W6, W8,<br />
W10, W12}. The lower-numbered register<br />
contains the least significant 16-bits of the<br />
significant.<br />
long double A quadruplet of contiguous registers, the first of<br />
which is a register from the set {W0, W4, W8}.<br />
The lower-numbered register contains the least<br />
significant 16-bits of the significant.<br />
structure 1 contiguous register per 2 bytes in the<br />
structure.<br />
* double is equivalent to long double if -fno-short-double is used.<br />
© 2008 <strong>Microchip</strong> Technology Inc. DS51284H-page 75