This page does not represent the most current semester of this course; it is present merely as an archive.
Semester Exam Practice Actual Key
Fall 2018 1 pdf pdf html
Fall 2018 2 pdf pdf html
Fall 2018 3 pdf pdf html

The final exam will be about half material from exams 1 and 2 and about half new material. The practice exam only contains examples of the new material.

The final will include printed-out excerpts from manual pages. These might include pages for functions you have not previously used. It may also contain reference material on various assembly instructions, etc.

Some material from previous exams has “timed out;” for example, if we ask about our toy ISA on the final we’ll provide a reminder of its relevant details as we hope you’ve re-used the memory that used to remember where the icode goes in the encoding, etc.

You are expected to know, without consulting any source,

Assembly
  1. AT&T syntax, including all addressing modes ($1, %rax, and the various memory accesses like (%rax) through foo(%rax, %rbx, 8))

  2. The special use of %rsp as the stack pointer

  3. The calling convention use of %rax, %rdi, and %rsi – if others are needed, they will be provided on the exam

  4. The 2-, 4-, and 8-byte versions of each instruction (e.g., movw, movl, and movq) and the first eight registers (e.g., %ax, %eax, %rax)

  5. x86-64 assembly instructions mov, add, xor, call, ret, lea, cmp, jmp, and the signed conditional jumps (jle and so on)

C
  1. The meaning of all operators, including | vs ||, . vs ->, ?:, etc.

    • but you do not need to know the difference between prefix- and postfix-notation for ++ and --
    • nor do you need to know the precedence of non-arithmetic operators
      • but if you don’t know precedence, you had better use parentheses!
  2. The correct signature for main (both with and without arguments)

  3. The behavior of library functions malloc, free, realloc, open, close

  4. The library function read, but just its common usage, not all the special cases

  5. The library functions puts, printf, fopen, fclose, and at least one reads-from-FILE * function

You are of course also expected to recall all the syntax and semantics details needed to read and write code in both AT&T x86-64 and C.