Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
16-bit MCU and DSC Programmer’s Reference Manual
DS70157F-page 456 © 2005-2011 Microchip Technology Inc.
__builtin_ed
Description:
Squares sqr, returning it as the result. Also prefetches data for future square operation by
computing **xptr - **yptr and storing the result in *distance.
xincr and yincr may be the literal values: -6, -4, -2, 0, 2, 4, 6 or an integer value.
For example:
register int result asm("A");
int *xmemory, *ymemory;
int distance;
result = _ _builtin_ed(distance,
&xmemory, 2,
&ymemory, 2,
&distance);
May generate:
ed w4*w4, A, [w8]+=2, [W10]+=2, w4
Prototype:
int _ _builtin_ed(int sqr, int **xptr, int xincr,
int **yptr, int yincr, int *distance);
Argument:
sqr Integer squared value.
xptr Integer pointer to pointer to x prefetch.
xincr Integer increment value of x prefetch.
yptr Integer pointer to pointer to y prefetch.
yincr Integer increment value of y prefetch.
distance Integer pointer to distance.
Note: The arguments xptr and yptr must point to the arrays located in the x data
memory and y data memory, respectively.
Return Value:
Returns the squared result to an accumulator.
Assembler Operator / Machine Instruction:
ed
Error Messages:
An error message appears if:
• the result is not an accumulator register
• xptr is null
• yptr is null
• distance is null
Protego_Release_01_05-Related-OEM-Documentation-PIC24FJ64GA004-Programmers_Reference_Manual.pdf