Writing MSP430 C Code
Data Types
The following data types are specified in the C Compiler Users Guide. We’ve circled the types
that best describe this processor.
With the MSP430’s ability to perform byte-wide addressing, it follows that char’s are 8-bits.
As one might expect, though, being a 16-bit CPU, both the short and int data types are 16-bits
wide.
MSP430 C Data Types (ELF format)
Type Bits Representation
char 8
(aligned to 8-bit boundary)
short 16
Binary, 2's complement
int 16
Binary, 2's complement
long 32
Binary, 2's complement
long long 64
Binary, 2's complement
float 32
IEEE 32-bit
double 64
IEEE 64-bit
long double 64
IEEE 64-bit
Data are aligned to 16-bit address boundary (except where noted)
8-bit values are stored in bits 0-7 of a register
32- and 64-bit types require 2 and 4 registers, respectively
MSP430 Workshop - Programming C with CCS 2 - 23