# HG changeset patch # User Christian Urban # Date 1447815748 0 # Node ID 38e368dc9b1003af67b5dbae08b4e8bf98af7278 # Parent 47eceea734c5add6ef820a1615cb6fe19a24d1e9 updated diff -r 47eceea734c5 -r 38e368dc9b10 handouts/ho08.pdf Binary file handouts/ho08.pdf has changed diff -r 47eceea734c5 -r 38e368dc9b10 handouts/ho08.tex --- a/handouts/ho08.tex Wed Nov 18 02:59:49 2015 +0000 +++ b/handouts/ho08.tex Wed Nov 18 03:02:28 2015 +0000 @@ -305,14 +305,14 @@ .end method \end{lstlisting} -\noindent The local limit is because add takes two arguments. +\noindent The locals limit is 2 because add takes two arguments. The stack limit is a simple calculation using the estimate function. We first generate code for the boolean expression -\pcode{x == 0}, that is loading local variable 0 and the +\pcode{x == 0}, that is loading the local variable 0 and the number 0 onto the stack (Lines 4 and 5). If the not-equality -test fails we continue with returning $y$, which is the local +test fails, we continue with returning $y$, which is the local variable 1 (followed by a jump to the return instruction). If -the not-equality test succeeds then we jump to the label +the not-equality test succeeds, then we jump to the label \pcode{If_else} (Line 9). After that label is the code for \pcode{suc(add(x - 1, y))}. We first have to evaluate the argument of the suc-function. But this means we first have to