Keil Logo

Data Storage Formats

The table below lists the basic data types for the C251 compiler along with their size requirements and value ranges.

Data Type Bits Bytes Value Range
bit & 1 0 or 1
signed char 8 1 -128 — +127
unsigned char 8 1 0 — +255
enum 16 2 -32768 — +32767
signed short 16 2 -32768 — +32767
unsigned short 16 2 0 — +65535
signed int 16 2 -32768 — +32767
unsigned int 16 2 0 — +65535
signed long 32 4 -2147483648 — +2147483647
unsigned long 32 4 0 — +4294967295
float 32 4 ±1.17549435E-38 — ±3.4028235E+38
double § 64 8 ±2.2250738585072014E-308 — ±1.7976931348623158E+308
data*, idata*, pdata* (pointers) 8 1 0x00 — 0xFF
code*, xdata*, near* (pointers) 16 2 0x0000 — 0xFFFF
far*, huge* (pointers) 32 4 linear 16Mbyte address 0x000000 — 0xFFFFFF

Other data types, like structures and unions, may contain scalars from this table. All elements of these data types are allocated sequentially and are byte-aligned due to the 8-bit architecture of the 251 family.

Note

  •   Without using the FLOAT64 Compiler Directive, the size and range of double is the same as float.
  •   These data types are not provided in ANSI C. They are unique to the C251 Compiler.
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.