From 4a6538d24abb69d278ee669dddb87affb16ae4a7 Mon Sep 17 00:00:00 2001 From: Abhinav Upadhyay Date: Sat, 28 Sep 2024 14:21:28 +0530 Subject: [PATCH] First argument to a function call should be placed in %rdi There was a typo in the example shown in the assign homes pass. The generated assembly should put the argument for print_int into %rdi instead of %rax, before the callq instruction. The assembly shown for the Python version in the patch instructions pass looks correct, but the racket version still had the typo. --- book.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/book.tex b/book.tex index 8cb66ef..987d6fc 100644 --- a/book.tex +++ b/book.tex @@ -3965,14 +3965,14 @@ \section{Assign Homes} \begin{lstlisting}[basicstyle=\ttfamily\footnotesize] movq $42, a movq a, b -movq b, %rax +movq b, %rdi \end{lstlisting} \compilesto %stack-space: 16 \begin{lstlisting}[basicstyle=\ttfamily\footnotesize] movq $42, -8(%rbp) movq -8(%rbp), -16(%rbp) -movq -16(%rbp), %rax +movq -16(%rbp), %rdi \end{lstlisting} \end{transformation} @@ -4059,7 +4059,7 @@ \section{Patch Instructions} \begin{lstlisting} movq $42, -8(%rbp) movq -8(%rbp), -16(%rbp) - movq -16(%rbp), %rax + movq -16(%rbp), %rdi \end{lstlisting} \fi} {\if\edition\pythonEd\pythonColor