Added a little more about the registers and tweaked the code for the register bit layout figure.
This commit is contained in:
+20
-1
@@ -1,2 +1,21 @@
|
|||||||
\chapter{Overview}
|
\chapter{Overview}
|
||||||
This is an attempt to distill what I know about how computers work into some kind of emulator / simulator. I'm curious to see if what I know at the moment is enough to allow me to emulate a general purpose computer.
|
This is an attempt to distill what I know about how computers work into some kind of emulator / simulator. I'm curious to see if what I know at the moment is enough to allow me to emulate a general purpose computer. A computer that will be big-endian, using 8-bit bytes for its char type. The memory is a 32 bit linear address space allowing for a maximum of 2\textsuperscript{32} bytes to be addressable.
|
||||||
|
\section{Registers}
|
||||||
|
Eight 32-bit general purpose registers are available for holding operands and memory addresses along with a Flags Register. The Flags Register is a 32-bit register allowing for 32 flags. Currently there are only arithmetic flags which are Overflow (OF), Underflow (UF), and a Zero Flag (ZF). The overflow flag is set if there is a carry. A base pointer register contains a 32 bit address that points to the start of the current stack frame, which is the first opcode of the stack frame. Therefore the first argument would be addressed as such: mov r1, bp - sizeof(void *). Finally we have the Program Counter which contains a 32 bit address that contains the next instruction to execute.
|
||||||
|
\tikzstyle{blockRow} = [rectangle, minimum width=10cm, minimum height=0.5cm, text centered, draw=black]
|
||||||
|
%Note: tikzset might be better to use instead of tikzstyle.
|
||||||
|
\begin{figure}[!htb]
|
||||||
|
\centering
|
||||||
|
\begin{tikzpicture}
|
||||||
|
\node at (0, 0) {31};
|
||||||
|
%\node at (0, )
|
||||||
|
\foreach \pos in {1,...,8} {
|
||||||
|
%\node at (0, \pos + 1) [blockRow] (\pos) {\pos};
|
||||||
|
\node at (0, \pos) [blockRow] {r\pos};
|
||||||
|
;}
|
||||||
|
%\node [blockRow] (start) {r1};
|
||||||
|
%\node (r2) [blockRow] [below=of start] {r2};
|
||||||
|
\end{tikzpicture}
|
||||||
|
\caption{Register Bit Layout}
|
||||||
|
\end{figure}
|
||||||
|
\section{Memory Layout}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
\documentclass[a4paper,12pt]{book}
|
\documentclass[a4paper,12pt]{book}
|
||||||
\usepackage{tikz}
|
\usepackage{tikz}
|
||||||
|
\usetikzlibrary{positioning}
|
||||||
\usepackage{hyperref}
|
\usepackage{hyperref}
|
||||||
\hypersetup{
|
\hypersetup{
|
||||||
linktoc=all
|
linktoc=all
|
||||||
|
|||||||
Reference in New Issue
Block a user