hws/hw09.tex
changeset 459 780486571e38
parent 359 db106e5b7c4d
child 525 a2ee4b11c976
--- a/hws/hw09.tex	Sat Oct 22 13:11:33 2016 +0100
+++ b/hws/hw09.tex	Sat Oct 22 15:18:11 2016 +0100
@@ -1,6 +1,7 @@
 \documentclass{article}
 \usepackage{../style}
 \usepackage{../graphics}
+\usepackage{../langs}
 
 \begin{document}
 
@@ -10,8 +11,36 @@
 
 \begin{enumerate}
 \item Describe what is meant by \emph{eliminating tail
-      recursion}, when such an optimization can be applied and
-      why it is a benefit?
+      recursion}? When can this optimization be applied and
+      why is it of benefit?
+
+\item A programming language has arithmetic expression. For an
+  arithmetic expression the compiler of this language produces the
+  following snippet of JVM code.
+
+\begin{lstlisting}[language=JVMIS,numbers=none]
+ldc 1 
+ldc 2 
+ldc 3 
+imul 
+ldc 4 
+ldc 3 
+isub 
+iadd 
+iadd
+\end{lstlisting}
+
+  Give the arithmetic expression that produced this code.  Make sure
+  you give all necessary parentheses.
+
+\item Describe what the following two JVM instructions do!
+
+\begin{lstlisting}[language=JVMIS,numbers=none]
+iload 3
+istore 1
+\end{lstlisting}
+
+\item \POSTSCRIPT  
 
 %  \item It is true (I confirmed it) that
 %