equal
deleted
inserted
replaced
9 %https://docs.oracle.com/javase/specs/jvms/se7/html/ |
9 %https://docs.oracle.com/javase/specs/jvms/se7/html/ |
10 |
10 |
11 % Jasmin Tutorial |
11 % Jasmin Tutorial |
12 %http://saksagan.ceng.metu.edu.tr/courses/ceng444/link/jvm-cpm.html |
12 %http://saksagan.ceng.metu.edu.tr/courses/ceng444/link/jvm-cpm.html |
13 |
13 |
14 \section*{Coursework 4 (Strand 1)} |
14 \section*{Coursework 4} |
15 |
15 |
16 \noindent This coursework is worth 6\% and is due on \cwFOUR{} |
16 \noindent This coursework is worth 10\% and is due on \cwFOUR{} |
17 at 18:00. You are asked to implement a compiler for |
17 at 18:00. You are asked to implement a compiler for |
18 the WHILE language that targets the assembler language |
18 the WHILE language that targets the assembler language |
19 provided by Jasmin or Krakatau (both have very similar |
19 provided by Jasmin or Krakatau (both have very similar |
20 syntax). You can do the implementation in any programming |
20 syntax). You can do the implementation in any programming |
21 language you like, but you need to submit the source code with |
21 language you like, but you need to submit the source code with |
23 be awarded. You should use the lexer and parser from the |
23 be awarded. You should use the lexer and parser from the |
24 previous courseworks. Please package \emph{everything}(!) in |
24 previous courseworks. Please package \emph{everything}(!) in |
25 a zip-file that creates a directory with the name |
25 a zip-file that creates a directory with the name |
26 \texttt{YournameYourFamilyname} on my end. |
26 \texttt{YournameYourFamilyname} on my end. |
27 |
27 |
28 \subsection*{Disclaimer} |
28 \subsection*{Disclaimer\alert} |
29 |
29 |
30 It should be understood that the work you submit represents |
30 It should be understood that the work you submit represents |
31 your own effort. You have not copied from anyone else. An |
31 your own effort. You have not copied from anyone else. An |
32 exception is the Scala code I showed during the lectures, |
32 exception is the Scala code I showed during the lectures, |
33 which you can use. You can also use your own code from the |
33 which you can use. You can also use your own code from the |
144 Figure~\ref{fibs}. You can write your own program for |
144 Figure~\ref{fibs}. You can write your own program for |
145 calculating factorials. Submit your assembler code as |
145 calculating factorials. Submit your assembler code as |
146 a file that can be run, not as PDF-text. |
146 a file that can be run, not as PDF-text. |
147 |
147 |
148 \begin{figure}[t] |
148 \begin{figure}[t] |
149 \lstinputlisting[language=while]{../progs/fib.while} |
149 \lstinputlisting[language=while]{../progs/while-tests/fib.while} |
150 \caption{The Fibonacci program in the WHILE language.\label{fibs}} |
150 \caption{The Fibonacci program in the WHILE language.\label{fibs}} |
151 \end{figure} |
151 \end{figure} |
152 |
152 |
153 \subsection*{Question 2} |
153 \subsection*{Question 2} |
154 |
154 |