\documentclass[twocolumn]{article}

\setlength{\oddsidemargin}{-0.5in}
\setlength{\evensidemargin}{-0.5in}
\setlength{\topmargin}{0.0in}
\setlength{\headheight}{0in}
\setlength{\headsep}{0in}
\setlength{\textwidth}{7.0in}
\setlength{\textheight}{9.5in}
\setlength{\parindent}{0in}
\setlength{\parskip}{0.05in}
\setlength{\columnseprule}{0.3pt}

\setlength\columnsep{25pt}

\usepackage{fancyvrb}
\usepackage{relsize}
\usepackage{hyperref}

\usepackage{listings}
\usepackage{amsmath}

\begin{document}

\lstset{xleftmargin=5mm,framexleftmargin=10mm,basicstyle=\footnotesize}

Name: \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_

Directions: {\bf \Large Work only on this sheet} (on both sides, if
needed).  MAKE SURE TO COPY YOUR ANSWERS TO A SEPARATE SHEET FOR SENDING
ME AN ELECTRONIC COPY LATER.

{\bf On all Tests, 32-bit word size on Intel machines running Linux is
assumed unless otherwise stated.}

{\bf 1.} (25) When an interrupt occurs, there will be a slight delay
before the currently-running program is suspended, because the circuitry
does not check for interrupts until after Step
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_.

{\bf 2.} (25) During bootup, the OS places the addresses of the device
drivers into an entity known as the
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_, and points 
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ to that entity.

{\bf 3.} (25) Consider the keyboard device driver, pp.168-169.  Suppose we
wish to determine whether this is a key press or a key release.  Show
the instruction we'd put at {\bf done} to start determining this.  (NOT
a MOV instruction.)

{\bf 4.} (25) Consider the primes counter, pp.201-203.  Most of the values
of {\bf work} printed out will be 0 if
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_ is 
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_.  (Place a program variable in
the first blank, and either ``large'' or ``small'' in the second.  Just
give answers that work, not all possible answers.)

{\bf Solutions:}

{\bf 1.}  C

{\bf 2.}  interrupt vector table; IDT

{\bf 3.}

\begin{lstlisting}
cmpb $128, %cl
\end{lstlisting}

{\bf 4.}  n is small (or nthreads is large)

\end{document}

