Quiz2.wi09

Quiz2.wi09 - Assume you correctly set this breakpoint and...

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

View Full Document Right Arrow Icon
Signature _______________________ Name_________________ cs30x____ Student ID ______________________ Score: Quiz 2 CSE 30 Winter 2009 #1. a) Write the SPARC assembly instructions to define the following global variables in the data/bss segment: char Death_Cab[] = "April 29"; short stack; #2. What is the value ( in hex ) of %o1 after each set of instructions: a) set 0xDEADBEEF, %o1 sra %o1, 16, %o1 Value in %o1 at this point is 0x ______________________________________________ b) set 0xDEADBEEF, %o1 set 0x4D3C2B1A, %o2 xor %o1, %o2, %o1 Value in %o1 at this point is 0x ______________________________________________ c) set 0xDEADBEEF, %o1 set 0x4D3C2B1A, %o2 and %o1, %o2, %o1 Value in %o1 at this point is 0x ______________________________________________ #3. Assume you run gdb on pa1. State how to set a breakpoint at the entry point in displayX():
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Assume you correctly set this breakpoint and performed a run with correct command line arguments. State how to print the value of the 2 nd argument passed to displayX() in gdb: (over) #4. Write the equivalent unoptimized SPARC assembly language instructions to perform the following C code fragment. Use the loop construct specified in class/Notes. C SPARC assembly /* x is mapped to %l2 */ /* a is mapped to %l4 */ for ( a = 9803; a > 181; --a ) { x = a - 345; } #5a. Write the equivalent unoptimized SPARC assembly language instructions to perform the following C code fragment. C SPARC assembly x = x % 7007; /* x is mapped to %l0 */ 5b. Now optimize your answer from #5a to eliminate any delay slots : Optimized version of above SPARC assembly...
View Full Document

This note was uploaded on 08/31/2011 for the course CSE 30 taught by Professor Ord during the Fall '08 term at UCSD.

Page1 / 2

Quiz2.wi09 - Assume you correctly set this breakpoint and...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online