{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

cs313-2005-t1-midterm1

# cs313-2005-t1-midterm1 - CPSC 313 05w Term 1 Midterm 1 Date...

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

CPSC 313, 05w Term 1— Midterm 1 Date: October 7, 2005; Instructor: Mike Feeley This is a closed book exam; no notes; you may use calculators to perform simple arithmetic calculations. Answer in the space provided; use the backs of pages if needed. There are 7 questions on 4 pages, totaling 50 marks. You have 50 minutes to complete the exam. NAME: STUDENT NUMBER: SCORE: / 50 1. (10 marks) Short answers. 1a. What is the advantage of using two different registers (i.e., %ebp and %esp ) to store virtual addresses to the runtime stack? 1b. What does a call instruction do that a jmp instruction does not? 1c. We discussed two ways to implement a C-language switch statement in assembly language. What are they? Under what conditions would one be favoured over the other (both ways)? 1d. Why is it faster to compute the address of an element of an array of structs if the size of each struct is a power of two? 1e. Write the two assembly-language instructions that compute “ if (a<=b) goto X ” where a and b are signed integers stored in registers %eax and %ebx respectively and X is a label.

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.

{[ snackBarMessage ]}

### Page1 / 4

cs313-2005-t1-midterm1 - CPSC 313 05w Term 1 Midterm 1 Date...

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

View Full Document
Ask a homework question - tutors are online