Keil Logo

C166 Introduction Data Types

The C166 Compiler supports data types listed in the following table.

Data Type Size Range of values
bit 1 bit 0 or 1
signed char 1 byte -128 to +127
unsigned char 1 byte 0 to 255
signed int 2 bytes -32768 to +32767
unsigned int 2 bytes 0 to 65535
signed long 4 bytes -2147483648 to +2147483647
unsigned long 4 bytes 0 to 4294967295
float 4 bytes ±1,176E-38 to ±3,40E+38
double 8 bytes ±1,7E-308 to ±1,7E+308
pointer 2 or 4 bytes address of objects

Data Types for SFR access:

Data Type Size Range of values
sbit 1 bit 0 or 1
sfr 2 bytes 0 to 65535
  • Variables may also be combined into structures and unions. Pointers with multidimensional arrays may be created and variables are accessible. The two special data types (sbit and sfr) enable easier access to the Special Function Register (SFR) of the 80C166 processor. For example, the directive sfr P0 = 0xFF00 defines the variable P0 for PORT0 (address 0xFF00).
  • Data types are automatically converted when the result implies another data type. For instance, a bit variable is converted to an integer variable by assignment to an integer variable.
  • A sign extension is automatically carried out with signed variables.

These conversions can also be performed manually using standard C language directives.

  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.