mirror of
https://github.com/janishutz/eth-summaries.git
synced 2026-03-14 10:50:05 +01:00
15 lines
827 B
TeX
15 lines
827 B
TeX
\newpage
|
|
\subsection{The syntax}
|
|
There are two common styles: AT\&T syntax (common on UNIX) and Intel syntax (common on Windows).
|
|
The most obvious difference between the two is that they invert the order of operands,
|
|
i.e. where the AT\&T syntax has the destination as the second argument, the Intel syntax puts it first.
|
|
|
|
The state that is visible to us is:
|
|
\begin{itemize}[noitemsep]
|
|
\item PC (Program Counter) that contains the address of the next instruction
|
|
\item Register file that contains the most used program data
|
|
\item Condition codes that store status information about most recent arithmetic operation and are used for conditional branching
|
|
\end{itemize}
|
|
|
|
To view what \lC\ code looks like in assembly, we can use \texttt{gcc -O0 -S code.c}, which produces \texttt{code.s} which contains assembly code.
|