int i = 1 ;
__asm__ ( "
movl %0, %%eax\n
addl $1, %%eax\n
movl %eax, %0\n"
: : "g"(i) : "eax, "memory"
) ;
After this statement, i is 2.
But if change the input from "g"(i) to "r"(i), then i is still 1.
In document, "g" is register or memory, "r" is register, what happed
from "g" to "r" ?
Thanks! ( Can any tell me where to find inline ASM document ? )
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/