Re: c inline assembly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

What is you question or request? ;-)

------Original Message------
From: ratheesh kannoth
Sender: linux-c-programming-owner@xxxxxxxxxxxxxxx
To: linux-c-programming@xxxxxxxxxxxxxxx
To: gcc-help@xxxxxxxxxxx
Subject: c inline assembly
Sent: 18 Feb 2012 10:01

I am using gcc on a 32bit  intel machine.  i have defined an inline function.


This function is inline .  what all registers needs to pushed and
poped in the inline assembly so that the functions wont
disturb the registers in  the function ( in which it is C inlined  ).


inline unsigned long hello(unsigned long a)

{
 int b;
 asm ("movl %1, %%eax;
      " movl %1, %%ebx;
       "movl  %1, %%ecx;
       "movl  %1, %%esi;
       "movl  %1, %%edi;

       "movl %%eax, %0;"
       :"=r"(b)        /* output */
       :"r"(a)         /* input */
 );
}
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Best wishes,
Vladimir Murzinÿôèº{.nÇ+‰·Ÿ®‰­†+%ŠËÿ±éݶ¥Šwÿº{.nÇ+‰·¥Š{±ýÏ鮈+ji¢žâžØ^n‡r¡ö¦zË?ëh™¨è­Ú&£ûàz¿äz¹Þ—ú+€Ê+zf£¢·hšˆ§~†­†Ûiÿÿï?êÿ‘êçz_è®æj:+v‰¨þ)ߣøm



[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux