Tool/software: TI C/C++ Compiler
I have some questions about the MSP430 and TI compiler.
1) Is there a "break" instruction in the MSP430 instruction set ?
A "break" instruction would act as a breakpoint when a debugger is connected, otherwise it would act as a NOP.
2) For the C instructions "A |= B;" and "A &= ~B;", is the compiler always generates a single assembler instruction "BIS B, A" or "BIC B, A" ?
If it is not always the case, what are the constraints to respect ?
3) What is the undocumented compiler option "-vmspx" used for ?
4) How to prevent the replacement of an access to a const object by its value ?
For example :
The following constant is defined to 0x10 in the C source.
And we allow the production to change this value in the FRAM (or flash) before to start the firmware.
const unsigned char ProductionParameter = 0x10;
...
{
P1OUT &= ~ProductionParameter;
Debug --opt_level=0 --opt_for_speed=0 // access to const object: OK
D2C2 BIC.B &ProductionParameter,&P1OUT
C240
0202
Release --opt_level=4 --opt_for_speed=5
The const object is replaced by the value ~0x10, and the production value is ignored !
F2F0 AND.B #0x00ef,&P1OUT
EF00
0202
Regards, Bernd