

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#1. a) Write the SPARC assembly instructions to define the following global variables in the data segment: char BadReligion[] = "LA Is Burning"; double radio = 94.9;
#2. What is the value ( in hex ) of %o1 after each set of instructions:
a) set 0xFEEDBABE, %o sra %o1, 8, %o
Value in %o1 at this point is 0x ______________________________________________
c) set 0xFEEDBABE, %o set 0xC3C3C3C3, %o and %o1, %o2, %o
Value in %o1 at this point is 0x ______________________________________________
c) set 0xFEEDBABE, %o set 0xC3C3C3C3, %o xor %o1, %o2, %o
Value in %o1 at this point is 0x ______________________________________________
#3. List two instructions that are not eligible to be used to fill a delay slot in the SPARC architecture.
(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 for ( i = 9021; i >= 17; --i ) { /* i is mapped to %l2 / x = i + 420; / x is mapped to %l4 */ }
#5. Write the equivalent unoptimized SPARC assembly language instructions to perform the following C code fragment.
C SPARC assembly x = x / 5555; /* x is mapped to %l4 */
Now optimize your answer to eliminate any delay slots: Optimized version of above SPARC assembly