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

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

Signature __________________ Name_______________ cs30x____ Student ID _________________ Score: Quiz 4 CSE 30 Winter 2007 #1. In a typical CISC architecture A) Caller B) Called/Callee _____ 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. _____ accesses the formal parameters via an offset from the FP (frame pointer). _____ allocates space for local variables. _____ allocates space for the return value. #2. a) Convert 137.875 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 0xC2568000 (single precision IEEE floating-point representation) to fixed-point decimal . fixed-point decimal ______________________________ ( decimal / no exponential notation)
Image of page 1

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

Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (over) #3. Given void fubar( int a ) { static int b = 42; int *c = &a; ... } 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 c is pointing____________ If the function above is called 7 times, indicate how many times will b be initialized to 42? _________ #4. What gets printed with the function call mystery( 5 ); ? int mystery( int param ) { int local = 25; if ( local > param ) { local = local - param; printf( "%d\n", local ); /* Output the value of local followed by a newline */ param = mystery( param + 5 ) + local; printf( "%d\n", param ); /* Output the value of param followed by a newline */ } else { printf( "Stop\n" ); } return local; } Put answer here...
View Full Document

  • Winter '08
  • Ord
  • Call stack, precision IEEE floating-point

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern