From 639c147264789017f6da4e9bf090d059a604c1d4 Mon Sep 17 00:00:00 2001 From: Janis Hutz Date: Mon, 12 Jan 2026 08:06:51 +0100 Subject: [PATCH] [SPCA] Stack almost complete, still missing variadic functions --- semester3/spca/parts/00_asm/03_operations.tex | 10 ++-- .../spca/parts/00_asm/04_control-flow.tex | 10 +++- semester3/spca/parts/00_asm/05_stack.tex | 53 +++++++++++++++++- semester3/spca/spca-summary.pdf | Bin 532896 -> 530278 bytes 4 files changed, 65 insertions(+), 8 deletions(-) diff --git a/semester3/spca/parts/00_asm/03_operations.tex b/semester3/spca/parts/00_asm/03_operations.tex index ebdb020..d70e503 100644 --- a/semester3/spca/parts/00_asm/03_operations.tex +++ b/semester3/spca/parts/00_asm/03_operations.tex @@ -9,7 +9,7 @@ The following instruction formats are commonly used: Arithmetic / logic operations need a size postfix (replace \texttt{X} below with \texttt{b} (1B), \texttt{w} (2B), \texttt{l} (4B) or \texttt{q} (8B)). \begin{tables}{lll}{Mnemonic & Format & Computation} - \texttt{addl} & \texttt{Src, Dest} & \texttt{Dest} $\gets$ \texttt{Dest + Src} \\ + \texttt{addX} & \texttt{Src, Dest} & \texttt{Dest} $\gets$ \texttt{Dest + Src} \\ \texttt{subX} & \texttt{Src, Dest} & \texttt{Dest} $\gets$ \texttt{Dest - Src} \\ \texttt{imulX} & \texttt{Src, Dest} & \texttt{Dest} $\gets$ \texttt{Dest * Src} \\ \texttt{salX} & \texttt{Src, Dest} & \texttt{Dest} $\gets$ \texttt{Dest << Src} \\ @@ -48,9 +48,9 @@ and \texttt{SF} is set if \texttt{a \& b < 0}. \content{Zeroing register} We can use a move instruction, but that is less efficient than using \texttt{xorl reg, reg}, where \texttt{reg} is the 32-bit version of the reg we want to zero. -\content{Reading condition codes} To read condition codes, we can use the \texttt{setX} instructions, where the \texttt{X} is to be substituted by an element of table \ref{tab:condition-codes} +\content{Reading condition codes} To read condition codes, we can use the \texttt{setC} instructions, where the \texttt{C} is to be substituted by an element of table \ref{tab:condition-codes} -\content{Jumping} To jump, we have the \texttt{jmp