SPRAB89A September 2011 – March 2014
The C6000 can be configured to run in either big or little endian mode. Endianness refers to the memory layout of multi-byte values. In big endian mode, the most significant byte of the value is stored at the smallest address. In little endian mode, the least significant byte is stored at the smallest address. Endianness affects only objects' memory representation; scalar values in registers always have the same representation regardless of endianness. Endianness does affect the layout of structures and bit fields, which carries over into their register representation.
Scalar variables are aligned such that they can be loaded and stored using the native instructions appropriate for their type: LDB/STB for bytes, LDH/STH for halfwords, LDW/STW for words, and so on. These instructions correctly account for endianness when moving to and from memory.
Forty-bit integers have 5 bytes, designated 0 (LSB) through 4 (MSB). In memory, 40-bit values are padded to 64 bits (8 bytes). If the address of the value in memory is N, then Figure 2-1 gives the storage layout: