|
@@ -6368,44 +6368,36 @@ registers.
|
|
|
\texttt{pushq} $A$ & $\texttt{rsp} - 8 \to \texttt{rsp}; A \to *\texttt{rsp}$\\
|
|
|
\texttt{leaq} $A$,$B$ & $A \to B$ ($C$ must be a register) \\
|
|
|
\texttt{cmpq} $A$, $B$ & compare $A$ and $B$ and set flag \\
|
|
|
-\texttt{je} $L$ & If the flag is set to ``equal'', jump to
|
|
|
- label $L$ \\
|
|
|
-\texttt{jl} $L$ & If the flag is set to ``less'', jump to
|
|
|
- label $L$ \\
|
|
|
-\texttt{jle} $L$ & If the flag is set to ``less or equal'', jump to
|
|
|
- label $L$ \\
|
|
|
-\texttt{jg} $L$ & If the flag is set to ``greater'', jump to
|
|
|
- label $L$ \\
|
|
|
-\texttt{jge} $L$ & If the flag is set to ``greater or equal'', jump to
|
|
|
- label $L$ \\
|
|
|
+\texttt{je} $L$ & \multirow{5}{3.7in}{Jump to label $L$ if the flag matches
|
|
|
+ the condition code, otherwise go to the next instructions.
|
|
|
+ The condition codes are \key{e} for ``equal'',
|
|
|
+ \key{l} for ``less'', \key{le} for ``less or equal'', \key{g}
|
|
|
+ for ``greater'', and \key{ge} for ``greater or equal''.} \\
|
|
|
+\texttt{jl} $L$ & \\
|
|
|
+\texttt{jle} $L$ & \\
|
|
|
+\texttt{jg} $L$ & \\
|
|
|
+\texttt{jge} $L$ & \\
|
|
|
\texttt{jmp} $L$ & Jump to label $L$ \\
|
|
|
\texttt{movq} $A$, $B$ & $A \to B$ \\
|
|
|
-\texttt{movzbq} $A$, $B$ & $A \to B$ \\
|
|
|
- & \text{where } $A$ is a single-byte register (e.g., \texttt{al} or \texttt{cl}), $B$ is a 8-byte register, \\
|
|
|
- & and the extra bytes of $B$ are set to zero \\
|
|
|
+\texttt{movzbq} $A$, $B$ &
|
|
|
+ \multirow{3}{3.7in}{$A \to B$, \text{where } $A$ is a single-byte register
|
|
|
+ (e.g., \texttt{al} or \texttt{cl}), $B$ is a 8-byte register,
|
|
|
+ and the extra bytes of $B$ are set to zero.} \\
|
|
|
+ & \\
|
|
|
+ & \\
|
|
|
\texttt{notq} $A$ & $\sim A \to A$ \qquad (bitwise complement)\\
|
|
|
\texttt{orq} $A$, $B$ & $A | B \to B$ \qquad (bitwise-or)\\
|
|
|
\texttt{andq} $A$, $B$ & $A \& B \to B$ \qquad (bitwise-and)\\
|
|
|
-\texttt{salq} $A$, $B$ & $B$ \texttt{<<} $A \to B$ (where $A$ is a constant)\\
|
|
|
-\texttt{sarq} $A$, $B$ & $B$ \texttt{>>} $A \to B$ (where $A$ is a constant)\\
|
|
|
-\texttt{sete} $A$ & If the flag is set to ``equal'', then
|
|
|
- $1 \to A$, else $0 \to A$. \\
|
|
|
- & $A$ must be a single byte register (e.g., \texttt{al} or \texttt{cl}). \\
|
|
|
-\texttt{setne} $A$ & If the flag is set to ``not equal'', then
|
|
|
- $1 \to A$, else $0 \to A$. \\
|
|
|
- & $A$ must be a single byte register (e.g., \texttt{al} or \texttt{cl}). \\
|
|
|
-\texttt{setl} $A$ & If the flag is set to ``less'', then
|
|
|
- $1 \to A$, else $0 \to A$. \\
|
|
|
- & $A$ must be a single byte register (e.g., \texttt{al} or \texttt{cl}). \\
|
|
|
-\texttt{setle} $A$ & If the flag is set to ``less or equal'', then
|
|
|
- $1 \to A$, else $0 \to A$. \\
|
|
|
- & $A$ must be a single byte register (e.g., \texttt{al} or \texttt{cl}). \\
|
|
|
-\texttt{setg} $A$ & If the flag is set to ``greater, then
|
|
|
- $1 \to A$, else $0 \to A$. \\
|
|
|
- & $A$ must be a single byte register (e.g., \texttt{al} or \texttt{cl}). \\
|
|
|
-\texttt{setge} $A$ & If the flag is set to ``greater or equal'', then
|
|
|
- $1 \to A$, else $0 \to A$. \\
|
|
|
- & $A$ must be a single byte register (e.g., \texttt{al} or \texttt{cl}).
|
|
|
+\texttt{salq} $A$, $B$ & $B$ \texttt{<<} $A \to B$ (arithmetic shift left, where $A$ is a constant)\\
|
|
|
+\texttt{sarq} $A$, $B$ & $B$ \texttt{>>} $A \to B$ (arithmetic shift right, where $A$ is a constant)\\
|
|
|
+\texttt{sete} $A$ & \multirow{5}{3.7in}{If the flag matches the condition code,
|
|
|
+ then $1 \to A$, else $0 \to A$. Refer to \texttt{je} above for the
|
|
|
+ description of the condition codes. $A$ must be a single byte register
|
|
|
+ (e.g., \texttt{al} or \texttt{cl}).} \\
|
|
|
+\texttt{setl} $A$ & \\
|
|
|
+\texttt{setle} $A$ & \\
|
|
|
+\texttt{setg} $A$ & \\
|
|
|
+\texttt{setge} $A$ &
|
|
|
\end{tabular}
|
|
|
\vspace{5pt}
|
|
|
\caption{Quick-reference for the x86 instructions used in this book.}
|