CMPT 295 Lecture Notes

  1. Course Introduction [“Course Introduction” slides]
    1. This Course [This Course slides]
    2. Grading [Grading slides]
    3. Lectures and Labs [Lectures and Labs slides]
    4. Mini-Project [Mini-Project slides]
    5. Quizzes/Exams [Quizzes/Exams slides]
    6. References [References slides]
    7. Assumptions [Assumptions slides]
    8. Expectations [Expectations slides]
    9. Computer Systems [Computer Systems slides]
    10. Hardware [Hardware slides]
    11. Topics (1) [Topics (1) slides]
  2. Revisiting C [“Revisiting C” slides]
    1. Command Line C [Command Line C slides]
    2. The Heap [The Heap slides]
    3. Multi-file C [Multi-file C slides]
    4. Compiling C [Compiling C slides]
    5. Aside: Integers in C [Aside: Integers in C slides]
  3. Assembly Introduction [“Assembly Introduction” slides]
    1. Our First Assembly [Our First Assembly slides]
    2. Calling Convention [Calling Convention slides]
    3. The Registers [The Registers slides]
    4. Another Example [Another Example slides]
  4. The Processor [“The Processor” slides]
    1. Digital Circuits [Digital Circuits slides]
    2. The Processor [The Processor slides]
    3. Instructions [Instructions slides]
    4. Memory [Memory slides]
    5. Instruction Cycle [Instruction Cycle slides]
    6. Reality [Reality slides]
    7. The Point [The Point slides]
  5. More Assembly [“More Assembly” slides]
    1. Revisiting Commands [Revisiting Commands slides]
    2. Control Flow [Control Flow slides]
    3. Control Example: max [Control Example: max slides]
    4. Conditional Jumps [Conditional Jumps slides]
    5. Control Structures [Control Structures slides]
    6. Status Flags [Status Flags slides]
    7. Aside: Stacks [Aside: Stacks slides]
    8. The Stack [The Stack slides]
    9. Preserving on the Stack [Preserving on the Stack slides]
    10. Local Stack Variables [Local Stack Variables slides]
    11. Recursion [Recursion slides]
    12. Operand Size [Operand Size slides]
  6. Binary Representations [“Binary Representations” slides]
    1. Counting [Counting slides]
    2. Binary Integers [Binary Integers slides]
    3. Binary Arithmetic [Binary Arithmetic slides]
    4. Signed Integers [Signed Integers slides]
    5. Two's Complement [Two's Complement slides]
    6. Adding Two's Complement [Adding Two's Complement slides]
    7. Other Operations [Other Operations slides]
    8. Limits and Overflow [Limits and Overflow slides]
    9. Languages & Limits [Languages & Limits slides]
    10. Hexadecimal [Hexadecimal slides]
    11. Other Data in Binary [Other Data in Binary slides]
    12. Characters [Characters slides]
    13. UTF-8 [UTF-8 slides]
    14. Text [Text slides]
    15. Strings [Strings slides]
    16. Unicode is Complex [Unicode is Complex slides]
  7. Bit Tricks [“Bit Tricks” slides]
    1. Bit Fields [Bit Fields slides]
    2. Testing Bits in Assembly [Testing Bits in Assembly slides]
    3. Multiplying and Dividing [Multiplying and Dividing slides]
    4. Example: count set bits [Example: count set bits slides]
  8. Assembly: Using Memory [“Assembly: Using Memory” slides]
    1. Memory [Memory slides]
    2. Pointers [Pointers slides]
    3. Assembly Code Segments [Assembly Code Segments slides]
    4. Arrays and Memory [Arrays and Memory slides]
    5. Addressing Modes [Addressing Modes slides]
    6. Relative Addressing [Relative Addressing slides]
    7. Local Stack Array [Local Stack Array slides]
    8. Assembly Syntax [Assembly Syntax slides]
  9. Memory & Storage [“Memory & Storage” slides]
    1. Memory [Memory slides]
    2. Cache [Cache slides]
    3. Latency & Bandwidth [Latency & Bandwidth slides]
    4. Memory Hierarchy [Memory Hierarchy slides]
    5. Memory Locality [Memory Locality slides]
    6. Storage [Storage slides]
    7. Network Storage [Network Storage slides]
    8. Virtual Memory [Virtual Memory slides]
    9. Swap [Swap slides]
    10. Disk Cache [Disk Cache slides]
    11. Memory Hierarchy [Memory Hierarchy slides]
  10. Processor Tricks [“Processor Tricks” slides]
    1. The Pipeline [The Pipeline slides]
    2. Data Hazards [Data Hazards slides]
    3. Branch Hazards [Branch Hazards slides]
    4. Branch Predictor [Branch Predictor slides]
    5. Avoiding Branches [Avoiding Branches slides]
    6. Conditional Moves [Conditional Moves slides]
    7. Superscalar Processors [Superscalar Processors slides]
    8. SMT [SMT slides]
    9. Heterogeneous Cores [Heterogeneous Cores slides]
    10. Summary [Summary slides]
  11. Tools [“Tools” slides]
    1. GDB [GDB slides]
    2. Measuring Time [Measuring Time slides]
    3. Timing Commands [Timing Commands slides]
    4. Perf [Perf slides]
    5. Valgrind [Valgrind slides]
    6. Profiling [Profiling slides]
    7. Oops [Oops slides]
    8. Summary [Summary slides]
  12. Floating Point [“Floating Point” slides]
    1. x86 Floating Point [x86 Floating Point slides]
    2. Calling Convention [Calling Convention slides]
    3. FP Instructions [FP Instructions slides]
    4. Fractions in Binary [Fractions in Binary slides]
    5. Representing Fractions [Representing Fractions slides]
    6. IEEE Floating Point [IEEE Floating Point slides]
    7. Representing Values [Representing Values slides]
    8. Sizes of FP [Sizes of FP slides]
    9. Representable Values [Representable Values slides]
    10. Limits of FP [Limits of FP slides]
    11. Compilers and FP [Compilers and FP slides]
  13. Data Parallelism [“Data Parallelism” slides]
    1. SIMD [SIMD slides]
    2. SIMD Instructions [SIMD Instructions slides]
    3. SIMD Performance [SIMD Performance slides]
    4. Vectorclass Library [Vectorclass Library slides]
    5. Summary [Summary slides]
  14. Returning to C [“Returning to C” slides]
    1. C and Assembly [C and Assembly slides]
    2. Compiler Explorer [Compiler Explorer slides]
    3. Getting Good Assembly [Getting Good Assembly slides]
    4. The Optimizer [The Optimizer slides]
    5. Auto Vectorization [Auto Vectorization slides]
    6. Unsafe Math [Unsafe Math slides]
    7. Crazy Compilations [Crazy Compilations slides]
    8. Back to Reality [Back to Reality slides]
  15. Threads [“Threads” slides]
    1. Threads & Processes [Threads & Processes slides]
    2. Threads [Threads slides]
    3. Threads in C++ [Threads in C++ slides]
  16. Leftovers [“Leftovers” slides]
    1. Endianness [Endianness slides]
    2. Alignment [Alignment slides]
    3. Padding [Padding slides]
    4. System Calls [System Calls slides]
    5. Tail Calls [Tail Calls slides]
  17. Conclusion [“Conclusion” slides]
    1. Not Covered [Not Covered slides]
    2. Other Languages [Other Languages slides]
    3. Rust [Rust slides]
    4. Other Processors [Other Processors slides]
    5. Conclusion [Conclusion slides]

Course home page. x86-64 Cheat Sheet. Table of Tables.

Schedule

Week Deliverables (*) Lecture Hour Lecture Date First Slide
1 1 May 6
2 May 8
3 May 10
2 Lab 1 4 May 13
5 May 15
6 May 17
3 Lab 2 7 May 20
8 May 22
9 May 24
4 Lab 3 10 May 27
11 May 29
12 May 31
5 Lab 4 13 Jun 3
14 Jun 5
15 Jun 7
6 Lab 5, Quiz 1 16 Jun 10
17 Jun 12
18 Jun 14
7 Lab 6 19 Jun 17
20 Jun 19
21 Jun 21
8 Lab 7 22 Jun 24
23 Jun 26
24 Jun 28
9 Lab 8 25 Jul 1
26 Jul 3
27 Jul 5
10 Lab 9, Quiz 2 28 Jul 8
29 Jul 10
30 Jul 12
11 Lab 10 31 Jul 15
32 Jul 17
33 Jul 19
12 Lab 11 34 Jul 22
35 Jul 24
36 Jul 26
13 Lab 12, Mini-Project 37 Jul 29
38 Jul 31
39 Aug 2
14+ Final Exam

* Check CourSys for the actual due dates and times.

Quiz instruction slide