void afunction(unsigned int x, unsigned int y, unsigned int z)
{
__asm__ ("movl %2, %0"
"addl %0, %2"
"movl %2, %1"
: "=a" (x), "=r" (z)
: "b"
);
cout << "x = " << x << endl;
cout << "y = " << y << endl;
cout << "z = " << z << endl;
}
I am passing in the values 0, 1 and 2 to this function. I was wondering what the output of this function going to be. In the embedded assembly we have three instructions movl,addl and another movl. How do these affect the output?
{
__asm__ ("movl %2, %0"
"addl %0, %2"
"movl %2, %1"
: "=a" (x), "=r" (z)
: "b"
);
cout << "x = " << x << endl;
cout << "y = " << y << endl;
cout << "z = " << z << endl;
}
I am passing in the values 0, 1 and 2 to this function. I was wondering what the output of this function going to be. In the embedded assembly we have three instructions movl,addl and another movl. How do these affect the output?