PHYS 135a Quiz: PHYS 135 USC SampleQuiz2

71 views15 pages
31 Jan 2019
School
Department
Course
Professor

Document Summary

Letters go in the boxes unless otherwise specified (e. g. , for c 8 write c not 8 ). Write letters clearly: if we are unsure of what you wrote you will get a zero on that problem. Bubble and pledge the exam or you will lose points. Assume unless otherwise specified: little-endian 64-bit architecture, %rsp points to the most recently pushed value, not to the next unused stack address, questions are single-selection unless identified as select-all. Variable weight: point values per question are marked in square brackets. Mark clarifications: if you need to clarify an answer, do so, and also add a * to the top right corner of your answer box. Question 1 [2 pt]: given a long *x stored in register %r8 and long y stored in register %r9, the c expression x[y+1] += y is equivalent to. E leaq 1(%r8,%r9,8), %r9 leaq 8(%r8,%r9,1), %rax addq %r9, (%rax) A an instruction at an address specified in the exception table.