=是write only的意思。+是read-write。
#include
void main()
{
int x = 1;
int z = 3;
int y = 0;
printf("x = %d,y = %d, z = %d",x, y, z );
__asm__ __volatile__("movl %1, %0\n\t"
"movl %2, %0\n\t"
:"+r"(y)
:"r"(z),"r"(x)
:"0"
);
printf("\nx = %d, y = %d, z = %d", x, y, z);
}
No comments:
Post a Comment