From mboxrd@z Thu Jan 1 00:00:00 1970 From: j.neuschaefer@gmx.net (Jonathan =?utf-8?Q?Neusch=C3=A4fer?=) Date: Wed, 29 May 2013 17:33:59 +0200 Subject: hi about C and asm In-Reply-To: References: Message-ID: <20130529153359.GA3135@debian.debian> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Wed, May 29, 2013 at 09:02:22AM +0800, lx wrote: > hi all: > They are some asm codes in the kernel like: > > #define set_bit(nr,addr) ({\ > register int res __asm__("ax"); \ > __asm__ __volatile__("btsl %2,%3\n\tsetb %%al": \ > "=a" (res):"0" (0),"r" (nr),"m" (*(addr))); \ > res;}) > > > But, almost I can't understand this. So I want to understand asm in C, > which book or website I should learn ? Google "asm in c", first link is: http://www.ibiblio.org/gferg/ldp/GCC-Inline-Assembly-HOWTO.html HTH, Jonathan Neusch?fer