Data Representation - Epson S5U1C17001C Manual

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

4.4.2

Data Representation

The xgcc C compiler supports all data types under ANSI C. Table 4.4.2.1 below lists the size of each type (in bytes) and the
effective range of numeric values that can be expressed in each type.
Data type
char
unsigned char
short
unsigned short
int
unsigned int
long
unsigned long
pointer
float
double
long long
unsigned long long
wchar_t
The float and double types conform to the IEEE standard format.
Handling of long long-type constants requires the suffix LL or ll (long long type) or ULL or ull (unsigned long long
type). If this suffix is not present, a warning is generated, since the compiler may not be able to recognize long long-type
constants as such.
Example:long longll_val;
ll_val = 0x1234567812345678;
→ warning:integer constant is too large for "long" type
Ll_val = 0x1234567812345678LL;
→ OK
Type wchar_t is the data type needed to handle wide characters. This data type is defined in stdlib.h/stddef.h as the type
unsigned short.
 Store positions in memory
The positions in the memory where data is stored depend on the data type and the variable area storing the data. Table 4.4.2.2
below shows the store positions in the variable areas by data type.
Data type
char
short
int
long
pointer
long long
When 4-byte boundary type is not contained: 2-byte boundary
Structure
When 4-byte boundary type is contained: 4-byte boundary
When 4-byte boundary type is not contained: 2-byte boundary
Array
When 4-byte boundary type is contained: 4-byte boundary
S5U1C17001C Manual
(Rev. 1.0)
Table 4.4.2.1 Data type and size
Size
1
-128 to 127
1
0 to 255
2
-32768 to 32767
2
0 to 65535
2
-32768 to 32767
2
0 to 65535
4
-2147483648 to 2147483647
4
0 to 4294967295
4
0 to 16777215
4
1.175e-38 to 3.403e+38 (normalized number)
8
2.225e-308 to 1.798e+308 (normalized number)
8
-9223372036854775808 to 9223372036854775807
8
0 to 18446744073709551615
2
0 to 65535
Table 4.4.2.2 Data types and store positions
Global variable area
Seiko Epson Corporation
Effective range of a number
Local variable area
1-byte boundary
2-byte boundary
2-byte boundary
4-byte boundary
4-byte boundary
4-byte boundary
When size is 2 bytes or less: 2-byte boundary
When size is 3 bytes or more: 4-byte boundary
When the number of elements is 1: Store position for data type
When the number of elements is 2 or more: 4-byte boundary
4 C Compiler
4-8

Advertisement

Table of Contents
loading

Table of Contents