We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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
There are at least three possible ARM compilers, and there is no single standard for inlining assembler.
I'm working with the uvision mdk keil compiler.
On the other hand - exactly why do you want to inline assembler?
It's the checksum calculation for ip pkts - so I hope to get a faster calculation using assembler instead of c-code.