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
+20 -1
View File
@@ -1,9 +1,23 @@
\chapter{Instruction Set Architecture} \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\minY{0} \def\maxY{0.5}
\def\minX{-7} \def\maxX{7} \def\minX{-7} \def\maxX{7}
\usetikzlibrary{decorations.pathreplacing} \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{figure}[!htb]
\begin{tikzpicture} \begin{tikzpicture}
\draw (\minX, \minY) -- (\maxX, \minY); \draw (\minX, \minY) -- (\maxX, \minY);
@@ -29,3 +43,8 @@
\end{tikzpicture} \end{tikzpicture}
\caption{Short Valued Opcodes} \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}.
+1 -10
View File
@@ -1,4 +1,5 @@
\documentclass[a4paper,12pt]{book} \documentclass[a4paper,12pt]{book}
\usepackage{tabularx}
\usepackage{tikz} \usepackage{tikz}
\usetikzlibrary{positioning} \usetikzlibrary{positioning}
\usepackage{hyperref} \usepackage{hyperref}
@@ -16,13 +17,3 @@
\include{chapter 2} \include{chapter 2}
\end{document} \end{document}
\newcommand{\OpcodeTable}[5] {
\begin{tabular}{ c c c c c }
\hline
Opcode & Bit Pattern & Mnemonic & Operand 1 & Operand 2 \\
\hline\hline
#1 & #2 & #3 & #4 & #5 \\
\hline
\end{tabular}
}