Created a basic setup for the figure for the memory layout / map.

This commit is contained in:
Garritt McCune
2025-02-04 15:17:13 -06:00
parent 472b9f839f
commit eba9778993
2 changed files with 15 additions and 2 deletions
+14 -2
View File
@@ -3,7 +3,7 @@ This is an attempt to distill what I know about how computers work into some kin
\section{Registers} \section{Registers}
Thirty-two general purpose registers are available for program code to use however it wishes. The base name for the general purpose registers is \quotes{r} follows by an unpadded number, such as \quotes{r28}. These numbers do not follow a zero-based index scheme, \quotes{r29} is the twenty-ninth register. Using the base name implies full width, a \quotes{word}, when reading or writing from or to the register respectively. Thirty-two general purpose registers are available for program code to use however it wishes. The base name for the general purpose registers is \quotes{r} follows by an unpadded number, such as \quotes{r28}. These numbers do not follow a zero-based index scheme, \quotes{r29} is the twenty-ninth register. Using the base name implies full width, a \quotes{word}, when reading or writing from or to the register respectively.
In addition to the general purpose registers there is also a base pointer (bp), stack pointer (sp) and an instruction pointer (ip). The base pointer and the stack pointer may be set directly using the \hyperref[sec:mov]{mov} instruction, which allows the programmer to set up a stack frame. The instruction pointer can only be set with a branching operation like \hyperref[sec:jmp]{jmp} or a call to a subroutine with the \hyperref[sec:call]{call} instruction. One final register that can only be indirectly set is the \quotes{flags} register. This register, like the others, is one word wide meaning it can store thirty-two flags. Currently only three flags are present, the Zero, Underflow and Overflow flags. These flags are only affected by arthmetic operations and generally read by branching instructions like \hyperref[sec:jmp]{jmp}. In addition to the general purpose registers there is also a base pointer (bp), stack pointer (sp) and an instruction pointer (ip). The base pointer and the stack pointer may be set directly using the \hyperref[sec:mov]{mov} instruction, which allows the programmer to set up a stack frame. The instruction pointer can only be set with a branching operation like \hyperref[sec:jmp]{jmp} or a call to a subroutine with the \hyperref[sec:call]{call} instruction. One final register that can only be indirectly set is the \quotes{flags} register. This register, like the others, is one word wide meaning it can store thirty-two flags. Currently only three flags are present, the Zero, Underflow and Overflow flags. These flags are only affected by arithmetic operations and generally read by branching instructions like \hyperref[sec:jmp]{jmp}.
\begin{figure}[h] \begin{figure}[h]
\begin{tikzpicture} \begin{tikzpicture}
@@ -51,4 +51,16 @@ In addition to the general purpose registers there is also a base pointer (bp),
\end{description} \end{description}
\section{Memory} \section{Memory}
The memory layout is quite simple, much like many modern machines it is a linear memory map. The address bus is thrity-two bits wide, the same width of the data bus, meaning at most there is 2\textsuperscript{32} of addressable memory. Like contemprary machines the top of memory starts at address 0x00000000 and grows downward toward 0xFFFFFFFF. The memory layout is quite simple, much like many modern machines it is a linear memory map. The address bus is thirty-two bits wide, the same width of the data bus, meaning at most there is 2\textsuperscript{32} of addressable memory. Like contemporary machines the top of memory starts at address 0x00000000 and grows downward toward 0xFFFFFFFF.
\begin{figure}
\begin{tikzpicture}
\node [draw, fit={(0,0) (3, 6)}] (memory) {};
\draw (memory);
\node (top) at (memory.north east)[right] {0x00000000};
\node at (memory.south east)[right] {0xFFFFFFFF};
\draw[dashed] ($(memory.north west)-(0,0.5)$) node[left] {0x20000} -- ($(memory.north east)-(0,0.5)$) node[midway, above] {Firmware};
\end{tikzpicture}
\end{figure}
+1
View File
@@ -9,6 +9,7 @@
\usetikzlibrary{positioning} \usetikzlibrary{positioning}
\usetikzlibrary{decorations.pathreplacing} \usetikzlibrary{decorations.pathreplacing}
\usetikzlibrary{fit} \usetikzlibrary{fit}
\usetikzlibrary{calc}
%\usepackage{showframe} % Good for debugging, uncomment to see the bounding boxes for the various sections of a page. %\usepackage{showframe} % Good for debugging, uncomment to see the bounding boxes for the various sections of a page.