SLAU132V October 2004 – February 2020
Table 6-2 lists register and memory storage for various data types:
Data Type | Register Storage | Memory Storage |
---|---|---|
char | Bits 0-7 of register | 8 bits aligned to 8-bit boundary |
unsigned char | Bits 0-7 of register | 8 bits aligned to 8-bit boundary |
short | Bits 0-15 of register | 16 bits aligned to 16-bit boundary |
unsigned short | Bits 0-15 of register | 16 bits aligned to 16-bit boundary |
int | Entire register | 16 bits aligned to 16-bit boundary |
unsigned int | Entire register | 16 bits aligned to 16-bit boundary |
enum (1) | Entire register | 16 bits aligned to 16-bit boundary |
float | Two registers, which need not be adjacent | 32 bits aligned to 16-bit boundary |
long | Two registers, which need not be adjacent | 32 bits aligned to 16-bit boundary |
unsigned long | Two registers, which need not be adjacent | 32 bits aligned to 16-bit boundary |
long long | Four registers, which need not be adjacent | 64 bits aligned to 16-bit boundary |
unsigned long long | Four registers, which need not be adjacent | 64 bits aligned to 16-bit boundary |
double | Four registers, which need not be adjacent | 64 bits aligned to 16-bit boundary |
long double | Four registers, which need not be adjacent | 64 bits aligned to 16-bit boundary |
struct | Members are stored as their individual types require. | Multiple of 8 bits aligned to boundary of largest member type; members are stored and aligned as their individual types require. |
array | Members are stored as their individual types require. | Members are stored as their individual types require. All arrays inside a structure are aligned according to the type of each element in the array. |
pointer to data member | Bits 0-15 of register for MSP430. Bits 0-19 of register for MSP430X. | varies, see Table 5-2 |
pointer to member function | Components stored as their individual types require | 64 bits aligned to 32-bit boundary |