equal
deleted
inserted
replaced
7 %https://github.com/Storyyeller/Krakatau |
7 %https://github.com/Storyyeller/Krakatau |
8 %https://docs.oracle.com/javase/specs/jvms/se7/html/ |
8 %https://docs.oracle.com/javase/specs/jvms/se7/html/ |
9 |
9 |
10 \section*{Coursework 4 (Strand 1)} |
10 \section*{Coursework 4 (Strand 1)} |
11 |
11 |
12 \noindent This coursework is worth 6\% and is due on 7 |
12 \noindent This coursework is worth 6\% and is due on 16 |
13 December at 16:00. You are asked to implement a compiler for |
13 December at 16:00. You are asked to implement a compiler for |
14 the WHILE language that targets the assembler language |
14 the WHILE language that targets the assembler language |
15 provided by Jasmin or Krakatau (both have very similar |
15 provided by Jasmin or Krakatau (both have very similar |
16 syntax). You can do the implementation in any programming |
16 syntax). You can do the implementation in any programming |
17 language you like, but you need to submit the source code with |
17 language you like, but you need to submit the source code with |
368 \code{'\\10'}, but \code{'\\13\\10'}. This means you need to change line~12 in |
368 \code{'\\10'}, but \code{'\\13\\10'}. This means you need to change line~12 in |
369 Figure~\ref{read} to \pcode{ldc 13}. |
369 Figure~\ref{read} to \pcode{ldc 13}. |
370 |
370 |
371 |
371 |
372 \begin{figure}[t]\small |
372 \begin{figure}[t]\small |
373 \begin{lstlisting}[language=JVMIS] |
373 \begin{lstlisting}[language=JVMIS,numbers=left] |
374 .method public static read()I |
374 .method public static read()I |
375 .limit locals 10 |
375 .limit locals 10 |
376 .limit stack 10 |
376 .limit stack 10 |
377 |
377 |
378 ldc 0 |
378 ldc 0 |