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.

TMS570LC4357: TI CCS

Part Number: TMS570LC4357

I am not able to compile the following code in CCS

static inline void *OsReadMainStackPtr(void)
{
  void *result = NULL;
  asm volatile( "MRS  R1, CPSR\n\t"
                "CPS #0x13\n\t"
                "MOV %0, SP\n\t"
                "MSR CPSR_c, R1\n\t" : "=r" (result)); 

  return result;
}

It throws error

 

error #18: expected a ")"

at "MSR CPSR_c, R1\n\t" : "=r" (result));

The above code compiles properly in IAR.