{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

midterm

# midterm - CS 220 Computer Systems II Architecture and...

This preview shows pages 1–3. Sign up to view the full content.

CS 220: Computer Systems II: Architecture and Programming Fall 2009 - Section A0 Midterm Exam - 2009/10/28 Name: ______________________________ ================================================================================ 1: Circle which of the flags (it can be any number of them) listed under each set of numbers will be set (to 1) after each pair of numbers is computed using 16-bit addition/subtraction (the flags names are short for "Overflow" (OF), "Carry" (CF), "Sign" (SF) and "Zero" (ZF)): 0x4000 0x0000 0xC000 0xC000 0x8008 + 0x4000 - 0x0001 - 0x8000 + 0xC000 - 0x8008 -------- -------- -------- -------- -------- OF CF OF CF OF CF OF CF OF CF SF ZF SF ZF SF ZF SF ZF SF ZF ================================================================================ 2: Circle which one (1) of the following would be the value of %ch if the following code is executed (assume var1 is defined as ".int" elsewhere): ========================= movl \$0x1234567, %eax movl %eax, var1 movw var1, %cx ========================= a) 0x12 b) 0x34 c) 0x56 d) 0x07 e) 0x01 f) 0x23 g) 0x45 h) 0x67 i) 0x21 j) 0x43 k) 0x65 l) 0x70 m) 0x10 n) 0x32 o) 0x54 p) 0x76 ================================================================================ 3: Convert each of the following 8-bit signed numbers to decimal: 0xF8 0x40 0x66 0x80 0xC0 ================================================================================ 4: Circle which one (1) of the following is the register which GCC uses to point to the stack (the Stack Pointer): a) eax b) ebx c) ecx d) edx

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

View Full Document
e) ebp f) esp g) edi h) esi ================================================================================ 5: Circle which flags (it can be any number of them) listed under each
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern