diff --git a/chapter 1.tex b/chapter 1.tex index dde6d6c..49be40f 100644 --- a/chapter 1.tex +++ b/chapter 1.tex @@ -9,7 +9,7 @@ Finally we have the Program Counter which contains a 32 bit address that points \def\minY{-5} \def\maxY{5} \def\minX{-5} \def\maxX{5} -\begin{figure}[h] +\begin{figure}[ht] \centering \begin{tikzpicture}[node distance=0cm] \node [draw, fit={(\minX, 1.0) (0, 1.5)}, label=center:Program Counter] (pc) {}; diff --git a/chapter 2.tex b/chapter 2.tex index 00636ee..dcd5899 100644 --- a/chapter 2.tex +++ b/chapter 2.tex @@ -24,7 +24,7 @@ Instructions are variable width with their total length being determined by the % Placement info here: https://en.wikibooks.org/wiki/LaTeX/Floats,_Figures_and_Captions#Figures % Paths: https://tikz.dev/tikz-paths -\begin{figure}[h] +\begin{figure}[ht] \begin{tikzpicture} %Opcode Byte \draw (\minX, 0) -- (\lnWidth, 0) node[midway, below=1em] {Opcode}; @@ -44,12 +44,12 @@ Instructions are variable width with their total length being determined by the %Operand Two \draw (\lnWidth * 3, 0) -- (\lnWidth * 4, 0) node[midway, below=1em] (OperTwoLabel) {Operand Two}; \draw (\lnWidth * 3, \minY) -- (\lnWidth * 3, \maxY) node[above] {31/15/7} node[above=1.5em] {Operand Widths Based on Mode}; - \draw (\lnWidth * 4, \minY) node[below] {0} -- (\lnWidth * 4, \maxY); + \draw (\textwidth, \minY) node[below] {0} -- (\textwidth, \maxY); \draw node[below of=OperTwoLabel] {(if required)}; \end{tikzpicture} \caption{Encoding} \label{fig:opencoding} % https://www.overleaf.com/learn/latex/Referencing_Figures - \paragraph{Note} The \textit{Mode} byte is split into an upper nibble and a lower nibble which will contain any of the values shown in Figure \ref{fig:ModeSettingEncodingFigure}. + \paragraph{Note} Figure \ref{fig:ModeSettingEncodingFigure} shows the options for the \textit{Mode} byte. \end{figure} \def\register{0000}\def\registerA{1000} @@ -77,7 +77,7 @@ 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} -\OpcodeTable{01 /m /r /r}{add /r, /r}{Register}{Register}{Sums \textit{Operand 1} and \textit{Operand 2} placing the result into \textit{Operand 2}.} +\OpcodeTable{01 /m /r /r}{add /r, /r}{Register}{Register}{Sums Operand 1 and Operand 2 placing the result into Operand 2.} \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} @@ -121,11 +121,11 @@ The /r represents a byte that specifies a register. /iX is for the immediate dat \subsection{HLT} \OpcodeTable{01}{hlt}{None}{None}{Halts the processor until a new interrupt is received.} -\subsection{CLI} +\subsection{CLI}\label{sec:cli} \OpcodeTable{01}{cli}{None}{None}{Clears the interrupt flag preventing the processor from receiving interrupts.} -\subsection{ENI} +\subsection{ENI}\label{sec:eni} \OpcodeTable{01}{eni}{None}{None}{Sets the interrupt flag allowing the processor to receive interrupts.} -\subsection{INT}\label{int} +\subsection{INT}\label{sec:int} \OpcodeTable{01 /i8}{int /i8}{Immediate}{None}{Triggers software interrupt number \textit{Operand 1}.} -\subsection{LIVT}\label{livt} +\subsection{LIVT}\label{sec:livt} \OpcodeTable{00 /mod /i32}{livt /i32}{Immediate}{None}{Installs the Interrupt Vector Table located at memory address \textit{Operand 1}.} \ No newline at end of file diff --git a/chapter 3.tex b/chapter 3.tex index 7cf9684..381126c 100644 --- a/chapter 3.tex +++ b/chapter 3.tex @@ -1,5 +1,5 @@ \chapter{Interrupts} -Interrupts are signals sent to the processor via the I/O pin, software interrupt (via the \ref{int} instruction) or by the processor detecting a fault (divide by zero for instance). When an interrupt occurs the processor will index the Interrupt Vector Table whose location is provided by the livt \ref{livt} instruction. +Interrupts are signals sent to the processor via the I/O pin, software interrupt (via the \hyperref[sec:int]{int} instruction) or by the processor detecting a fault (divide by zero for instance). When an interrupt occurs the processor will index the Interrupt Vector Table whose location is provided by the \hyperref[sec:livt]{livt} instruction. \paragraph{Unknown Opcode} Interrupt 0. Pushes status flags and clears interrupts. diff --git a/document.tex b/document.tex index f8b8baa..3173f04 100644 --- a/document.tex +++ b/document.tex @@ -1,20 +1,25 @@ \documentclass[a4paper,12pt]{book} +\usepackage[dvipsnames]{xcolor} \usepackage{tabularx} +\usepackage[linkcolor=Aquamarine, linktoc=all, colorlinks=true]{hyperref} \usepackage{tikz} \usetikzlibrary{positioning} \usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{fit} -\usepackage{hyperref} -\hypersetup{ - linktoc=all -} + +%\usepackage{showframe} % Good for debugging, uncomment to see the bounding boxes for the various sections of a page. \begin{document} \title{Unnamed Machine} \author{An attempt to understand the makings of a computer arch} \maketitle - \tableofcontents + { + % Prevent the table of contents from being colored + \hypersetup{linkcolor=black} + \tableofcontents + } + \include{chapter 1} \include{chapter 2} \include{chapter 3}