

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 *s = "Big One"; long l = 420; double d = 7.891;
#2. What is the value ( in hex ) of %o1 after each set of instructions:
a) set 0xC99CD7D3, %o sll %o1, 16, %o
Value in %o1 at this point is 0x ______________________________________________
b) set 0xC99CD7D3, %o sra %o1, 8, %o
Value in %o1 at this point is 0x ______________________________________________
c) set 0xC99CD7D3, %o set 0x96329632, %o or %o1, %o2, %o
Value in %o1 at this point is 0x ______________________________________________
d) set 0xC99CD7D3, %o set 0x96329632, %o btog %o2, %o
Value in %o1 at this point is 0x ______________________________________________ (over)
#3. Write the equivalent unoptimized SPARC assembly language instructions to perform the following C code fragment.
C SPARC assembly x = 5882; /* x is mapped to %l3 / do { --x; a = x % 55; / a is mapped to %l5 */ } while ( a >= 42 );
Now optimize your answer to eliminate any delay slots:
Optimized version of above SPARC assembly