equal
deleted
inserted
replaced
582 conservative default values that allow is to run some simple |
582 conservative default values that allow is to run some simple |
583 While-programs. In a real compiler, we would of course need to |
583 While-programs. In a real compiler, we would of course need to |
584 work harder and find out appropriate values for the stack and |
584 work harder and find out appropriate values for the stack and |
585 local variables. |
585 local variables. |
586 |
586 |
|
587 To sum up, in Figure~\ref{test} is the complete code generated |
|
588 for the slightly non-sensical program |
|
589 |
|
590 \begin{lstlisting}[mathescape,language=While] |
|
591 x := 1 + 2; |
|
592 write x |
|
593 \end{lstlisting} |
|
594 |
|
595 \noindent Having this code at our disposal, we need the |
|
596 assembler to translate the generated code into bytecode (a |
|
597 class file) that can be understood by the JVM. |
|
598 |
|
599 |
|
600 \begin{figure}[p] |
|
601 \lstinputlisting{../progs/test-small.j} |
|
602 \caption{Generated code for a test program.\label{test}} |
|
603 \end{figure} |
587 |
604 |
588 \end{document} |
605 \end{document} |
589 |
606 |
590 %%% Local Variables: |
607 %%% Local Variables: |
591 %%% mode: latex |
608 %%% mode: latex |