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
Do Keil know the assembler code "addcs"?
No, is doesn't. ADDCS is not a valid ARM assembly memonic. I guess you are looking for ADCS.
Also, did you make sure that the compiler produces code that is not optimal? Especially for something as simple as adding a few numbers together, I wouldn't believe that the compiler messes things up.