|
@@ -1633,10 +1633,11 @@ functionality in this file as the \emph{runtime system}, or simply
|
|
|
\emph{runtime} for short. When compiling your generated x86-64
|
|
|
assembly code, you will need to compile \code{runtime.c} and link it
|
|
|
in. For our purposes of code generation, all you need to do is
|
|
|
-translate an assignment of \key{read} to some left-hand side
|
|
|
-$\itm{lhs}$ into call to the \code{read\_int} function followed by a
|
|
|
-move from \code{rax} into $\itm{lhs}$. (Recall that the return value
|
|
|
-of a function is typically placed in the \code{rax} register.) \\
|
|
|
+translate an assignment of \key{read} to some variable $\itm{lhs}$
|
|
|
+(for left-hand side) into call to the \code{read\_int} function
|
|
|
+followed by a move from \code{rax} into the left-hand side. Also,
|
|
|
+recall that the return value of a function is typically placed in the
|
|
|
+\code{rax} register. \\
|
|
|
\begin{tabular}{lll}
|
|
|
\begin{minipage}{0.4\textwidth}
|
|
|
\begin{lstlisting}
|
|
@@ -1649,7 +1650,7 @@ $\Rightarrow$
|
|
|
\begin{minipage}{0.4\textwidth}
|
|
|
\begin{lstlisting}
|
|
|
(callq read_int)
|
|
|
-(movq (reg rax) |$\itm{lhs}$|)
|
|
|
+(movq (reg rax) (var |$\itm{lhs}$|))
|
|
|
\end{lstlisting}
|
|
|
\end{minipage}
|
|
|
\end{tabular} \\
|
|
@@ -1966,7 +1967,7 @@ $L_{\mathtt{after}}$ set to make the figure easy to read.
|
|
|
|$\{ w, x, y \}$|
|
|
|
|$\{ w, y, z \}$|
|
|
|
|$\{ y, z \}$|
|
|
|
-|$\{ y \}$|
|
|
|
+|$\{ y, \key{rax} \}$|
|
|
|
|$\{\}$|
|
|
|
\end{lstlisting}
|
|
|
\end{minipage}
|