CCS 4.1.0.02003 and 28035
The assembler doesn't seem to handle the following correctly and assembles the instruction with an immediate value of 0x0000
MUI16TOF32 MR1,*MAR0[(_Symbol1.Tone1Phase-_Symbol1.Tone1Bin)]++
The assembler outputs (without warning or error):
352 000000f0 0000 MUI16TOF32 MR1,*MAR0[(_Symbol1.Tone1Phase-_Symbol1.Tone1Bin)]++ 000000f1 7551
Symbol1 is a structure and Tone1Phase and Tone1Bin are members. The difference in their offsets is +1.
The relevant defines as automatically fed to the assembler are:
A 5969 .global _Symbol1 A 5970 _Symbol1 .tag OFDMSYMBOL and:
A 5071 OFDMSYMBOL .struct 0,1 ; struct size=(8 bytes|128 bits), alignment=1 A 5072 0000 Tone1Bin .field 16 ; unsigned int Tone1Bin - offset 0 bytes, size (1 bytes|16 bits) A 5073 0001 Tone1Phase .field 16 ; unsigned int Tone1Phase - offset 1 bytes, size (1 bytes|16 bits) A 5074 0002 Tone2Bin .field 16 ; unsigned int Tone2Bin - offset 2 bytes, size (1 bytes|16 bits) A 5075 0003 Tone2Phase .field 16 ; unsigned int Tone2Phase - offset 3 bytes, size (1 bytes|16 bits) A 5076 0004 Tone3Bin .field 16 ; unsigned int Tone3Bin - offset 4 bytes, size (1 bytes|16 bits) A 5077 0005 Tone3Phase .field 16 ; unsigned int Tone3Phase - offset 5 bytes, size (1 bytes|16 bits) A 5078 0006 Tone4Bin .field 16 ; unsigned int Tone4Bin - offset 6 bytes, size (1 bytes|16 bits) A 5079 0007 Tone4Phase .field 16 ; unsigned int Tone4Phase - offset 7 bytes, size (1 bytes|16 bits) A 5080 0008 .endstruct ; final size=(8 bytes|128 bits)
The indirect increment CLA addressing mode is more powerful than it first looks as it is essentially a parallel load with zero cost. However, if the assembler won't do symbol arithmetic correctly the capability becomes very difficult to use.
The work around (at least for structures) is to manual assemble constants like we did in ancient times ;)