Hi Andreas Schmidt,
according to IAR EWARM IDE, it would be described as following, given the loop variable was declared.
asm ("mov %0,%1" : "=r" (loop), "=r" (delay_val) : "0" (loop), "1" (delay_val));
asm ("Lab:\n\t"
"adds %0,%0,#-1\n\t"
"bne Lab\n\t" : "=r" (loop) : "0" (loop) );
As for the label, it seems not to be recognized unless it will be written in one statement by IAR. By ordinary GCC even the following statements was OK.
asm volatile ("mov %0,%1" : "=r" (loop), "=r" (delay_val) : "0" (loop), "1" (delay_val));
asm volatile (".Lab:");
asm volatile ("add %0,%0,#-1" : "=r" (loop) : "0" (loop));
asm volatile ("bne .Lab");
Best regards,
Yasuhiko Koumoto.