Browse Source

Fix error in assign homes sec: code/prose discrepancy

Ryan Newton 7 years ago
parent
commit
0693d4d627
1 changed files with 10 additions and 10 deletions
  1. 10 10
      book.tex

+ 10 - 10
book.tex

@@ -1144,11 +1144,11 @@ main:
 %%   It can get confusing to differentiate them from the main text.}
 %% It looks pretty ugly in italics.-Jeremy
 
-Unfortunately, x86 varies in a couple ways depending on what
-operating system it is assembled in. The code examples shown here are
-correct on the Unix platform, but when assembled on Mac OS X, labels
-like \key{main} must be prefixed with an underscore.  So the correct
-output for the above program on Mac would begin with:
+Unfortunately, x86 varies in a couple ways depending on what operating system it
+is assembled in. The code examples shown here are correct on Linux and most
+Unix-like platforms, but when assembled on Mac OS X, labels like \key{main} must
+be prefixed with an underscore.  So the correct output for the above program on
+Mac would begin with:
 \begin{lstlisting}
 	.globl _main
 _main:
@@ -1827,11 +1827,11 @@ The variable \code{tmp.1} is assigned to stack location
 \code{-8(\%rbp)}, and \code{tmp.2} is assign to \code{-16(\%rbp)}, so
 the \code{assign-homes} pass translates the above to
 \begin{lstlisting}
-   (movq (int 10) (deref rbp -16))
-   (negq (deref rbp -16))
-   (movq (deref rbp -16) (deref rbp -8))
-   (addq (int 52) (deref rbp -8))
-   (movq (deref rbp -8) (reg rax)))
+   (movq (int 10) (deref rbp -8))
+   (negq (deref rbp -8))
+   (movq (deref rbp -8) (deref rbp -16))
+   (addq (int 52) (deref rbp -16))
+   (movq (deref rbp -16) (reg rax)))
 \end{lstlisting}
 
 In the process of assigning stack locations to variables, it is