This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: using __asm__


	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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]