

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


x = a * 256 โ b;
ld [%fp -4], %o0! variable a allocated at %fp- set 256, %o1! const value 256; could have used mov instead of set call .mul! multiply nop! delay slot ! st %o0, [%fp -20]! store result of MulOp into temp at %fp- ! End of Expr7 MulOp production
ld [%fp -20], %o0! ExprSTO with value stored at %fp- ld [%fp -8], %o1! variable b allocated at %fp- sub %o0, %o1, %o0! subtract st %o0, [%fp -24]! store result of AddOp into temp at %fp- ! End of Expr6 AddOp production
ld [%fp -24], %o0! ExprSTO with value stored at %fp- st %o0, [%fp -12]! variable x allocated at %fp- ! End of AssignStmt production
int a = 23; int b = 34;
function : void fubar( int * x, int & y, int * p, int & q ) { ++x; ++y; ++p; ++q; }
function : void foo1( int & c, int * d ) { ++c; ++*d;
cout << a << endl; ______
cout << b << endl; ______
cout << c << endl; ______
cout << *d << endl; ______
fubar( &c, c, d, *d );
cout << a << endl; ______
cout << b << endl; ______
cout << c << endl; ______
cout << *d << endl; ______ }
function : int main() { foo1( a, &b );
cout << a << endl; ______
cout << b << endl; ______
return 0; }