i worked thru the manuals, the CARM User's Guide Inline Assembly example:
int AddUp ( int n, int *pTab) { if (n == 0) return(0); __asm { mov r0, #0 ; clear result ldav r2, r0, pTab ; R2=start of table ldav r3, r0, n ; R3=table length lsl r3, r3, #2 lM: sub r3, #4 ldr r1, [r2,r3] add r0, r1 cmp r3, #0 ; end of table ? bgt lM ; loop if not eot } // Return Value in R0 }
First i had to replace:
lsl r3, r3, #2
by mov r3,r3,lsl #2 Second there's a warning C180 not every path returns a value. The question is how to tell CARM that return value is in R0