English
Language : 

CC78K4 Datasheet, PDF (297/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
Register Variables
register
USAGE
Declare a variable with the register storage class specifier as follows.
Register type-name variable-name
EXAMPLE
void main (void) {
register
}
unsigned char c;
:
RESTRICTIONS
• If register variables are not used so frequently, object code may increase (depending on the size and contents
of the source).
• Register variable declarations may be used for char/int/short/long/float/double/long double and pointer
data types.
• With the medium model, function pointers are allocated to saddr2 area for register variables. Function
pointers cannot be allocated to registers.
• A char type register variable uses only half the space required for the register variable of any other type. A
long/float/double/long double type variable uses twice the space.
• The function pointer type of the medium model and the pointer of the large model use one and a half the
amount of space.
• All the types have byte boundaries.
• If the register variables exceed the ‘usable number’ shown in Table 11-8, they are handled the same as
automatic variables without a register storage class specifier and allocated to ordinary memory space.
• Up to 20 bytes or 22 bytes can be allocated as register variables (6 bytes when 16 bytes of saddr2 area and
4 bytes of registers or UP are used).
Table 11-8. Restrictions on Register Variables Usage
Data Type
int/short
Function pointer of medium model
Pointer of large model
long/float/double/long double
Usable Number (Per Function)
10 variables max.
5 variables max.
6 variables max.
5 variables max.
User’s Manual U15556EJ1V0UM
297