{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Quiz5.fa07

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

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

Signature __________________ Name _________________________ cs30x____ Student ID _________________ Score: Quiz 5 CSE 30 Fall 2007 1) Convert 57.625 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 0xC2D7C000 (single precision IEEE floating-point representation) to fixed-point decimal . fixed-point decimal ______________________________ ( decimal / no exponential notation) List 2 C programming entities/parts that have local function scope/visibility, one stored on the stack and one not stored on the stack: 1) 2) Variables declared to be _________________ will not be optimized by the compiler. 2) What gets printed if the following function is invoked as recurse( 5, 10 ) ? int recurse( int a, int b ) { int local = b - a; int result; if ( b > 7 ) result = local + recurse( a, b - 1 ); else result = local;

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: printf( "%d\n", result ); return result; } (over) Put answers here 3) Given the following program, reorder the printf lines so that the values that are printed are sorted from small-est to largest if compiled and run on a Sun SPARC architecture. These lines print out the address of the different parts of the program (not the values assigned) with the printf() format specifier %p. int a; int main( int argc, char *argv ) { int b; static int c = 404; /* 1 */ (void) printf( "argc --> %p\n", &argc ); /* 2 */ (void) printf( "malloc --> %p\n", malloc(50) ); /* 3 */ (void) printf( "b --> %p\n", &b ); /* 4 */ (void) printf( "a --> %p\n", &a ); /* 5 */ (void) printf( "main --> %p\n", main ); /* 6 */ (void) printf( "c --> %p\n", &c ); } ___________ This line number would print the smallest value ___________ ___________ ___________ ___________ ___________ This line number would print the largest value What question would you like to see on the Final Exam?...
View Full Document

{[ snackBarMessage ]}

### Page1 / 2

Quiz5.fa07 - printf"%d\n" result return result(over...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online