Section 2: Compiler
59
TI
-
89 / TI
-
92 Plus Sierra C Assembler Reference Manual Not for Distribution
Beta Version February 2, 2001
2.9.1. Integer
Types
Table 2.3 summarizes the recognized integer types, their sizes, and their value
ranges. Integer data types can also be declared to be signed just as they can be
declared to be unsigned. The signed keyword, however, is significant only
when used in a bit field declaration, because bit fields are the only integer data
types that are unsigned by default.
The integer data types int and short int declare objects of the same size (when
the
-XI
command line flag is used to specify 16-bit integers as on the
TI-89 / TI-92 Plus). Even though objects of both types have the same internal
representation and can be used to store the same values, the two types should
not be used interchangeably. One reason is that pointers to int and pointers to
short int are different types, and a warning will be issued if either type is
assigned to the other. Also, the program may someday be recompiled on
another compiler where int and short int do not declare objects of the same
size.
Type Size in Bits Minimum Value Maximum Value
char 8 -128 127
short int 16 -32768 32767
int †
16 -32768 32767
long int 32 -2147483648 2147483647
unsigned char 8 0 255
unsigned short int 16 0 65535
unsigned int†
16 0 65535
unsigned long int 32 0 4294967295
† Integers are 16-bit objects on the TI-89 / TI-92 Plus (the
-XI
command line flag is
specified).
Table 2.3: Integer Types
2.9.2. Integer
Representations
The memory address of any integer data object is the address of its highest
order byte (i.e., the byte containing the most significant bits). Unsigned integer
data types are represented as straight binary numbers, and signed integer types
are represented using two’s complement notation. Figure 2.1 shows the internal
representations of the three basic integer data types for the given values.