Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Output of the function

Status
Not open for further replies.

vonnegut

Programmer
Jul 15, 2004
11
US
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" (y)
);

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?
 
Is the output 0,1 ,2 ? This is just a guess and not a very educated one. Can somebody help me out ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top