Hi, folks,
Am using CCS V5.2.0.00069, TI MSP430 compiler V4.1.1, eabi, small code & data model (set via Properties>MSP430 Compiler>Processor Options). I would have expected int to be 32 bits, per Table 5-2 "MSP430 C/C++ EABI Data Type" of the "MSP430 Optimizing C/C++ Compiler v 4.1 Beta User's Guide SLAU132G". However, int seems to be only 16 bits, as indicated by this snippet of the .asm output of a test program:
test_val = sizeof (char); MOVX.A #1,&test_valtest_val = sizeof (int); MOVX.A #2,&test_val <------ expect #4test_val = sizeof (long); MOVX.A #4,&test_valtest_val = sizeof (long long); MOVX.A #8,&test_val
Also __TI_EABI__ does not seem to be defined either. Has the compiler has defaulted to COFF (and 16-bit int) despite the EABI setting? Am I missing the obvious here, or is there some additional setting that's needed?
For COFF ABI, type int is represented by 16 bits, so you have probably managed to invoke the compiler in COFF mode. That is further corroborated by __TI_EABI__ not being defined. Check the setting for Properties/General/Advanced/Output Format for your target configuration.
The size of int is 16 bits in both COFF ABI and EABI. Table 5-2 is in error. It is also incorrect about the size of pointers.
Thanks for the quick responses. Life is a lot easier when int is the same size for EABI as for COFF.
Correction: Due to an artifact of colour shading in the CCS editor, I initially thought that __TI_EABI_ was not being defined; however, it is being defined and is correctly set to 1.
But the documentation appears to remain in error.
An effort should be made to publish corrections, particularly for such an important element as this.
I second that - seems like an email to the documentation department would take care of it. Any TI people have a few minutes to take care of this?
Thanks,
Erik
This issue was filed as defect report SDSCM00045021 on 2012-08-09.
I'll let someone else comment on the frequency of documentation updates.