English
Language : 

CC78K0S Datasheet, PDF (411/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 11 EXTENDED FUNCTIONS
(29) Register direct reference function
Register Direct Reference Function
#pragma realregister
FUNCTION
• Outputs the code that accesses the object register with direct inline expansion instead of function call, and
generates an object file.
• When there is no #pragma directive, the register direct reference function is regarded as an ordinary function.
EFFECT
• Due to the C description, register access can be performed easily.
USAGE
• This function is described in the same format as a function call (Refer to Register direct reference function
list later in this chapter).
There are 21 types of register direct reference function names.
_ _geta, _ _seta, _ _getax, _ _setax, _ _getcy, _ _setcy, _ _set1cy, _ _clr1cy
_ _not1cy, _ _inca, _ _deca, _ _rora, _ _rorca, _ _rola, _ _rolca, _ _shla
_ _shra, _ _ashra, _ _nega, _ _coma, _ _absa
• Use of the register direct reference function is declared by using the #pragma realregister directive in a
module.
However, the following items can be described before the #pragma realregister directive.
• Comments
• Other #pragma directives
• Preprocessing directives that neither define nor reference variables or functions
EXAMPLE
(C source)
#pragma realregister
unsigned char c = 0x88, d, e ;
void main ()
{
_ _seta (c) ;
/* Sets the variable of C in A register
*/
_ _shla () ;
/* Logically shifts 1 bit to left
*/
d = _ _geta () ;
/* Sets the value of A register in variable d */
if (_ _getcy () ) {
/* Refers CY (checks overflow)
*/
e=1;
/* Sets e to 1 when CY = = 1
*/
}
}
User’s Manual U14872EJ1V0UM
411