English
Language : 

CC78K4 Datasheet, PDF (311/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
Usage of sfr Area
sfr
EXPLANATION
• In the above example, use of sfr variables is declared with the #pragma sfr directive. By this declaration,
special function registers such as P0 (port 0) and CIC00 (one of the interrupt control registers490) can be used.
Note Bit 6 of the CIC00 register has the SFR bit name CMK00. For sfr, refer to the user’s manual of the
target device used.
COMPATIBILITY
From another C compiler to this C compiler
• Modification is not required if those portions of the C source program do not depend on the device or
compiler.
From this C compiler to another C compiler
• Delete the #pragma sfr statement or sort by #ifdef and add the declaration of the variable that was formerly
an sfr variable. The following shows an example.
#ifdef _ _K4_ _
#pragma sfr
#else
/* declaration of variables */
unsigned char P0;
#endif
void main(void) {
P0 = 0;
}
• In the case of a device that has the sfr or its alternative functions, a dedicated library must be created to
access that area.
User’s Manual U15556EJ1V0UM
311