This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

need some help with inline assembler (addcs)

Hello,

I want add some inline assembler in my c-code: but at the moment I get some errors.

 unsigned int sum=0;

 __asm ("adds   %0, %1, %1, lsl #16   \n\ 
                         addcs   %0, %0, #0x10000"
                        : "=r" (sum)
                        : "r" (sum)
                        : "cc");
                        return (~sum) >> 16;

The error messages for this line (addcs %0, %0, #0x10000") are "expected an expression" and "Missing operand". Do Keil know the assembler code "addcs"?

best regards
Tim

0