General Information
- Date: Thursday, April 20
- Time/Location: Your exam will take place in lecture.
- Duration: 75 minutes
- Closed-book, Closed-notebooks, No Computers/Calculators.
- Use a pencil/mechanical pencil (no pen) to answer the exam.
- Please take a look at the general exam rules available at
Exam Rules.
- Information about taking exams
Taking Exams.
- The best way to prepare for the exam is to practice old exams.
- We curve in this course. After you have taken the exam, do not discuss
anything associated with the exam with other students that have
not taken the exam.
- Posting any information in Piazza about the exam after taking it
is considered an academic integrity violation.
- Please bring a stapler if you tend to separate the pages of the exam.
Exam Structure
- Short answer questions: This includes for example, multiple
choice, true/false and fill-in-the-blank type questions.
- Code analysis questions: We will give a short segment of code and
you may be asked to identify syntax and logical errors, generate code
output, etc.
- Code Writing: Write a program/code snippets to solve a given
problem. You should be prepared to give a complete program, but we may also
ask you to provide just a single function or a code fragment.
Topics
The exam will include all the material covered in discussion session (lab),
lecture, quizzes, and projects including the following topics:
- Unix - You must be familiar with the following commands
- cp
- ls
- echo
- rmdir
- rm -r
- How to create a compressed gzip archive file
- How to uncompress a tar.gz file
- How to use grep to find patterns in a file
- How to pipe the output of one program to another (e.g., ls | wc)
- pushd
- popd
- C Language
- Preprocessor directives (e.g., #include, #define, #ifdef)
- Expressions
- Bitwise Operators
- Conditional statements
- Loops
- Arrays (one and two dimensional arrays)
- Strings - You are responsible for the following string functions:
- strlen
- strcpy
- strcmp
- memcpy
- memmove
- Pointers (including function pointers)
- enum
- Structures
- Unions
- Functions
- stdin, stderr, stdout
- Linkage
- Command line arguments
- exit
- err
- perror
- Dynamic Memory Allocation (malloc, realloc, free, etc.)
- Reading and writing from files. The following cheat sheet will be
provided in the exam Standard IO Cheat Sheet
- Memory maps - Please use the style provided in the following
example MemoryMapExample.pdf. Previous
exam solutions consider as correct using a pointer to the first array element in order
to describe an array; that is not correct. See the diagram we have provided.
- Linked Lists (both singly and doubly linked lists)
- Recursion
- Makefiles - You need to know how to define makefiles without using
implicit rules
- Big Endian vs. Little Endian
- Optimization (as described by the lecture slides - Optimization.pdf)
- Assembly
- irmovl, rrmovl, mrmovl, rmmovl
- addl, subl, multl, divl, modl
- jmp, jle, jl, je, jne, jge, jg
- pushl, popl, call, ret
- halt, .pos, .align, .long
- All registers
- rdch, rdint, wrch, wrint
- Any directives necessary to set a frame
- You do not need to follow caller save nor callee save usage conventions
- The following cheat sheet will be provided in the exam
Assembly Cheat Sheet
The exam will NOT cover the following topics:
- emacs, debugger (gdb), valgrind, splint, process control (fork, exec, dup2, pipes, etc.),
signals, Unix I/O
Practice Material
Practice material can be found in the grace system under 216public/exams/exam2. Keep
in mind that previously posted exams (those posted for Midterm #1) may include problems that cover material
associated with this exam.
To transfer this material to your computer use https://dav.terpconnect.umd.edu
. Use your directory id/passwd (same one used for grace) to log on.
Web Accessibility