English
Language : 

CC78K0S Datasheet, PDF (360/520 Pages) NEC – C Compiler Ver.1.30 or Later Language
CHAPTER 11 EXTENDED FUNCTIONS
(14) Bit field declaration
Bit Field Declaration
Bit field declaration
(1) Extension of type specifier
FUNCTION
• The bit field of unsigned char type is not allocated straddling over a byte boundary.
• The bit field of unsigned int type is not allocated straddling over a word boundary, but can be allocated
straddling over a byte boundary.
• The bit fields of the same type are allocated in the same byte units (or word units). If the types are different,
the bit fields are allocated in different byte units (or word units).
EFFECT
• The memory can be saved, the object code can be shortened, and the execution speed can be improved.
USAGE
• As a bit field type specifier, unsigned char type can be specified in addition to unsigned int type. Declare as
follows.
struct
};
tag-name {
unsigned char Field name: bit width;
unsigned char Field name: bit width;
.
.
.
unsigned int Field name: bit width;
EXAMPLE
struct tagname {
unsigned char A: 1;
unsigned char B: 1;
.
.
.
unsigned int C: 2;
unsigned int D: 1;
.
.
.
360
User’s Manual U14872EJ1V0UM