# Vault 7: Projects

This publication series is about specific projects related to the Vault 7 main publication.

### Protego

# MPLAB XC16 C-Compiler

- 1
- 2
…
- 322
- 323
- 324
- 325
- 326
…
- 365
- 366

MPLAB
®
XC16 C Compiler Users Guide
DS50002071C-page 324  2012-2013 Microchip Technology Inc.
__builtin_tbloffset
Description: Returns the table page offset of the object whose address is given as a parameter. The
argument p must be the address of an object in an EE data, PSV or executable memory
space; otherwise an error message is produced and the compilation fails. See the space
attribute in Section 2.3.1 Specifying Attributes of Variables.
Prototype: unsigned int __builtin_tbloffset(const void *p);
Argument: p object address
Return Value: Returns the table page number offset of the object whose address is given as a parameter.
Assembler Operator/
Machine Instruction:
tbloffset
Error Messages The following error message is produced when this function is used incorrectly:
Argument to __builtin_tbloffset() is not the address of an object in code, psv, or
eedata section.
The argument must be an explicit object address.
For example, if obj is object in an executable or read-only section, the following syntax is
valid:
unsigned page = __builtin_tbloffset(&obj);
__
builtin_tblrdh
Description: Issues the tblrdh.w instruction to read a word from Flash or EEDATA memory. You must
set up the TBLPAG to point to the appropriate page. To do this, you may make use of
__builtin_tbloffset() and __builtin_tblpage().
Please refer to the data sheet or dsPIC Family Reference Manual for complete details
regarding reading and writing program Flash.
Prototype: unsigned int __builtin_tblrdh(unsigned int offset);
Argument: offset desired memory offset
Return Value: Contents of the memory address in Flash or EEDATA memory.
Assembler Operator/
Machine Instruction:
tblrdh
Error Messages None.
__
builtin_tblrdl
Description: Issues the tblrdl.w instruction to read a word from Flash or EEDATA memory. You must
set up the TBLPAG to point to the appropriate page. To do this, you may make use of
__builtin_tbloffset() and__builtin_tblpage().
Please refer to the data sheet or dsPIC30F Family Reference Manual (DS70046) for com-
plete details regarding reading and writing program Flash.
Prototype: unsigned int __builtin_tblrdl(unsigned int offset);
Argument: offset desired memory offset
Return Value: Contents of the memory address in Flash or EEDATA memory.
Assembler Operator/
Machine Instruction:
tblrdl
Error Messages None.

- 1
- 2
…
- 322
- 323
- 324
- 325
- 326
…
- 365
- 366