cs313-2006-t2-midterm1

cs313-2006-t2-midterm1 - CPSC 313 06w Term 2 Midterm 1 Date...

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

View Full Document Right Arrow Icon
CPSC 313, 06w Term 2— Midterm 1 Date: February 9, 2007; Instructor: Norm Hutchinson This is a closed book exam; no notes; no calculators. Answer in the space provided; use the backs of pages if needed. There are 6 questions on 4 pages, totaling 42 marks. You have 50 minutes to complete the exam. On the last two pages you will find summaries of the x86 instructions and address modes. You may find it profitable to (carefully) remove these pages from the exam. You must write your name and student number on the exam and sign the exam in pen. You should write this exam in pen - I will not consider requests to regrade solutions that are written in pencil. NAME: STUDENT NUMBER: SIGNATURE: SCORE: / 42 1. (8 marks) Short answers. 1a. (2 marks) Is the address of a global variable in a C program determined statically (before the program runs) or dynamically (while the program is executing)? Briefly explain. 1b. (2 marks) Is the content of the jump table used in the execution of a switch statement determined statically or dynamically ? Briefly explain. 1c. (2 marks) Does the IA32 instruction-set architecture require that %eax be used to hold the value returned from a C function call? Briefly explain. 1d. (2 marks) If %ecx holds the address of an integer array a , and %edx holds the integer i , give a single assembly-language statement that computes &a[i] and places it in the register %eax .
Image of page 1

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

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

{[ 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