From 7c65e3ed3d9c8ef722aae52816d85e3486ca8de2 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Wed, 14 Apr 2021 00:37:38 +0100 Subject: Update main diagram --- algorithm.tex | 113 ++++++++++++++-------------------------------------------- 1 file changed, 27 insertions(+), 86 deletions(-) (limited to 'algorithm.tex') diff --git a/algorithm.tex b/algorithm.tex index deafece..6bc88d8 100644 --- a/algorithm.tex +++ b/algorithm.tex @@ -75,107 +75,48 @@ It has an unlimited number of pseudo-registers, and is represented as a control \begin{figure} \centering - \begin{subfigure}[b]{0.24\linewidth} -\begin{minted}{c} -int main() { - int x[3] = {1, 2, 3}; - int sum = 0; - for (int i = 0; - i < 3; - i++) - sum += x[i]; - return sum; -} -\end{minted} - \caption{Input C code.}\label{fig:accumulator_c} - \end{subfigure} - \begin{subfigure}[b]{0.24\linewidth} + \begin{subfigure}[b]{0.3\linewidth} \begin{minted}[fontsize=\footnotesize]{c} main() { - 15: x8 = 1 - 14: int32[stack(0)] = x8 - 13: x7 = 2 - 12: int32[stack(4)] = x7 - 11: x6 = 3 - 10: int32[stack(8)] = x6 - 9: x2 = 0 - 8: x1 = 0 - 7: x5 = stack(0) (int) - 6: x4 = int32[x5 + x1 * 4 + 0] - 5: x2 = x2 + x4 + 0 (int) - 4: x1 = x1 + 1 (int) - 3: if (x1