using __asm__
paul rodriguez
prodrig@eece.unm.edu
Thu May 10 10:04:00 GMT 2001
Hi. You can use something as:
static __inline__ void your_function(long *ptr_flag,long *ptr_usp)
{
__asm__ __volatile__(
"mov (%0),%%r0 \n\t"
"mov (%1),%%r1 \n\t"
:
: "r" (ptr_flag), "r" (ptr_usp)
: "memory");
return;
}
where ptr_flag = &flag, ptr_usp = &usp
You can look into the kernel for more examples
Paul
On Thu, 10 May 2001, Tat Kee Tan wrote:
> I wish to have these asm in C using __asm__
>
> mov r0, flags
> mov r1, usp
>
> where flags and usp are 32bit long C variable.
> how should I do that ?
>
> The doc in info gcc is not clear at all.
>
> tatkee
More information about the Binutils
mailing list