From 8c0de609b57aea3be022f870a30310efd91667ac Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Thu, 8 Aug 2024 15:44:15 -0500 Subject: [PATCH] Updated the description about the ISA's encoding scheme since it is no longer fixed width. --- chapter 2.tex | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/chapter 2.tex b/chapter 2.tex index b2f179c..f7daacc 100644 --- a/chapter 2.tex +++ b/chapter 2.tex @@ -18,21 +18,24 @@ \def\minX{-7} \def\maxX{7} \section{Encoding Scheme} -All instructions are a fixed width of 32-bits. There are two basic encoding schemes that the object code will take. The most basic layout is shown in Figure \ref{fig:OpShortEncodingFigure} that is used by instructions that take one or zero arguments, where the 16 most significant bits are used to encode the instruction itself. Followed by the 16 least significant bits being used to encode a numeric constant that may be interpreted as a relative address. For instructions that require two arguments the encoding scheme shown in Figure \ref{fig:OpArgEncodingFigure} is used. +Instructions are variable width with their total length being determined by the mode setting byte that immediately follows the opcode byte. A break down of what a nibble means in the mode setting byte can be found in Figure \ref{fig:ModeSettingEncodingFigure}. Figure \ref{fig:opencoding} shows the layout of an instruction with the mode setting byte split down the middle to indicate the top nibble defines what \textit{Operand One} is meant to be interpreted as, followed by the lower nibble for \textit{Operand Two}. Depending on what mode is set for each operand there may be no bytes to follow the instruction (like in the case of nop) or there may be 8 bytes to follow (like in the case of mov [address], [address], assuming absolute addresses). % Placement info here: https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures % Paths: https://tikz.dev/tikz-paths -\begin{figure} +\begin{figure}[h] \begin{tikzpicture} + %Opcode Byte \draw (-8, 0) -- (-4, 0) node[midway, below=1em] {Opcode}; \draw (-8, -0.25) -- (-8, 0.25) node[above] {7}; \draw (-4, -0.25) -- (-4, 0.25) node[above] {0}; + %Mode Setting Byte \draw (-3.75, 0) -- (0, 0) node[midway, below=1em] {Mode Setting}; \draw (-1.9, -0.25) -- (-1.9, 0.25) node[above] {3}; - \draw (-3.75, -0.25) node[below] {7} -- (-3.75, 0.25); - \draw (0, -0.25) node[below] {0} -- (0, 0.25); + \draw (-3.75, -0.25) node[below] {7} -- (-3.75, 0.25) node[right] {Op. One}; + \draw (0, -0.25) node[below] {0} -- (0, 0.25) node[left] {Op. Two}; \end{tikzpicture} \caption{Encoding} \label{fig:opencoding} % https://www.overleaf.com/learn/latex/Referencing_Figures + \paragraph{Note} The \textit{Mode Setting} byte is split into an upper nibble and a lower nibble which will contain any of the values shown in Figure \ref{fig:ModeSettingEncodingFigure}. \end{figure} \begin{figure} @@ -51,7 +54,6 @@ All instructions are a fixed width of 32-bits. There are two basic encoding sche \label{fig:ModeSettingEncodingFigure} % https://www.overleaf.com/learn/latex/Referencing_Figures \end{figure} - \begin{figure} \begin{tikzpicture} \draw (\minX, 0) -- (\maxX, 0);