10.2 Integer Data Types

The following table shows integer data types that are supported in the compiler. All unspecified or signed integer data types are arithmetic type signed integer. All unsigned integer data types are arithmetic type unsigned integer.

Table 10-1. Integer Data Types
TypeBitsMin.Max.
char, signed char8-128127
unsigned char80255
short, signed short16-3276832767
unsigned short16065535
int, signed int16-3276832767
unsigned int16065535
long, signed long32-231231 - 1
unsigned long320232 - 1
long long*, signed long long*64-263263 - 1
unsigned long long*640264 - 1
* ANSI-89 extension

There is no type for storing single bit quantities.

All integer values are specified in little endian format, which means:

  • The least significant byte (LSB) is stored at the lowest address
  • The least significant bit (LSb) is stored at the lowest-numbered bit position

As an example, the long value of 0x12345678 is stored at address 0x100 as follows:

0x1000x1010x1020X103
0x780x560x340x12

As another example, the long value of 0x12345678 is stored in registers w4 and w5:

w4w5
0x56780x1234

Signed values are stored as a two’s complement integer value.

Preprocessor macros that specify integer minimum and maximum values are available after including <limits.h> in your source code, located by default in:

<install directory>\include

As the size of data types is not fully specified by the ANSI Standard, these macros allow for more portable code which can check the limits of the range of values held by the type on this implementation.

For information on implementation-defined behavior of integers, see Integers.