public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Moving long long int using inline asm
@ 2007-02-01  8:29 Mohamed Shafi
  2007-02-01  9:34 ` Tim Prince
  0 siblings, 1 reply; 2+ messages in thread
From: Mohamed Shafi @ 2007-02-01  8:29 UTC (permalink / raw)
  To: gcc-help

Hello all,

There are two variables
long long var1;
long long var2;

Using inline assembly how will i be able to move the value from var1 to var2,
i.e var2 = var1

The architecture has only a 32 bit move instruction say mov32
Something like

asm( "mov32 %0, %1"  : "=r"(var2) : "r"(var1) );

would have worked fine for 32bit data types.What is the similar syntax
for 64 bit data types?

Can someone help me?

Thanks in advance.

Regards,
Shafi

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Moving long long int using inline asm
  2007-02-01  8:29 Moving long long int using inline asm Mohamed Shafi
@ 2007-02-01  9:34 ` Tim Prince
  0 siblings, 0 replies; 2+ messages in thread
From: Tim Prince @ 2007-02-01  9:34 UTC (permalink / raw)
  To: Mohamed Shafi; +Cc: gcc-help

Mohamed Shafi wrote:
> Hello all,
>
> There are two variables
> long long var1;
> long long var2;
>
> Using inline assembly how will i be able to move the value from var1 
> to var2,
> i.e var2 = var1
>
> The architecture has only a 32 bit move instruction say mov32
> Something like
>
> asm( "mov32 %0, %1"  : "=r"(var2) : "r"(var1) );
>
> would have worked fine for 32bit data types.What is the similar syntax
> for 64 bit data types?
>
> Can someone help me?
>

As you don't care to reveal enough details to permit an answer, you 
might start by checking how your copy of gcc does it for your target 
(e.g. gcc -S...).  If you don't care to do that, you have no business 
with asm.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2007-02-01  9:34 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-01  8:29 Moving long long int using inline asm Mohamed Shafi
2007-02-01  9:34 ` Tim Prince

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).