From 05adb3d0c9f47302d906290ecd304aab1814cba3 Mon Sep 17 00:00:00 2001 From: Garritt McCune Date: Tue, 10 Sep 2024 23:29:43 -0500 Subject: [PATCH] Added a few more instructions. --- chapter 2.tex | 60 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/chapter 2.tex b/chapter 2.tex index 8317e42..7791437 100644 --- a/chapter 2.tex +++ b/chapter 2.tex @@ -401,4 +401,64 @@ The /r represents a byte that specifies a register. /immX is for the immediate d \hline \end{tabularx} \paragraph{Description} Registers a 1024 byte block of memory starting at \textit{operand one} as the Interrupt Vector Table. + \paragraph{Flags Affected} None. +\subsection{PUSHA} + \begin{tabularx}{\textwidth}{ | c | X | c | c | } + \hline + Opcode & Instruction & Operand One & Operand Two \\ + \hline + 19 & pusha & None & None \\ + \hline + \end{tabularx} + \paragraph{Description} Pushes all general purpose registers to the stack in order starting from \textit{r1} to \textit{r8}. + \paragraph{Flags Affected} None. +\subsection{POPA} + \begin{tabularx}{\textwidth}{ | c | X | c | c | } + \hline + Opcode & Instruction & Operand One & Operand Two \\ + \hline + 20 & popa & None & None \\ + \hline + \end{tabularx} + \paragraph{Description} Pops all general purpose registers from the stack, restoring them, in the reverse order of \textit{r8} to \textit{r1}. + \paragraph{Flags Affected} None. +\subsection{CALL} + \begin{tabularx}{\textwidth}{ | c | X | c | c | } + \hline + Opcode & Instruction & Operand One & Operand Two \\ + \hline + 21 & call & None & None \\ + \hline + \end{tabularx} + \paragraph{Description} Calls a subroutine pushing the Program Counter (PC), plus one to return execution to the next opcode, to the stack. + \paragraph{Flags Affected} None. +\subsection{RET} + \begin{tabularx}{\textwidth}{ | c | X | c | c | } + \hline + Opcode & Instruction & Operand One & Operand Two \\ + \hline + 22 & ret & None & None \\ + \hline + \end{tabularx} + \paragraph{Description} Returns from the subroutine, popping the stack to restore the return address into the Program Counter (PC). + \paragraph{Flags Affected} None. +\subsection{PUSH} + \begin{tabularx}{\textwidth}{ | c | X | c | c | } + \hline + Opcode & Instruction & Operand One & Operand Two \\ + \hline + 23 & push /r & /r & None \\ + \hline + \end{tabularx} + \paragraph{Description} Pushes the contents of register \textit{Operand One} onto the top of the stack. + \paragraph{Flags Affected} None. +\subsection{POP} + \begin{tabularx}{\textwidth}{ | c | X | c | c | } + \hline + Opcode & Instruction & Operand One & Operand Two \\ + \hline + 24 & pop /r & /r & None \\ + \hline + \end{tabularx} + \paragraph{Description} Pops 32-bits from the top of the stack into the register \textit{Operand One}. \paragraph{Flags Affected} None. \ No newline at end of file