Vault 7: Projects
This publication series is about specific projects related to the Vault 7 main publication.
MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 320 2012-2013 Microchip Technology Inc.
__builtin_return_address
Description: Returns the return address of the current function, or of one of its callers. For the level
argument, a value of 0 yields the return address of the current function, a value of 1 yields
the return address of the caller of the current function, and so forth. When level exceeds the
current stack depth, 0 will be returned. This function should only be used with a non-zero
argument for debugging purposes.
Prototype: int __builtin_return_address (const int level);
Argument: level Number of frames to scan up the call stack.
Return Value: Returns the return address of the current function, or of one of its callers.
Assembler Operator/
Machine Instruction:
return_address
__builtin_sac
Description: Shifts value by shift (a literal between -8 and 7) and returns the value.
For example:
volatile register int value asm("A");
int result;
result = __builtin_sac(value,3);
Might generate:
sac A, #3, w0
Prototype: int __builtin_sac(int value, int shift);
Argument: value Integer number to be shifted.
shift Literal amount to shift.
Return Value: Returns the shifted result to an accumulator.
Assembler Operator/
Machine Instruction:
sac
Error Messages An error message will be displayed if:
the result is not an accumulator register
the shift value is not a literal within range
__
builtin_sacr
Description: Shifts value by shift (a literal between -8 and 7) and returns the value which is rounded
using the rounding mode determined by the CORCONbits.RND control bit.
For example:
volatile register int value asm("A");
int result;
result = __builtin_sac(value,3);
Might generate:
sac.r A, #3, w0
Prototype: int __builtin_sacr(int value, int shift);
Argument: value Integer number to be shifted.
shift Literal amount to shift.
Return Value: Returns the shifted result to CORCON register.
Assembler Operator/
Machine Instruction:
sacr
Error Messages An error message will be displayed if:
the result is not an accumulator register
the shift value is not a literal within range
Protego_Release_01_05-Related-OEM-Documentation-MPLAB-XC16-C-Compiler.pdf