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.
__builtin_dmaoffset<br />
Built-in Functions<br />
Description: Obtains the offset of a symbol within DMA memory.<br />
For example:<br />
unsigned int result;<br />
char buffer[256] __attribute__((space(dma)));<br />
result = __builtin_dmaoffset(&buffer);<br />
Prototype:<br />
Might generate:<br />
mov #dmaoffset(buffer), w0<br />
unsigned int __builtin_dmaoffset(const void *p);<br />
Argument: *p pointer to DMA address value<br />
Return Value: Returns the offset to a variable located in DMA memory.<br />
Assembler Operator<br />
/ Machine<br />
Instruction:<br />
dmaoffset<br />
Error Messages An error message will be displayed if the parameter is not the address<br />
of a global symbol.<br />
__builtin_ed<br />
Description: Squares sqr, returning it as the result. Also prefetchs data <strong>for</strong> future<br />
square operation by computing **xptr - **yptr <strong>and</strong> storing the<br />
result in *distance.<br />
xincr <strong>and</strong> yincr may be the literal values: -6, -4, -2, 0, 2, 4, 6 or an<br />
integer value.<br />
For example:<br />
register int result asm("A");<br />
int *xmemory, *ymemory;<br />
int distance;<br />
result = __builtin_ed(distance,<br />
&xmemory, 2,<br />
&ymemory, 2,<br />
&distance);<br />
Prototype:<br />
might generate:<br />
ed w4*w4, A, [w8]+=2, [W10]+=2, w4<br />
int __builtin_ed(int sqr, int **xptr, int xincr,<br />
int **yptr, int yincr, int *distance);<br />
Argument: sqr Integer squared value.<br />
xptr Integer pointer to pointer to x prefetch.<br />
xincr Integer increment value of x prefetch.<br />
yptr Integer pointer to pointer to y prefetch.<br />
yincr Integer increment value of y prefetch.<br />
distance Integer pointer to distance.<br />
Return Value: Returns the squared result to an accumulator.<br />
Assembler Operator<br />
/ Machine<br />
Instruction:<br />
ed<br />
© 2008 <strong>Microchip</strong> Technology Inc. DS51284G-page 147