Course Review for Final Exam
CS 301 Lecture, Dr. Lawlor
The Final Exam will be from
3:15-5:15 PM Wednesday, December 19, in the usual classroom (Chapman
106). It's scheduled for 2 hours, but I'm planning to make it
about as long as the midterm.
Stuff to know for the final:
- Bits!
- Binary numbers (101 = 4 + 1 = 5)
- Hexadecimal (0x2F = 2*16 + 15 = 47)
- Bit shifts, AND (&), OR (|), XOR (^)
- All of x86 assembly language
- What registers exist
- Which registers you can freely mess with (eax, ecx, edx), and
which you have to restore to their old value before you return (esp,
ebp, esi, edi, and sometimes ebx)
- How you load values into registers and do arithmetic to get work done (e.g., "add eax, 7")
- Converting loops and "if" statements into "if-goto" form and then assembly
- Allocating memory on the stack, the heap, inside the program executable
- Calling functions, passing parameters, receiving return values
- Using pointers from assembly to access arrays, structs, and classes
- Using the floating-point register stack, doing floating-point arithmetic
- Using "SSE" instructions from C/C++ via <xmmintrin.h>
- How to build an executable from a mix of C++, plain C, and assembly code:
- Use extern "C" from C++ (to avoid C++'s "name mangling")
- Use "global somefunc" from assembly
- Compile each language's code into object files using appropriate compiler
- Link everything together at end
- How to use "inline" assembly from C/C++ on Windows.
- Computing with performance in mind:
- Know when high performance is needed, and when it isn't
- Ways to make the code to *appear* to run faster (start it earlier, add a progress bar, run it at night)
- Approximate expected speed of various operations in code (addition, divide, function call, malloc, etc.)
- Ways to speed up the slow operations (such as divide)
- How to call timer functions and actually get a useful answer out
- Floating-point numbers
- Binary fractions (e.g., 1.101 = 1 and 1/2 and 1/8 = 1 and 5/8)
- Sign, magnitude, and mantissa representation
- Number of bits in each field and corresponding range limits for IEEE float
- Denormal numbers and performance impact
- Infinities and NaNs, special arithmetic rules (inf * 3 = inf)
- Roundoff: what, why, and how do I fix it?
- x86 "floating point register stack" and SSE
- Graphics card floats (and performance impact!)
- Memory performance
- Cache levels and sizes (L1: 16K, L2: 1MB)
- Performance of RAM (bad)
- How to improve the cache utilization of your code
- Cache replacement algorithms (direct mapped, associative with
LRU, random) and why you care (it can kill your code's performance!)
- How PowerPC and x86 assembly languages are similar, and different
- How PIC (embedded) and x86 assembly languages are similar, and different
- Differences in embedded systems (program usually fixed, no OS, etc)
- How graphics card assembly languages are similar and different
- How to call the OS directly from assembly (syscall, "int 0x80" on Linux)
- Purpose of dynamically linked libraries, and some of the power they give you
Also, read the lecture notes, check over your old homeworks, and read your midterm exam. Thanks a lot!