Vault 7: Projects

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

Built-in Functions
2012-2013 Microchip Technology Inc. DS50002071C-page 319
__builtin_psvpage
Description: Returns the psv 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.
Prototype: unsigned int __builtin_psvpage(const void *p);
Argument: p object address
Return Value: Returns the psv page number of the object whose address is given as a parameter.
Assembler Operator/
Machine Instruction:
psvpage
Error Messages The following error message is produced when this function is used incorrectly:
Argument to __builtin_psvpage() is not the address of an object in code, psv, or eed-
ata 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_psvpage(&obj);
__
builtin_psvoffset
Description: Returns the psv page offset of the object whose address is given as a parameter. The argu-
ment 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_psvoffset(const void *p);
Argument: p object address
Return Value: Returns the psv page number offset of the object whose address is given as a parameter.
Assembler Operator/
Machine Instruction:
psvoffset
Error Messages The following error message is produced when this function is used incorrectly:
Argument to __builtin_psvoffset() 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_psvoffset(&obj);
__
builtin_readsfr
Description: Reads the SFR.
Prototype: unsigned int __builtin_readsfr(const void *p);
Argument: p object address
Return Value: Returns the SFR.
Assembler Operator/
Machine Instruction:
readsfr
Error Messages The following error message is produced when this function is used incorrectly:

e-Highlighter

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

Un-highlight all Un-highlight selectionu Highlight selectionh