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.

If-then instruction for TMS470 assembler



I am changing from using Code Red to COde Composer for our LM3S9B96 project.

We use the widgetmutexget function to implement semaphores which uses in-line assembly and worked fine with the GCC toolchain.

  __asm("    mov      r1, #1\n"
        "    ldrexb   r2, [r0]\n"
        "    cmp      r2, #0\n"
        "    it       eq\n"
        "    strexbeq r2, r1, [r0]\n"
        "    mov      r0, r2\n"
        "    bx       lr\n"
#if !defined (ccs)
        : "=r" (ulRet));

return(ulRet)
#else
#pragma diag_suppress=994
)
#endif
  ;

The TMS470 assembler gives a

Empty or Invalid condition code

it eq

"C:\DOCUME~1\Berta\LOCALS~1\Temp\0560410", WARNING! at line 546: [W0004]

Incorrect condition code inside of IT block

strexbeq r2, r1, [r0]n

Everything I have read abot the If-then statement implies that the code is fine. Why is the 470 assembler complaining???

 

  • I remember hitting something like this a long time ago.  I believe the problem is that the TI ARM assembler insists that the condition code in the if-then be all capitals, "EQ" not "eq".  I don't know whether that is considered a bug or if it is under consideration for an enhancement request.  Perhaps someone more in-the-know will comment on this thread.

     

  • OK, Thanks, that worked. My boss suggested that off the cuff, but I found it hard to believe it could be something like that and I was was frustrated with all of the other things I had tried.