This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5438A: ASM labels in C code unpredictable behavior?

Part Number: MSP430F5438A

Hi,

To make test automation, C code requires the ASM labels needs to added in code as shown attached screen shot.

But, TI document - SLAU132Y for MSP430, Section 6.6.5 has below statement

The Label usage is in below code:

The Label is added as shown above and working as expected and not seeing any issues in testing.

This code is being used for machine critical application, So could you please confirm, the label being used in C code as shown in above screen shot will result in unpredictable controller behavior?

  • Hello Ankal,

    All I can confirm is the language you highlighted. That inserting "[ASM] jumps or labels into C/C++ code... can produce unpredictable results." This doesn't mean it will, and it would be dependant on what the ASM program insertion manipulated or not. The key here is that the compiler does not check or read ASM insertions, and thus operates with assumption that anything in the insertion can be ignored. So basically, you should be pretty confident at what your doing with ASM insertions if you want to use them. 

  • And I would imagine that optimization plays into this too, so you might want to turn it off.

**Attention** This is a public forum