Using ARM inline assembly, how can I ask gcc to put a variable into a designated register?

LiMing <[email protected]>
Newsgroups gmane.linux.ports.arm.general
Message-ID <[email protected]>
Dear all,
 
Using ARM inline assembly, how can I ask gcc to put a variable into a designated  register?
For example: on X86 architechure,
 
int foo(int x, int y)
{
           int z = x + y;
 
           printf("foo:  x = %d  y= %d\n ", x, y);
           return z;
}
  
void call_foo(void)
{
         int result;
         int arg1 =1, arg2=2;         
 
         asm("foo" : "=r"(result) : "a"(arg1),"d"(arg2));
         printf("call_foo result = %d\n",result);       
}

In function call_foo, gcc will put arg1 into eax and arg2 into edx.
On ARM architechure, How can I ask arm gcc to put arg1 into r0 and arg2 into r1?
 
please help me what to do.
 
Regards,
 
Ming    
 		 	   		  
_________________________________________________________________
MSN十周年庆典,查看MSN注册时间,赢取神秘大奖
http://10.msn.com.cn
_______________________________________________
linux-arm mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.