author | Christian Urban <christian dot urban at kcl dot ac dot uk> |
Mon, 22 Sep 2014 13:42:14 +0100 | |
changeset 257 | 70c307641d05 |
parent 215 | 828303e8e4af |
child 309 | 640e4a05cd9b |
permissions | -rw-r--r-- |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
1 |
\documentclass[dvipsnames,14pt,t]{beamer} |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
2 |
\usepackage{beamerthemeplaincu} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
3 |
\usepackage[absolute,overlay]{textpos} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
4 |
\usepackage{ifthen} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
5 |
\usepackage{tikz} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
6 |
\usepackage{pgf} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
7 |
\usepackage{calc} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
8 |
\usepackage{ulem} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
9 |
\usepackage{courier} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
10 |
\usepackage{listings} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
11 |
\renewcommand{\uline}[1]{#1} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
12 |
\usetikzlibrary{arrows} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
13 |
\usetikzlibrary{automata} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
14 |
\usetikzlibrary{shapes} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
15 |
\usetikzlibrary{shadows} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
16 |
\usetikzlibrary{positioning} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
17 |
\usetikzlibrary{calc} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
18 |
\usetikzlibrary{plotmarks} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
19 |
\usepackage{graphicx} |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
20 |
\usepackage{pgfplots} |
215
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
21 |
\usepackage{../langs} |
828303e8e4af
updated slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
207
diff
changeset
|
22 |
\usepackage{../data} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
23 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
24 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
25 |
% beamer stuff |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
26 |
\renewcommand{\slidecaption}{AFL 09, King's College London, 27.~November 2013} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
27 |
\newcommand{\bl}[1]{\textcolor{blue}{#1}} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
28 |
\newcommand{\dn}{\stackrel{\mbox{\scriptsize def}}{=}}% for definitions |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
29 |
|
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
30 |
\pgfdeclareradialshading{smallbluesphere}{\pgfpoint{0.5mm}{0.5mm}}% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
31 |
{rgb(0mm)=(0,0,0.9); |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
32 |
rgb(0.9mm)=(0,0,0.7); |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
33 |
rgb(1.3mm)=(0,0,0.5); |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
34 |
rgb(1.4mm)=(1,1,1)} |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
35 |
|
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
36 |
\def\myitemi{\begin{pgfpicture}{-1ex}{-0.55ex}{1ex}{1ex} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
37 |
\usebeamercolor[fg]{subitem projected} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
38 |
{\pgftransformscale{0.8}\pgftext{\normalsize\pgfuseshading{bigsphere}}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
39 |
\pgftext{% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
40 |
\usebeamerfont*{subitem projected}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
41 |
\end{pgfpicture}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
42 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
43 |
\begin{document} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
44 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
45 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
46 |
\mode<presentation>{ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
47 |
\begin{frame}<1>[t] |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
48 |
\frametitle{% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
49 |
\begin{tabular}{@ {}c@ {}} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
50 |
\\[-3mm] |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
51 |
\LARGE Automata and \\[-2mm] |
76
373cf55a3ca5
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
70
diff
changeset
|
52 |
\LARGE Formal Languages (9)\\[3mm] |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
53 |
\end{tabular}} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
54 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
55 |
\normalsize |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
56 |
\begin{center} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
57 |
\begin{tabular}{ll} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
58 |
Email: & christian.urban at kcl.ac.uk\\ |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
59 |
Office: & S1.27 (1st floor Strand Building)\\ |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
60 |
Slides: & KEATS (also home work is there)\\ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
61 |
\end{tabular} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
62 |
\end{center} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
63 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
64 |
\end{frame}} |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
65 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
66 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
67 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
68 |
\mode<presentation>{ |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
69 |
\begin{frame}[c] |
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
70 |
|
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
71 |
\large\bf |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
72 |
Using a compiler, \\how can you mount the\\ perfect attack against a system? |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
73 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
74 |
\end{frame}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
75 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
76 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
77 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
78 |
\mode<presentation>{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
79 |
\begin{frame}[c] |
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
80 |
|
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
81 |
{\large\bf |
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
82 |
What is a \alert{perfect} attack?}\bigskip |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
83 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
84 |
\begin{enumerate} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
85 |
\item you can potentially completely take over a target system |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
86 |
\item your attack is (nearly) undetectable |
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
87 |
\item the victim has (almost) no chance to recover |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
88 |
\end{enumerate} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
89 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
90 |
\end{frame}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
91 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
92 |
|
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
93 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
94 |
\mode<presentation>{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
95 |
\begin{frame}[c] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
96 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
97 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
98 |
\begin{center} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
99 |
\begin{tikzpicture}[scale=1] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
100 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
101 |
\onslide<1->{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
102 |
\node (A) at (0,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=17mm] {}; |
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
103 |
\node [below right] at (A.north west) {\footnotesize\begin{tabular}{@{}l@{}} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
104 |
\only<1,2>{clean}\only<3->{\alert{hacked}}\\compiler\end{tabular}};} |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
105 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
106 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
107 |
\onslide<2->{ |
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
108 |
\node (B) at (-2,2) [draw=black, rectangle, very thick, minimum height=10mm, minimum width=12mm] {}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
109 |
\node [below right] at (B.north west) {\footnotesize\begin{tabular}{@{}l@{}}login\\(src)\end{tabular}}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
110 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
111 |
\node (C) at (2,2) [draw=black, rectangle, very thick, minimum height=10mm, minimum width=12mm] {}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
112 |
\node [below right] at (C.north west) {\footnotesize\begin{tabular}{@{}l@{}}login\\(bin)\end{tabular}}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
113 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
114 |
\draw[->, line width=2mm] (B) -- (C); |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
115 |
} |
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
116 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
117 |
\onslide<3->{\node [above left=-1.5mm] at (C.south east) {\footnotesize \alert{$\blacksquare$}};} |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
118 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
119 |
\end{tikzpicture} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
120 |
\end{center} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
121 |
|
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
122 |
\end{frame}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
123 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
124 |
|
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
125 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
126 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
127 |
\mode<presentation>{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
128 |
\begin{frame}[c] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
129 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
130 |
\begin{center} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
131 |
\begin{tikzpicture}[scale=1] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
132 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
133 |
\onslide<1->{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
134 |
\node (A) at (0,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=14mm] {}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
135 |
\node [below right] at (A.north west) {\small V0.01}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
136 |
\node [below right] (A1) at (A.south west) {\small Scala}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
137 |
\node [below right] (A1) at (A1.south west) {\small\textcolor{gray}{host language}}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
138 |
\node [above right] at (A.north west) {my compiler (src)};} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
139 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
140 |
\onslide<2->{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
141 |
\node (B) at (1.8,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=14mm] {}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
142 |
\node [below right] at (B.north west) {\small V0.02}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
143 |
\node [below right] at (B.south west) {\small Scala}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
144 |
\node at (3,0) {\ldots}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
145 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
146 |
\node (C) at (5,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=14mm] {}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
147 |
\node [below right] at (C.north west) {\small V1.00}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
148 |
\node [below right] at (C.south west) {\small Scala};} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
149 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
150 |
\onslide<3->{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
151 |
\node (D) at (6.8,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=14mm] {}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
152 |
\node [below right] at (D.north west) {\small V1.00}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
153 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
154 |
\node (E) at (6.8,2) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=14mm] {}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
155 |
\node [below right] at (E.north west) {\small V1.01};} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
156 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
157 |
\onslide<4->{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
158 |
\node (F) at (8.6,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=14mm] {}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
159 |
\node [below right] at (F.north west) {\small V1.01}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
160 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
161 |
\node (G) at (8.6,2) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=14mm] {}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
162 |
\node [below right] at (G.north west) {\small V1.02}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
163 |
\node at (9.8,0) {\ldots}; |
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
164 |
\node at (9.8,2) {\ldots}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
165 |
\node at (8,-2) {\textcolor{gray}{\begin{tabular}{@{}l@{}}no host language\\needed\end{tabular}}}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
166 |
} |
206
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
167 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
168 |
\end{tikzpicture} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
169 |
\end{center} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
170 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
171 |
\end{frame}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
172 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
173 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
174 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
175 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
176 |
\mode<presentation>{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
177 |
\begin{frame}<1-3> |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
178 |
\frametitle{\LARGE\begin{tabular}{c}Hacking Compilers |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
179 |
\end{tabular}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
180 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
181 |
%Why is it so paramount to have a small trusted code base (TCB)? |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
182 |
\bigskip\bigskip |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
183 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
184 |
\begin{columns} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
185 |
\begin{column}{2.7cm} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
186 |
\begin{minipage}{2.5cm}% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
187 |
\begin{tabular}{c@ {}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
188 |
\includegraphics[scale=0.2]{../pics/ken-thompson.jpg}\\[-1.8mm] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
189 |
\footnotesize Ken Thompson\\[-1.8mm] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
190 |
\footnotesize Turing Award, 1983\\ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
191 |
\end{tabular} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
192 |
\end{minipage} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
193 |
\end{column} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
194 |
\begin{column}{9cm} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
195 |
\begin{tabular}{l@ {\hspace{1mm}}p{8cm}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
196 |
\myitemi |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
197 |
& Ken Thompson showed how to hide a Trojan Horse in a |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
198 |
compiler \textcolor{red}{without} leaving any traces in the source code.\\[2mm] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
199 |
\myitemi |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
200 |
& No amount of source level verification will protect |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
201 |
you from such Thompson-hacks.\\[2mm] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
202 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
203 |
\myitemi |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
204 |
& Therefore in safety-critical systems it is important to rely |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
205 |
on only a very small TCB. |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
206 |
\end{tabular} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
207 |
\end{column} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
208 |
\end{columns} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
209 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
210 |
\only<2>{ |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
211 |
\begin{textblock}{6}(4,2) |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
212 |
\begin{tikzpicture} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
213 |
\draw (0,0) node[inner sep=3mm,fill=cream, ultra thick, draw=red, rounded corners=2mm] |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
214 |
{\normalsize |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
215 |
\begin{minipage}{8cm} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
216 |
\begin{quote} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
217 |
\includegraphics[scale=0.05]{../pics/evil.png} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
218 |
\begin{enumerate} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
219 |
\item[1)] Assume you ship the compiler as binary and also with sources. |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
220 |
\item[2)] Make the compiler aware when it compiles itself. |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
221 |
\item[3)] Add the Trojan horse. |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
222 |
\item[4)] Compile. |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
223 |
\item[5)] Delete Trojan horse from the sources of the compiler. |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
224 |
\item[6)] Go on holiday for the rest of your life. ;o)\\[-7mm]\mbox{} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
225 |
\end{enumerate} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
226 |
\end{quote} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
227 |
\end{minipage}}; |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
228 |
\end{tikzpicture} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
229 |
\end{textblock}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
230 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
231 |
\end{frame}} |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
232 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
233 |
|
85b961f1eee9
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
151
diff
changeset
|
234 |
|
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
235 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
236 |
\mode<presentation>{ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
237 |
\begin{frame}[c] |
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
238 |
\frametitle{Our Compiler} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
239 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
240 |
\begin{center} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
241 |
\begin{tikzpicture}[scale=1] |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
242 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
243 |
\node (0) at (-2.3,0) {}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
244 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
245 |
\node (A) at (0,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=20mm] {}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
246 |
\node [below right] at (A.north west) {lexer}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
247 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
248 |
\node (B) at (3,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=20mm] {}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
249 |
\node [below right=1mm] at (B.north west) {\mbox{}\hspace{-1mm}parser}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
250 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
251 |
\node (C) at (6,0) [draw=black, rectangle, very thick, minimum height=18mm, minimum width=20mm] {}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
252 |
\node [below right] at (C.north west) {\mbox{}\hspace{-1mm}code gen}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
253 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
254 |
\node (1) at (8.4,0) {}; |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
255 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
256 |
\draw [->,line width=4mm] (0) -- (A); |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
257 |
\draw [->,line width=4mm] (A) -- (B); |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
258 |
\draw [->,line width=4mm] (B) -- (C); |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
259 |
\draw [->,line width=4mm] (C) -- (1); |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
260 |
\end{tikzpicture} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
261 |
\end{center} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
262 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
263 |
lexer input: string\medskip\\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
264 |
lexer output: sequence of tokens\\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
265 |
\mbox{}\hfill(white space and comments filtered out)\medskip\\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
266 |
parser output: abstract syntax tree\medskip\\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
267 |
code gen output: assembler byte code / \\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
268 |
\mbox{}\hfill assembler machine code |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
269 |
\end{frame}} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
270 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
271 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
272 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
273 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
274 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
275 |
\mode<presentation>{ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
276 |
\begin{frame}[c] |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
277 |
\frametitle{\begin{tabular}{c}For-Loops\end{tabular}} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
278 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
279 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
280 |
\begin{center}\Large |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
281 |
\texttt{for} \;\textit{Id} \texttt{:=} \textit{AExp}\; \texttt{upto} \;\textit{AExp}\; \texttt{do} \textit{Block} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
282 |
\end{center}\bigskip |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
283 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
284 |
\begin{center} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
285 |
\begin{minipage}{8cm} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
286 |
\begin{tabular}{l} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
287 |
\texttt{for i := 2 upto 4 do \{}\\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
288 |
\hspace{5mm}\texttt{write i}\\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
289 |
\texttt{\}}\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
290 |
\end{tabular} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
291 |
\end{minipage} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
292 |
\end{center} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
293 |
\end{frame}} |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
294 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
295 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
296 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
297 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
298 |
|
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
299 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
300 |
\mode<presentation>{ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
301 |
\begin{frame}[c] |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
302 |
\frametitle{\begin{tabular}{c}While-Language\end{tabular}} |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
303 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
304 |
|
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
305 |
\begin{center} |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
306 |
\bl{\begin{tabular}{@{}lcl@{}} |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
307 |
$Stmt$ & $\rightarrow$ & $\text{skip}$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
308 |
& $|$ & $Id := AExp$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
309 |
& $|$ & $\text{if}\; B\!Exp \;\text{then}\; Block \;\text{else}\; Block$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
310 |
& $|$ & $\text{while}\; B\!Exp \;\text{do}\; Block$\\ |
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
311 |
& $|$ & $\alert{\text{write}\; Id}$\\ |
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
312 |
& $|$ & $\alert{\text{read}\; Id}$\medskip\\ |
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
313 |
$Stmts$ & $\rightarrow$ & $Stmt \;\text{;}\; Stmts$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
314 |
& $|$ & $Stmt$\medskip\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
315 |
$Block$ & $\rightarrow$ & $\{ Stmts \}$\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
316 |
& $|$ & $Stmt$\medskip\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
317 |
$AExp$ & $\rightarrow$ & \ldots\\ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
318 |
$BExp$ & $\rightarrow$ & \ldots\\ |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
319 |
\end{tabular}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
320 |
\end{center} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
321 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
322 |
|
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
323 |
\end{frame}} |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
324 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
325 |
|
77
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
326 |
|
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
327 |
|
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
328 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
329 |
\mode<presentation>{ |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
330 |
\begin{frame}[c] |
49c0beef79a1
added
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
76
diff
changeset
|
331 |
\frametitle{\begin{tabular}{c}Interpreter\end{tabular}} |
66
9215b9fb8852
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
65
diff
changeset
|
332 |
|
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
333 |
\begin{center} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
334 |
\bl{\begin{tabular}{@{}lcl@{}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
335 |
$\text{eval}(n, E)$ & $\dn$ & $n$\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
336 |
$\text{eval}(x, E)$ & $\dn$ & $E(x)$ \;\;\;\textcolor{black}{lookup \bl{$x$} in \bl{$E$}}\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
337 |
$\text{eval}(a_1 + a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) + \text{eval}(a_2, E)$\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
338 |
$\text{eval}(a_1 - a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) - \text{eval}(a_2, E)$\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
339 |
$\text{eval}(a_1 * a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) * \text{eval}(a_2, E)$\bigskip\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
340 |
$\text{eval}(a_1 = a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) = \text{eval}(a_2, E)$\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
341 |
$\text{eval}(a_1\,!\!= a_2, E)$ & $\dn$ & $\neg(\text{eval}(a_1, E) = \text{eval}(a_2, E))$\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
342 |
$\text{eval}(a_1 < a_2, E)$ & $\dn$ & $\text{eval}(a_1, E) < \text{eval}(a_2, E)$\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
343 |
\end{tabular}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
344 |
\end{center} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
345 |
|
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
346 |
\end{frame}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
347 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
348 |
|
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
349 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
350 |
\mode<presentation>{ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
351 |
\begin{frame}[c] |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
352 |
\frametitle{\begin{tabular}{c}Interpreter (2)\end{tabular}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
353 |
|
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
354 |
\begin{center} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
355 |
\bl{\begin{tabular}{@{}lcl@{}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
356 |
$\text{eval}(\text{skip}, E)$ & $\dn$ & $E$\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
357 |
$\text{eval}(x:=a, E)$ & $\dn$ & \bl{$E(x \mapsto \text{eval}(a, E))$}\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
358 |
\multicolumn{3}{@{}l@{}}{$\text{eval}(\text{if}\;b\;\text{then}\;cs_1\;\text{else}\;cs_2 , E) \dn$}\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
359 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\text{if}\;\text{eval}(b,E)\;\text{then}\; |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
360 |
\text{eval}(cs_1,E)$}\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
361 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\phantom{\text{if}\;\text{eval}(b,E)\;}\text{else}\;\text{eval}(cs_2,E)$}\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
362 |
\multicolumn{3}{@{}l@{}}{$\text{eval}(\text{while}\;b\;\text{do}\;cs, E) \dn$}\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
363 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\text{if}\;\text{eval}(b,E)$}\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
364 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\text{then}\; |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
365 |
\text{eval}(\text{while}\;b\;\text{do}\;cs, \text{eval}(cs,E))$}\\ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
366 |
\multicolumn{3}{@{}l@{}}{\hspace{2cm}$\text{else}\; E$}\\ |
81
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
367 |
$\text{eval}(\text{write}\; x, E)$ & $\dn$ & $\{\;\text{println}(E(x))\; ;\;E\;\}$\\ |
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
368 |
\end{tabular}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
369 |
\end{center} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
370 |
|
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
371 |
\end{frame}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
372 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
373 |
|
207
f824e1331fc6
added slides
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
206
diff
changeset
|
374 |
|
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
375 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
376 |
\mode<presentation>{ |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
377 |
\begin{frame}[t] |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
378 |
\frametitle{\begin{tabular}{c}Compiling Writes\end{tabular}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
379 |
|
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
380 |
{\Large\bl{write $x$}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
381 |
|
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
382 |
\begin{center} |
81
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
383 |
\small\bl{\begin{tabular}{l} |
84
719fd738d2a0
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
82
diff
changeset
|
384 |
.method public static write(I)V\hspace{1cm}\textcolor{black}{(library function)}\\ |
81
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
385 |
\;\; .limit locals 5 \\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
386 |
\;\; .limit stack 5 \\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
387 |
\;\; iload 0 \\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
388 |
\;\; getstatic java/lang/System/out Ljava/io/PrintStream;\\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
389 |
\;\; swap \\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
390 |
\;\; invokevirtual java/io/PrintStream/println(I)V \\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
391 |
\;\; return \\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
392 |
.end method\bigskip\bigskip\\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
393 |
% |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
394 |
\normalsize |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
395 |
iload $E(x)$\\ |
ffac240147e2
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
80
diff
changeset
|
396 |
invokestatic write(I)V\\ |
80
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
397 |
\end{tabular}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
398 |
\end{center} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
399 |
|
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
400 |
\end{frame}} |
191daa3ee29e
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
79
diff
changeset
|
401 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
82
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
402 |
|
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
403 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
404 |
\mode<presentation>{ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
405 |
\begin{frame}[c] |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
406 |
|
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
407 |
\begin{center} |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
408 |
\small\bl{\begin{tabular}{l} |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
409 |
.class public XXX.XXX\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
410 |
.super java/lang/Object\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
411 |
\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
412 |
.method public <init>()V\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
413 |
\;\; aload\_0\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
414 |
\;\; invokenonvirtual java/lang/Object/<init>()V\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
415 |
\;\; return\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
416 |
.end method\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
417 |
\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
418 |
.method public static main([Ljava/lang/String;)V\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
419 |
\;\; .limit locals 200\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
420 |
\;\; .limit stack 200\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
421 |
\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
422 |
\textcolor{black}{(here comes the compiled code)}\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
423 |
\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
424 |
\;\; return\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
425 |
.end method\\ |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
426 |
\end{tabular}} |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
427 |
\end{center} |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
428 |
|
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
429 |
\end{frame}} |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
430 |
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% |
06c3ec0b452e
updated
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
81
diff
changeset
|
431 |
|
65
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
432 |
\end{document} |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
433 |
|
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
434 |
%%% Local Variables: |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
435 |
%%% mode: latex |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
436 |
%%% TeX-master: t |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
437 |
%%% End: |
ade6af51402c
tuned
Christian Urban <christian dot urban at kcl dot ac dot uk>
parents:
diff
changeset
|
438 |