Subject: Re: inline assembly & r0 SOS

From: Jeremy Kerr <[email-masked]>
Date: Wed, 6 Aug 2008 10:41:50 +1000

Hi Kevin,

>          /*
>           * Turn r3 (range) into a rotate count for the selected
> range. * 0 -> 23, 1 -> 31
>           */
>          __asm__ __volatile__ (  "slwi %0,%0,3\n"
>                                  "addi %0,%0,23\n"
>                                  "rlwnm %0,%1,%0,30,31\n":
>                  "=r"(ret):
>                  "r"(config),"0"(range)
>          );

Wouldn't this be much simpler in plain C?

However, if you really do need to do this in inline asm, you can use 
the "b" modifier rather than "r" to avoid using r0.

Cheers,

Jeremy