Final.fa07

SPARC Architecture, Assembly Language Programming, and C (2nd Edition)

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

View Full Document Right Arrow Icon

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

View Full DocumentRight Arrow Icon

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

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

Unformatted text preview: 1 Login: cs30x_______ Name _________________________ Student ID ____________________ Signature_______________________ CSE 30 Fall 2007 Final Exam 1. Number Systems ___________________ (25 points) 2. Binary Addition/Condition Code Bits/Overflow Detection ___________________ (12 points) 3. Branching ___________________ (19 points) 4. Bit Operations ___________________ (13 points) 5. Recursion/SPARC Assembly ___________________ (10 points) 6. Local Variables, The Stack, Return Values ___________________ (20 points) 7. More Recursive Subroutines ___________________ (12 points) 8. Floating Point ___________________ (12 points) 9. Machine Instructions ___________________ (20 points) 10. Linkage, Scope, Lifetime, Data ___________________ (32 points) 11. Load/Store/Memory ___________________ (9 points) 12. Miscellaneous ___________________ (29 points) SubTotal ___________________ (213 points) Extra Credit ___________________ (10 points) Total ___________________ 2 1. Number Systems Convert FB4B 16 (2s complement, 16-bit word) to the following. (6 points) binary _____________________________________ (straight base conversion) octal _______________________________________ (straight base conversion) decimal ____________________________________ (convert to signed decimal) Convert 432 10 to the following (assume 16-bit word). Express answers in hexadecimal. (3 points) sign-magnitude _______________________________________________ 1s complement _______________________________________________ 2s complement _______________________________________________ Convert -389 10 to the following (assume 16-bit word). Express answers in hexadecimal. (6 points) sign-magnitude _______________________________________________ 1s complement _______________________________________________ 2s complement _______________________________________________ C Compiling Sequence Put the following in the correct order/sequence using the numbers to the left of each word: (10 points) A. executable (.exe/a.out) B. assembler C. resulting .o file D. loader E. program execution F. resulting .s file G. compiler H. preprocessor I. source code (.c file) J. linkage editor _____ > _____ > _____ > _____ > _____ > _____ > _____ > _____ > _____ > _____ 3 2. Binary Addition/Condition Code Bits/Overflow Detection Indicate what the condition code bits are when adding the following 8-bit 2s complement numbers. (12 points) 00101101 00110111 11101001 +11010100 +01001001 +10010111 --------- --------- --------- N Z V C N Z V C N Z V C----------------- ----------------- ----------------- | | | | | | | | | | | | | | | ----------------- ----------------- ----------------- 3. Branching Given the following C code write the equivalent function in unoptimized SPARC Assembly. Just perform a direct translation using the proper if-else structure discussed in class/notes (think opposite logic). (19 points) C SPARC Assembly int .global checkIfEvenAndPositive checkIfEvenAndPositive( int value )...
View Full Document

This homework help was uploaded on 02/11/2008 for the course CSE 30 taught by Professor Ord during the Winter '08 term at UCSD.

Page1 / 15

Final.fa07 - 1 Login: cs30x_______ Name...

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

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