Vault 7: Projects

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

© 2005-2011 Microchip Technology Inc. DS70157F-page 477
Section 6. Built-in Functions
Built-in Functions
6
__builtin_tblpage
Description:
Returns the table page number 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” of the “MPLAB
®
C Compiler for PIC24
MCUs and dsPIC
®
DSCs User’s Guide” (DS51284).
Prototype:
unsigned int _ _builtin_tblpage(const void *p);
Argument:
p object address
Return Value:
Returns the table page number of the object whose address is given as a parameter.
Assembler Operator / Machine Instruction:
tblpage
Error Messages:
The following error message is produced when this function is used incorrectly:
“Argument to _ _builtin_tblpage() 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_tblpage(&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 specific device data sheet or the appropriate 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:
None.
Assembler Operator / Machine Instruction:
tblrdh
Error Messages:
None.

e-Highlighter

Click to send permalink to address bar, or right-click to copy permalink.

Un-highlight all Un-highlight selectionu Highlight selectionh