07.04.2013 Views

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

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

__builtin_modsd<br />

Argument: dividend number to be divided<br />

divisor number to divide by<br />

Return Value: Remainder.<br />

Assembler Operator<br />

/ Machine<br />

Instruction:<br />

modsd<br />

Error Messages None.<br />

__builtin_modud<br />

Built-in Functions<br />

Description: Issues the 16-bit architecture’s native unsigned divide support with the<br />

same restrictions given in the “<strong>dsPIC</strong>30F/33F Programmer’s Reference<br />

Manual” (DS70157). Notably, if the quotient does not fit into a<br />

16-bit result, the results (including remainder) are unexpected. This<br />

<strong>for</strong>m of the builtin function will capture only the remainder.<br />

Prototype: unsigned int __builtin_modud(unsigned long dividend,<br />

unsigned int divisor);<br />

Argument: dividendnumber to be divided<br />

divisornumber to divide by<br />

Return Value: Remainder.<br />

Assembler Opera- modud<br />

tor / Machine<br />

Instruction:<br />

Error Messages None.<br />

__builtin_movsac<br />

Description: Computes nothing, but prefetchs data ready <strong>for</strong> a future MAC<br />

operation.<br />

xptr may be null to signify no X prefetch to be per<strong>for</strong>med, in which<br />

case the values of xincr <strong>and</strong> xval are ignored, but required.<br />

yptr may be null to signify no Y prefetch to be per<strong>for</strong>med, in which<br />

case the values of yincr <strong>and</strong> yval are ignored, but required.<br />

xval <strong>and</strong> yval nominate the address of a C variable where the<br />

prefetched value will be stored.<br />

xincr <strong>and</strong> yincr may be the literal values: -6, -4, -2, 0, 2, 4, 6 or an<br />

integer value.<br />

If AWB is non null, the other accumulator will be written back into the<br />

referenced variable.<br />

For example:<br />

register int result asm("A");<br />

int *xmemory;<br />

int *ymemory;<br />

int xVal, yVal;<br />

result = __builtin_movsac(&xmemory, &xVal, 2,<br />

&ymemory, &yVal, 2, 0);<br />

might generate:<br />

movsac A, [w8]+=2, w4, [w10]+=2, w5<br />

Prototype: int __builtin_movsac(<br />

int **xptr, int *xval, int xincr,<br />

int **yptr, int *yval, int yincr, int *AWB);<br />

© 2008 <strong>Microchip</strong> Technology Inc. DS51284G-page 151

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!