First opcode table setup.

This commit is contained in:
2024-07-19 00:53:29 -05:00
parent b6b340fd62
commit 5c646a4835
2 changed files with 23 additions and 13 deletions
+21 -2
View File
@@ -1,9 +1,23 @@
\chapter{Instruction Set Architecture}
\section{Encoding Schemes}
\newcommand{\OpcodeTable}[4] {
\begin{tabularx}{\textwidth}{ | X | X | X | X | }
\hline
Opcode Hex & Instruction & Operand 1 & Operand 2 \\
\hline
#1 & #2 & #3 & #4 \\
\hline
\end{tabularx}
}
\def\minY{0} \def\maxY{0.5}
\def\minX{-7} \def\maxX{7}
\usetikzlibrary{decorations.pathreplacing}
\section{Encoding Schemes}
The /r represents a byte that specifies a register. /iX is for the immediate data type, where \textit{X} defines the width, which are 8, 16, or 32 bits.
\begin{figure}[!htb]
\begin{tikzpicture}
\draw (\minX, \minY) -- (\maxX, \minY);
@@ -28,4 +42,9 @@
\draw [decorate, decoration={brace, amplitude=1em, mirror}] (0, -\maxY) -- (\maxX, -\maxY) node[midway, below=1em] {Near Address (16-bits)};
\end{tikzpicture}
\caption{Short Valued Opcodes}
\end{figure}
\end{figure}
\section{Instructions}
\subsection{Add}
\OpcodeTable{01 /r /r}{add /r, /r}{Register}{Register}
\paragraph{Description} Sums \textit{Operand 1} and \textit{Operand 2} placing the result into \textit{Operand 1}.