Final Exam

Friday, May 10, 9:00 AM–12:00 NOON

You will have three hours to complete the exam. It will be given in-person on-paper live in McCosh Hall 10. Students who have testing accommodations should coordinate with course administrator Sue Giranda (sgiranda@princeton.edu).


Rules

This will be a closed-book, closed-note exam, with the exception that a single two-sided study sheet will be allowed. The exam will emphasize application of concepts and not memorization, so you will be provided with information such as manual pages, C operator precedence tables, etc. if they are necessary. No electronic devices will be permitted to be used during the exam. No communication with any person will be permitted, with the exception of the instructors who will be available for clarifying questions outside the exam rooms. Some students may be taking this exam at a different time, so use discretion in discussing the contents of the exam with anyone until the sample solution has been posted.

The Princeton University Honor Code covers this exam. You will be required to write out in full and sign an honor code pledge that you have abided by these exam rules and restrictions. Any suspected violations must be reported to honor@princeton.edu


Topics

You will be responsible for material from the entire course, including the content of required readings, lectures, precepts, and assignments. All questions will assume the ArmLab/Linux/C90/gcc217 environment unless otherwise stated. The second half of the course (since the midterm) will be emphasized, but the exam is cumulative.

Major topics include (topics since the midterm are in bold):

  1. Number Systems
  2. C Programming
  3. Under the hood / Language levels
    • High-level languages vs assembly language vs machine language
    • Von Neumann computer architecture, RAM, CPU, ALU, registers
    • Storage hierarchy, caching, and locality
    • Virtual vs Physical memory
    • Little-endian vs big-endian byte order
    • AARCH64 architecture: general-purpose and special registers
    • Flattened C as an intermediate stage between C and assembly language
    • AARCH64 assembly language: directives, labels, load/store/manipulation instructions, control flow
    • Accessing variables in rodata, data, bss, and stack sections
    • Accessing array and struct variables; addressing modes
    • AARCH64 function call conventions: bl and ret instructions, the x30 register, arguments, return values
    • AARCH64 local variables: on stack vs in callee-saved registers
    • AARCH64 machine language: instruction formats, layout after assembly, layout after linking
  4. Programming techniques and tools

Questions from Previous Semesters

A good way to practice for the exam is to go over questions from previous COS 217 final exams. Be aware that both the content of the course and the format of the final do change over the years, so not all questions are guaranteed to be 100% relevant, or good practice for this year. If, after checking the exclusions list below, you have any questions about whether the content of a question would be fair game for this year, please ask on Ed.


Review and Q&A

There will be a review and Q&A session on Wednesday, May 8 starting at 2:00 PM, in CS 104.


Watch this space and Ed for any additional announcements.