Epson S5U1C17001C Manual page 58

Cmos 16-bit single chip microcontroller (c compiler package for s1c17 family) (ver. 3.2)
Hide thumbs Also See for S5U1C17001C:
Table of Contents

Advertisement

The store positions in the structure depend on the data type. Table 4.4.2.3 below gives the store positions in the structure by data
type.
char
short
int
long
pointer
long long
Structure
Array
Note: The store positions of variables located immediately after a structure or array may not correspond to the
positions indicated above.
 Structure data
Members are located in the memory according to the size of each data type in the order they are defined.
The following shows an example of how structure is defined, and where it is located.
struct Sample {
Example:
char
short
char
long
};
As shown in the diagram above, some unused areas may remain in the memory depending on the data type of a member.
C language specifications permit implementation-defined adjustment of the method of configuring member variables of a
structure or union.
The C compiler in this package is adjusted to yield even-number bytes for the size of a structure or union as an implementation
defined feature.
 Accessing bit fields
Bit fields are accessed using the size corresponding to the type defined.
S5U1C17001C Manual
(Rev. 1.0)
Table 4.4.2.3 Data types and store positions in structure
Data type
When 4-byte boundary type is not contained: 2-byte boundary
When 4-byte boundary type is contained: 4-byte boundary
cData;
sData;
cArray[3];
lData;
Start address +0
Low memory
Figure 4.4.2.1 Sample locations of structure data in the memory
Seiko Epson Corporation
Store position
1-byte boundary
2-byte boundary
2-byte boundary
4-byte boundary
4-byte boundary
4-byte boundary
Store position for data type
+8
lData
cArray[3]
+4
cData
Unused
+0
+1
Unused
sData
+2
+3
4 C Compiler
4-9

Advertisement

Table of Contents
loading

Table of Contents