May 29, 2013
1:27 a.m.
On Tue, May 28, 2013 at 10:02 PM, lx <lxlenovostar@gmail.com> 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 ?
Hi, This is a C (preprocessor) macro called set_bit which use GCC inline assembly in its body. http://gcc.gnu.org/onlinedocs/cpp/Macros.html http://wiki.osdev.org/Inline_Assembly -- Augusto Mecking Caringi