[SPCA] Finish stack, data type compilation details

This commit is contained in:
2026-01-12 12:02:53 +01:00
parent 639c147264
commit 9da3a2c0d3
23 changed files with 255 additions and 156 deletions

View File

@@ -0,0 +1,33 @@
\subsubsection{Jumping}
To jump, use \texttt{jmp <label>} (unconditional jump) or the \texttt{jC} instructions, with \texttt{C} from table \ref{tab:condition-codes}
\begin{table}[h!]
\begin{tables}{lll}{\texttt{setX} & Condition & Description}
\texttt{e} & \verb|ZF| & Equal / Zero \\
\texttt{ne} & \verb+~ZF+ & Not Equal / Not Zero \\
\texttt{s} & \verb|SF| & Negative \\
\texttt{ns} & \verb+~SF+ & Nonnegative \\
\texttt{g} & \verb+~(SF^OF)&~ZF+ & Greater (signed) \\
\texttt{ge} & \verb+~(SF^OF)+ & Greater or equal (signed) \\
\texttt{l} & \verb+SF^OF+ & Less (signed) \\
\texttt{le} & \verb+(SF^OF)|ZF+ & Less or equal (signed) \\
\texttt{a} & \verb+~CF&~ZF+ & Above (unsigned) \\
\texttt{b} & \verb|CF| & Below (unsigned) \\
\end{tables}
\caption{Condition code postfixes for jump and set instructions}
\label{tab:condition-codes}
\end{table}
\content{Conditional Moves}
Similar to \texttt{jC}, the same postfixes can be applied to \texttt{cmovC}, for example:
\begin{minted}{gas}
cmpl %eax, %edx
cmovle %edx, %eax
\end{minted}
Will move \verb|%edx| into \verb|%eax|, only if \verb|%edx| is less or equal (\verb|le|) \verb|%eax|.
This can be used to, for example, compile ternary expressions from \verb|C| to Assembly.
However, this requires evaluating both possible expressions, which may lead to a (significant) performance overhead.