SLAA534A June 2013 – June 2020
The MSP430 uses little-endian mode only. Endianness refers to the memory layout of multi-byte values. 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: MOV.B for bytes, MOV.W for words, and MOVA for 20-bit addresses. These instructions correctly account for endianness when moving to and from memory.
Twenty-bit addresses have 3 bytes, designated 0 (LSB) through 2 (MSB). In memory, 20-bit values are padded to 32 bits (4 bytes). If the address of the value in memory is N, then Figure 2-1 gives the storage layout: