%% -*- Mode: LATEX -*-

\documentclass[11pt]{rhitcsse}

\input{cs232_defs}
\title{Lab 3 Questions}

\begin{document}

\maketitle

Answer the following questions as completely as possible and hand in
before leaving the lab.

\begin{enumerate}
  \item Using the procedure handout, how many times is \texttt{fact} called?
  \vspace*{0.25in}%
  \item Using the procedure handout, draw the state of the stack on
  the attached sheet when the instruction at address 0x0040008C is
  executed the first time.
  \vspace*{0.1in}%
  \item What would happen if the line at \texttt{L1} of \texttt{fact}
  was omitted.
  \vspace*{0.75in}%
  \item \texttt{main} in \texttt{fib.asm} uses \texttt{\$s0} to store
  $n$ and \texttt{\$t0} to store $\mathrm{fib}(n)$.  Why was a
  \textit{t} register chosen in one case and an \textit{s} register in
  the other?
  \vspace*{0.75in}%
  \item \texttt{fib} in \texttt{fib.asm} uses \textit{s} registers to
  store both $n$ and $\mathrm{fib}(n)$.  Could \textit{t}
  registers be used?  Which would you choose?
  \vspace*{1in}%
  \item While calculating $\mathrm{fib}(5)$, how many times is
  \texttt{fib} called?
  \vspace*{0.75in}%
  \item While calculating $\mathrm{fib}(10)$, draw the state of the
  stack on the attached sheet when the instruction \texttt{move \$s1,
    \$v0} is executed for the first time.
  \vspace*{0.1in}%
  \item Remove the line at \texttt{skip} and run the program.  What
  happened?
  \vspace*{0.75in}%
\end{enumerate}

\newpage
\begin{tabular}{r|l|r|l|}
  \cline{2-2} \cline{4-4}
  \hspace*{1.25in} & \hspace*{1.5in} & \hspace*{1.5in} & \hspace*{1.5in} \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
\end{tabular}

\newpage
\begin{tabular}{r|l|r|l|}
  \cline{2-2} \cline{4-4}
  \hspace*{1.25in} & \hspace*{1.5in} & \hspace*{1.5in} & \hspace*{1.5in} \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  & & & \\
  \cline{2-2} \cline{4-4}
\end{tabular}

\end{document}

% Local Variables:
% mode:latex
% End:
