{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

SPARC Architecture, Assembly Language Programming, and C (2nd Edition)

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Signature __________________ Name_______________ cs30x____ Student ID _________________ Score: Quiz 4 CSE 30 Spring 2007 #1. In a typical CISC architecture 1) Caller 2) Called/Callee _____ accesses the formal parameters via an offset from the FP (frame pointer). _____ allocates space for local variables. _____ allocates space for the return value. _____ stores the return value in the return value location. _____ saves the PC (program counter) as the return address. _____ pushes the actual arguments onto the stack. Which instruction saves the current value of the Program Counter (%pc) into %o7 as the saved return address? ______________ #2. a) Convert - 124.375 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 0x42768000 (single precision IEEE floating-point representation) to fixed-point decimal . fixed-point decimal ______________________________ (
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: decimal / no exponential notation) (over) #3. Given int x; void fubar( int a ) { int *b = &x; static int c = 42; ... } When this function is called, identify which area of the C Runtime Environment each of the following will be allocated. Area of Runtime Env. Scope/Visibility a ____________ ___________ b ____________ ___________ c ____________ ___________ fubar ____________ ___________ where b is pointing____________ If the function above is called 7 times, indicate how many times will c be initialized to 42? _________ #4. What gets printed with the function call mystery( 10 ); ? int mystery( int param ) { int local = 45; if ( local > param ) { local = local - param; printf( "%d\n", local ); /* Output the value of local followed by a newline */ param = mystery( param + 10 ) + local; printf( "%d\n", param ); /* Output the value of param followed by a newline */ } else { printf( "Halt\n" ); } return local; } Put answer here...
View Full Document

{[ snackBarMessage ]}