

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The solutions to quiz 4 of the cs30 course offered in fall 2005. It covers topics such as accessing local variables in the sparc architecture, using specific instructions, and converting between binary fixed-point and ieee floating-point representations. Additionally, it discusses the limitations of leaf subroutines and the output of a given function call.
Typology: Quizzes
1 / 2
This page cannot be seen from the preview
Don't miss anything!


To access local variables stored on the Runtime Stack in the SPARC architecture, you use a
____________________ offset relative to register ___________.
The ___________ instruction saves the current value of %pc in %o7.
The ret instruction adds __________ to the value in __________ and stores the result in __________.
In gdb, how do you set a breakpoint at a function named scooby?
The ___________ registers in the current register window set are mapped back to the ___________ registers as part of the restore instruction.
________________ subroutines support recursion.
If we have a ret instruction, the next instruction should be ___________________.
a) Convert - 76.125 10 to binary fixed-point and single precision IEEE floating-point representation (expressed in hexadecimal ).
binary fixed-point __________________________________ x 2^0
IEEE floating-point _______________________________________ ( hexadecimal )
b) Convert 0x428A8000 (single precision IEEE floating-point representation) to fixed-point decimal.
fixed-point decimal ______________________________ ( decimal / no exponential notation)
(over)
#3. Name 2 limitations of leaf subroutines.
#4. What gets printed with the function call mystery( 15 );?
int mystery( int param ) { int local = 70;
if ( local > param ) { local = local - param; printf( "%d\n", local ); /* Output the value of local followed by a newline / param = mystery( param + 15 ) + local; printf( "%d\n", param ); / Output the value of param followed by a newline */ } else { printf( "Halt\n" ); }
return local; }