English
Language : 

CC78K4 Datasheet, PDF (309/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
(4) How to use the sfr area
Usage of sfr Area
sfr
FUNCTION
• The sfr area refers to a group of special function registers such as mode registers and control registers for the
various peripherals of the 78K/IV Series microcontrollers.
• By declaring use of sfr names, manipulations on the sfr area can be described at the C source level.
• sfr variables are external variables without initial values (undefined).
• A write check will be performed on read-only sfr variables.
• A read check will be performed on write-only sfr variables.
• Assignment of illegal data to an sfr variable will result in a compilation error.
• The sfr names that can be used are those allocated to an area consisting of addresses FF00H to FFFFH with
the small model, or XFF00H to XFFFFH with the medium large model. (x: 0 or F by specifying location)
EFFECT
• Manipulations on the sfr area can be described at the C source level.
• Instructions to the sfr area are shorter in code length than those to memory. This helps shorten object code
and also improves program execution speed.
USAGE
• Declare the use of an sfr name in the C source with the #pragma preprocessing directive, as follows. (The
keyword sfr can be described in uppercase or lowercase letters.).
#pragma sfr
• The #pragma sfr directive must be described at the beginning of the C source line. If #pragma PC
(processor type) is specified, however, describe #pragma sfr after that.
The following statement and directives may precede the #pragma sfr directive.
. Comment statement
. Preprocessing directives that do not define or refer to a variable or function
• In the C source program, describe an sfr name that the device has as is (without change). In this case, the
sfr need not be declared.
User’s Manual U15556EJ1V0UM
309