char and short Data Types (signed and unsigned)

The char and unsigned char data types are stored in memory as a single byte and are loaded to and stored from bits 0-7 of a register (see Figure 6-1). Objects defined as short or unsigned short are stored in memory as two bytes at a halfword (2 byte) aligned address and they are loaded to and stored from bits 0-15 of a register (see Figure 6-1).

Figure 6-1 Char and Short Data Storage Format
Signed 8-bit char
MS LS
S S S S S S S S S S S S S S S S S S S S S S S S S S I I I I I I
31 7 0
Unsigned 8-bit char
MS LS
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 U U U U U U U
31 7 0
Signed 16-bit short
MS LS
S S S S S S S S S S S S S S S S S I I I I I I I I I I I I I I I
31 15 0
Unsigned 16-bit short
MS LS
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 U U U U U U U U U U U U U U U U
31 15 0
LEGEND: S = sign, I = signed integer, U = unsigned integer, MS = most significant, LS = least significant