Просмотр исходного кода

moved discussion of adding function name to start/conclusion labels

Jeremy Siek 3 лет назад
Родитель
Сommit
e30abf2459
2 измененных файлов с 10 добавлено и 13 удалено
  1. 10 12
      book.tex
  2. 0 1
      defs.tex

+ 10 - 12
book.tex

@@ -14717,7 +14717,7 @@ start:
 $\Rightarrow$
 $\Rightarrow$
 \begin{minipage}{0.3\textwidth}
 \begin{minipage}{0.3\textwidth}
 \begin{lstlisting}
 \begin{lstlisting}
-start:
+|$f$|start:
   movq %rdi, |$x_1$|
   movq %rdi, |$x_1$|
   movq %rsi, |$x_2$|
   movq %rsi, |$x_2$|
   |$\cdots$|
   |$\cdots$|
@@ -14727,6 +14727,15 @@ start:
 \end{lstlisting}
 \end{lstlisting}
 \end{minipage}
 \end{minipage}
 \end{center}
 \end{center}
+Recall that we use the label \code{start} for the initial block of a
+program, and in Section~\ref{sec:select-Lvar} we recommend labeling
+the conclusion of the program with \code{conclusion}, so that
+$\RETURN{Arg}$ can be compiled to an assignment to \code{rax} followed
+by a jump to \code{conclusion}. With the addition of function
+definitions, there is a start block and conclusion for each function,
+but their labels need to be unique. We recommend prepending the
+function's name to \code{start} and \code{conclusion}, respectively,
+to obtain unique labels.
 
 
 \racket{The interpreter for \LangXIndCall{} needs to know how many
 \racket{The interpreter for \LangXIndCall{} needs to know how many
   parameters the function expects, but the parameters are no longer in
   parameters the function expects, but the parameters are no longer in
@@ -14783,17 +14792,6 @@ means ``pop the frame and then do an indirect jump'', which we name
 argument that specifies where to jump and an integer that represents
 argument that specifies where to jump and an integer that represents
 the arity of the function being called.
 the arity of the function being called.
 
 
-Recall that we use the label \code{start} for the initial block of a
-program, and in Section~\ref{sec:select-Lvar} we recommend labeling
-the conclusion of the program with \code{conclusion}, so that
-$\RETURN{Arg}$ can be compiled to an assignment to \code{rax} followed
-by a jump to \code{conclusion}. With the addition of function
-definitions, there is a start block and conclusion for each function,
-but their labels need to be unique. We recommend prepending the
-function's name to \code{start} and \code{conclusion}, respectively,
-to obtain unique labels.
-
-
 \section{Register Allocation}
 \section{Register Allocation}
 \label{sec:register-allocation-r4}
 \label{sec:register-allocation-r4}
 
 

+ 0 - 1
defs.tex

@@ -302,7 +302,6 @@
 \newcommand{\CSUB}[2]{\LP\key{-}~#1~#2\RP}
 \newcommand{\CSUB}[2]{\LP\key{-}~#1~#2\RP}
 \newcommand{\CWHILE}[2]{\LP\key{while}~#1~#2\RP}
 \newcommand{\CWHILE}[2]{\LP\key{while}~#1~#2\RP}
 \newcommand{\WHILE}[2]{\LP\key{WhileLoop}~#1~#2\RP}
 \newcommand{\WHILE}[2]{\LP\key{WhileLoop}~#1~#2\RP}
-\newcommand{\MAKEVEC}[2]{\LP\key{make-vector}~#1~#2\RP}
 \newcommand{\CMAKEVEC}[2]{\LP\key{make-vector}~#1~#2\RP}
 \newcommand{\CMAKEVEC}[2]{\LP\key{make-vector}~#1~#2\RP}
 \newcommand{\MAKEVEC}[2]{\LP\key{make-vector}~#1~#2\RP}
 \newcommand{\MAKEVEC}[2]{\LP\key{make-vector}~#1~#2\RP}
 \newcommand{\CSETBANG}[2]{\LP\key{set!}~#1~#2\RP}
 \newcommand{\CSETBANG}[2]{\LP\key{set!}~#1~#2\RP}