SLAU132V October 2004 – February 2020
The MSP430 compiler supports three different data memory models: small, restricted and large. The data model used is controlled by the --data_model option. The 16-bit MSP430 devices always use the small data memory model. The 20-bit MSP430X devices can use any data memory model and use the small data model by default.
Data memory is also affected by the --near_data option as described in Section 6.1.3.
The maximum size of an object (size_t) and the maximum difference between two pointers (ptrdiff_t) are increased from 16-bits to 32-bits in the large data model. Applications that rely on size_t or ptrdiff_t to be a specific size may need to be updated.
Object files built with different data models are not compatible. All files in an application must be built with the same data model. Additionally, a run-time-support library matching that data model must be used. When using automatic library selection (the default), the linker will automatically select the correct library Section 4.3.1.1. If you select the library manually, you must select the matching library according to Section 7.1.8.