Further refined some details about how ADD will work which will impact the way the rest of the processor will behave.

This commit is contained in:
Garritt McCune
2024-08-22 14:23:04 -05:00
parent c72b77ca19
commit efb8bf8883
2 changed files with 21 additions and 18 deletions
+18 -18
View File
@@ -52,22 +52,22 @@ Instructions are variable width with their total length being determined by the
\paragraph{Note} Figure \ref{fig:ModeSettingEncodingFigure} shows the options for the \textit{Mode} byte.
\end{figure}
\def\registerBit{0000}\def\registerBitA{1000}
\def\eightBit{0001}\def\eightBitA{1001}
\def\sixteenBit{0010}\def\sixteenBitA{1010}
\def\thirtyBit{0100}\def\thirtyBitA{1100}
\def\none{1111}
\def\registerBit{0}\def\registerBitA{8}
\def\eightBit{1}\def\eightBitA{9}
\def\sixteenBit{2}\def\sixteenBitA{A}
\def\thirtyBit{4}\def\thirtyBitA{C}
\def\none{F}
\begin{figure}
\begin{tabularx}{\textwidth}{ | X | X | X | }
\hline
Operand & Immediate Value & Value As Address \\
\hline
Register & \registerBit & \registerBitA \\
8-Bit & \eightBit & \eightBitA \\
16-Bit & \sixteenBit & \sixteenBitA \\
32-Bit & \thirtyBit & \thirtyBitA \\
None & \none & \none \\
Register & \xintCHexToBin{\registerBit} & \xintCHexToBin{\registerBitA} \\
8-Bit & \xintCHexToBin{\eightBit} & \xintCHexToBin{\eightBitA} \\
16-Bit & \xintCHexToBin{\sixteenBit} & \xintCHexToBin{\sixteenBitA} \\
32-Bit & \xintCHexToBin{\thirtyBit} & \xintCHexToBin{\thirtyBitA} \\
None & \xintCHexToBin{\none} & \xintCHexToBin{\none} \\
\hline
\end{tabularx}
\caption{Operand Modes Bit Pattern}
@@ -77,18 +77,18 @@ Instructions are variable width with their total length being determined by the
\section{Instructions}
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.
\subsection{Add}
\begin{tabularx}{\textwidth}{ | X | X | X | X | }
\begin{tabularx}{\textwidth}{ | X | X | c | c | }
\hline
Opcode & Instruction & Operand 1 & Operand 2 \\
Opcode & Instruction & Operand One & Operand Two \\
\hline
01 \registerBit~\registerBit & add /r /r & Register & Register \\
01 \eightBit~\registerBit & add /i8 /r & Immediate & Register \\
01 \sixteenBit~\registerBit & add /i16 /r & Immediate & Register \\
01 \thirtyBit~\registerBit & add /i32 /r & Immediate & Register \\
01 \registerBit\registerBit & add /r, /r & /r & /r \\
01 \eightBit\registerBit & add /i8, /r & /i8 & /r \\
01 \sixteenBit\registerBit & add /i16, /r & /i16 & /r \\
01 \thirtyBit\registerBit & add /i32, /r & /i32 & /r \\
\hline
\end{tabularx}
\paragraph{Description} Sums Operand 1 and Operand 2 placing the result into Operand 2 which must be a register.
\paragraph{Flags Affected} OF etc.
\paragraph{Description} Adds two unsigned values together; the source (operand one) and the destination (operand two) with the result stored in destination. The overflow flag (OF) is set if the result is less than the source and the zero flag (ZF) is set when the result of addition is zero.
\paragraph{Flags Affected} OF and ZF.
\subsection{Sub}
\OpcodeTable{01 /r /r}{sub /r, /r}{Register}{Register}{Subtracts \textit{Operand 1} and \textit{Operand 2} placing the result into \textit{Operand 1}.}
\subsection{Mul}
+3
View File
@@ -1,6 +1,8 @@
\documentclass[a4paper,12pt]{book}
\usepackage[dvipsnames]{xcolor}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{xintbinhex}
\usepackage[linkcolor=Aquamarine, linktoc=all, colorlinks=true]{hyperref}
\usepackage{tikz}
\usetikzlibrary{positioning}
@@ -16,6 +18,7 @@
{
% Prevent the table of contents from being colored
% https://tex.stackexchange.com/questions/88400/hyperref-changing-the-linkcolor-locally-in-the-toc
\hypersetup{linkcolor=black}
\tableofcontents
}