English
Language : 

CC78K4 Datasheet, PDF (372/523 Pages) NEC – CC78K4 Ver.2.30 or Later, C Compiler Language
CHAPTER 11 EXTENDED FUNCTIONS
Bit Field Declaration
Bit field declaration
EXAMPLE 3
(Bit field declaration)
struct
char
unsigned int
unsigned int
unsigned int
unsigned char
unsigned int
unsigned int
unsigned int
unsigned int
};
a;
b:6;
c:7;
d:4;
e:3;
f:10;
g:2;
h:5;
i:6;
Figure 11-3. Bit Allocation by Bit Field Declaration (Example 3) (1/2)
Bit allocation from MSB
with –RB option specified
MSB
c
Vacant
LSB
a
Bit allocation from LSB
without –RB option specified
MSB
c
b
LSB
a
Vacant
b
c
Vacant
d
Vacant
c
Since b and c are bit fields of type unsigned int, they are allocated from the next word unit.
Since d is also a bit field of type unsigned int, it is allocated from the next word unit.
e
Vacant
d
Vacant
Vacant
e
Vacant
Since e is a bit field of type unsigned char, it is allocated to the next byte unit.
372
User’s Manual U15556EJ1V0UM