changeset 41:a9bf262f557b

almost there
author james <jb302@eecs.qmul.ac.uk>
date Tue, 22 Apr 2014 00:57:06 +0100
parents 6b947f6d69d9
children 792da050d8c4
files docs/lyx/#dbg.lyx# docs/lyx/#emu.lyx# docs/lyx/asm.lyx docs/lyx/asm.lyx~ docs/lyx/dbg.lyx docs/lyx/dbg.lyx~ docs/lyx/emu.lyx docs/lyx/emu.lyx~ docs/lyx/review.lyx docs/lyx/review.lyx~
diffstat 10 files changed, 825 insertions(+), 149 deletions(-) [+]
line wrap: on
line diff
--- a/docs/lyx/#dbg.lyx#	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/#dbg.lyx#	Tue Apr 22 00:57:06 2014 +0100
@@ -1094,14 +1094,37 @@
 \end_layout
 
 \begin_layout Standard
+\begin_inset Newpage pagebreak
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
 Symbols are defined which map parts of the emulators memory to the encoding
  used in the control functions.
- Tables is provided below.
+ Tables are provided below.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Standard
 \begin_inset Tabular
-<lyxtabular version="3" rows="16" columns="2">
+<lyxtabular version="3" rows="17" columns="2">
 <features tabularvalignment="middle">
 <column alignment="center" valignment="top" width="0">
 <column alignment="center" valignment="top" width="0">
@@ -1150,7 +1173,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-R
+R1_0
 \end_layout
 
 \end_inset
@@ -1159,7 +1182,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+1
 \end_layout
 
 \end_inset
@@ -1170,7 +1193,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+R2_0
 \end_layout
 
 \end_inset
@@ -1179,7 +1202,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+2
 \end_layout
 
 \end_inset
@@ -1190,7 +1213,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+R3_0
 \end_layout
 
 \end_inset
@@ -1199,7 +1222,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+3
 \end_layout
 
 \end_inset
@@ -1210,7 +1233,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+DPH
 \end_layout
 
 \end_inset
@@ -1219,7 +1242,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+4
 \end_layout
 
 \end_inset
@@ -1230,7 +1253,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+SPH
 \end_layout
 
 \end_inset
@@ -1239,7 +1262,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+5
 \end_layout
 
 \end_inset
@@ -1250,7 +1273,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+PCH
 \end_layout
 
 \end_inset
@@ -1259,7 +1282,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+6
 \end_layout
 
 \end_inset
@@ -1270,7 +1293,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+TMPH
 \end_layout
 
 \end_inset
@@ -1279,7 +1302,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+7
 \end_layout
 
 \end_inset
@@ -1290,7 +1313,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+R0_1
 \end_layout
 
 \end_inset
@@ -1299,7 +1322,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+8
 \end_layout
 
 \end_inset
@@ -1310,7 +1333,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+R1_1
 \end_layout
 
 \end_inset
@@ -1319,7 +1342,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+9
 \end_layout
 
 \end_inset
@@ -1330,7 +1353,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+R2_1
 \end_layout
 
 \end_inset
@@ -1339,7 +1362,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+10
 \end_layout
 
 \end_inset
@@ -1350,7 +1373,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+R3_1
 \end_layout
 
 \end_inset
@@ -1359,7 +1382,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+11
 \end_layout
 
 \end_inset
@@ -1370,7 +1393,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+DPL
 \end_layout
 
 \end_inset
@@ -1379,7 +1402,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+12
 \end_layout
 
 \end_inset
@@ -1390,7 +1413,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+SPL
 \end_layout
 
 \end_inset
@@ -1399,7 +1422,27 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
+13
+\end_layout
 
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+PCL
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+14
 \end_layout
 
 \end_inset
@@ -1410,7 +1453,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+TMPL
 \end_layout
 
 \end_inset
@@ -1419,7 +1462,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-
+15
 \end_layout
 
 \end_inset
@@ -1429,6 +1472,196 @@
 
 \end_inset
 
+ 
+\begin_inset Tabular
+<lyxtabular version="3" rows="9" columns="2">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="center" valignment="top" width="0">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Flag
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Encoding
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+BS
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+0
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+IE
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+1
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+OV
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+2
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+S
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+3
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+P
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+4
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+AC
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+5
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Z
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+6
+\end_layout
+
+\end_inset
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+C
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+7
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
 
 \end_layout
 
@@ -1436,5 +1669,16 @@
 Debugger Testing
 \end_layout
 
+\begin_layout Standard
+The debugger was tested with an automated test method using python scripting.
+ The script uses the debug controller class to fill all of the emulators
+ memory structures with known values.
+ It then requests these values back and compares the results, if the values
+ are not the same the test fails.
+ The test then steps through the emulators entire memory space, and then
+ checks the program counter to see if it has reached the end.
+ The test files and results can be found in the Supporting Material.
+\end_layout
+
 \end_body
 \end_document
--- a/docs/lyx/#emu.lyx#	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/#emu.lyx#	Tue Apr 22 00:57:06 2014 +0100
@@ -1881,22 +1881,7 @@
 
 \begin_layout Plain Layout
 
-	get PC
-\end_layout
-
-\begin_layout Plain Layout
-
-	if PC is a break point:
-\end_layout
-
-\begin_layout Plain Layout
-
-		end
-\end_layout
-
-\begin_layout Plain Layout
-
-	else:
+	while PC is not a break point:
 \end_layout
 
 \begin_layout Plain Layout
@@ -1906,6 +1891,11 @@
 
 \begin_layout Plain Layout
 
+	end
+\end_layout
+
+\begin_layout Plain Layout
+
 \end_layout
 
 \begin_layout Plain Layout
@@ -2335,6 +2325,22 @@
 \end_layout
 
 \begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
 According to the program Cdecl, in 
 \begin_inset Quotes eld
 \end_inset
@@ -2355,6 +2361,22 @@
 \end_layout
 
 \begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
 The number of the pointers position in the table is the opcode for the instructi
 on that the function being pointed to deals with.
 \end_layout
@@ -3365,7 +3387,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3387,7 +3409,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3421,7 +3443,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3461,7 +3483,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3472,7 +3494,7 @@
 
 \begin_layout Plain Layout
 
-	putchar(c); 
+    putchar(c); 
 \end_layout
 
 \begin_layout Plain Layout
@@ -3492,33 +3514,33 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
 \begin_layout Plain Layout
 
-SCON  = 0x50;     * SCON - mode 1, 8-bit UART, enable rcvr 
-\end_layout
-
-\begin_layout Plain Layout
-
-TMOD |= 0x20;     * TMOD - timer 1, mode 2, 8-bit reload 
-\end_layout
-
-\begin_layout Plain Layout
-
-TH1   = 0xE8;     * TH1 - reload value for 1200 baud @ 12MHz 
-\end_layout
-
-\begin_layout Plain Layout
-
-TR1   = 1;        * TR1 - timer 1 run 
-\end_layout
-
-\begin_layout Plain Layout
-
-TI    = 1;        * TI - set TI to send first char of UART */ 
+SCON  = 0x50; * SCON - mode 1, 8-bit UART, enable rcvr 
+\end_layout
+
+\begin_layout Plain Layout
+
+TMOD |= 0x20; * TMOD - timer 1, mode 2, 8-bit reload 
+\end_layout
+
+\begin_layout Plain Layout
+
+TH1   = 0xE8; * TH1 - reload value for 1200 baud@12MHz 
+\end_layout
+
+\begin_layout Plain Layout
+
+TR1   = 1;    * TR1 - timer 1 run 
+\end_layout
+
+\begin_layout Plain Layout
+
+TI    = 1;    * TI - set TI to send first char of UART
 \end_layout
 
 \end_inset
@@ -3537,9 +3559,155 @@
  halved and declared to exist in external data memory.
 \end_layout
 
+\begin_layout Standard
+On the PC:
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},language=C"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+BYTE mem[0x10000]; 
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+On the 8052
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},language=C"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+BYTE xdata mem[0x8000]; 
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset Newpage pagebreak
+\end_inset
+
+
+\end_layout
+
 \begin_layout Section
 Emulator Testing
 \end_layout
 
+\begin_layout Standard
+The assemblers memory structures and access functions were tested by using
+ the access function to set the memory structures to know values, and then
+ request the values back and write them to a file.
+ The file was then inspected by hand.
+ The test files and results can be found in the Supporting Material.
+ 
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The emulator could be more rigorously tested in conjunction with the debugger
+ and assembler.
+ Below is a pseudo-code representation of an automated test procedure that
+ could be implemented with the debug class in python.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+for instruction in instruction set:
+\end_layout
+
+\begin_layout Plain Layout
+
+	get PC
+\end_layout
+
+\begin_layout Plain Layout
+
+	assemble instruction
+\end_layout
+
+\begin_layout Plain Layout
+
+	write instruction at PC
+\end_layout
+
+\begin_layout Plain Layout
+
+	execute instruction
+\end_layout
+
+\begin_layout Plain Layout
+
+	
+\end_layout
+
+\begin_layout Plain Layout
+
+	if expected 
+\end_layout
+
+\begin_layout Plain Layout
+
+	
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
 \end_body
 \end_document
--- a/docs/lyx/asm.lyx	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/asm.lyx	Tue Apr 22 00:57:06 2014 +0100
@@ -1708,5 +1708,14 @@
 Assembler Testing
 \end_layout
 
+\begin_layout Standard
+The assembler was tested by assembling the entire instruction table, while
+ at the same time testing labels and directives.
+ The test file was assembled and then the binary and .dsm files were inspected
+ manually by checking their size and content.
+ None of the this testing is automated and files are inspected by hand.
+ The test files and results can be found in the Supporting Material
+\end_layout
+
 \end_body
 \end_document
--- a/docs/lyx/asm.lyx~	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/asm.lyx~	Tue Apr 22 00:57:06 2014 +0100
@@ -242,12 +242,24 @@
 \end_layout
 
 \begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
 
 \end_layout
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},captionpos=b,frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},tabsize=4"
+lstparams "basicstyle={\ttfamily},captionpos=b,keywordstyle={\color{blue}},tabsize=4"
 inline false
 status open
 
--- a/docs/lyx/dbg.lyx	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/dbg.lyx	Tue Apr 22 00:57:06 2014 +0100
@@ -1669,5 +1669,16 @@
 Debugger Testing
 \end_layout
 
+\begin_layout Standard
+The debugger was tested with an automated test method using python scripting.
+ The script uses the debug controller class to fill all of the emulators
+ memory structures with known values.
+ It then requests these values back and compares the results, if the values
+ are not the same the test fails.
+ The test then steps through the emulators entire memory space, and then
+ checks the program counter to see if it has reached the end.
+ The test files and results can be found in the Supporting Material.
+\end_layout
+
 \end_body
 \end_document
--- a/docs/lyx/dbg.lyx~	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/dbg.lyx~	Tue Apr 22 00:57:06 2014 +0100
@@ -1103,7 +1103,7 @@
 \begin_layout Standard
 Symbols are defined which map parts of the emulators memory to the encoding
  used in the control functions.
- Tables is provided below.
+ Tables are provided below.
 \end_layout
 
 \begin_layout Standard
--- a/docs/lyx/emu.lyx	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/emu.lyx	Tue Apr 22 00:57:06 2014 +0100
@@ -3387,7 +3387,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3409,7 +3409,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3443,7 +3443,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3483,7 +3483,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3514,33 +3514,33 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
 \begin_layout Plain Layout
 
-SCON  = 0x50;     * SCON - mode 1, 8-bit UART, enable rcvr 
-\end_layout
-
-\begin_layout Plain Layout
-
-TMOD |= 0x20;     * TMOD - timer 1, mode 2, 8-bit reload 
-\end_layout
-
-\begin_layout Plain Layout
-
-TH1   = 0xE8;     * TH1 - reload value for 1200 baud @ 12MHz 
-\end_layout
-
-\begin_layout Plain Layout
-
-TR1   = 1;        * TR1 - timer 1 run 
-\end_layout
-
-\begin_layout Plain Layout
-
-TI    = 1;        * TI - set TI to send first char of UART */ 
+SCON  = 0x50; * SCON - mode 1, 8-bit UART, enable rcvr 
+\end_layout
+
+\begin_layout Plain Layout
+
+TMOD |= 0x20; * TMOD - timer 1, mode 2, 8-bit reload 
+\end_layout
+
+\begin_layout Plain Layout
+
+TH1   = 0xE8; * TH1 - reload value for 1200 baud@12MHz 
+\end_layout
+
+\begin_layout Plain Layout
+
+TR1   = 1;    * TR1 - timer 1 run 
+\end_layout
+
+\begin_layout Plain Layout
+
+TI    = 1;    * TI - set TI to send first char of UART
 \end_layout
 
 \end_inset
@@ -3565,7 +3565,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},language=C"
 inline false
 status open
 
@@ -3585,7 +3585,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},language=C"
 inline false
 status open
 
@@ -3610,5 +3610,143 @@
 Emulator Testing
 \end_layout
 
+\begin_layout Standard
+The assemblers memory structures and access functions were tested by using
+ the access function to set the memory structures to know values, and then
+ request the values back and write them to a file.
+ The file was then inspected by hand.
+ The test files and results can be found in the Supporting Material.
+ 
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The emulator could be more rigorously tested in conjunction with the debugger
+ and assembler.
+ Below is a pseudo-code representation of an automated test procedure that
+ could be implemented with the debug class in python.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+for instruction in instruction set:
+\end_layout
+
+\begin_layout Plain Layout
+
+	reset emulator memory state
+\end_layout
+
+\begin_layout Plain Layout
+
+	assemble instruction
+\end_layout
+
+\begin_layout Plain Layout
+
+	write instruction to memory
+\end_layout
+
+\begin_layout Plain Layout
+
+	execute instruction
+\end_layout
+
+\begin_layout Plain Layout
+
+	
+\end_layout
+
+\begin_layout Plain Layout
+
+	get all registers
+\end_layout
+
+\begin_layout Plain Layout
+
+	get all flags
+\end_layout
+
+\begin_layout Plain Layout
+
+	get any affected memory cells
+\end_layout
+
+\begin_layout Plain Layout
+
+\end_layout
+
+\begin_layout Plain Layout
+
+	if and only if expected register changes occoured:
+\end_layout
+
+\begin_layout Plain Layout
+
+		register test passed
+\end_layout
+
+\begin_layout Plain Layout
+
+	if and only if expected flag changes occoured:
+\end_layout
+
+\begin_layout Plain Layout
+
+		flag test passed
+\end_layout
+
+\begin_layout Plain Layout
+
+	if expected memory modification occoured:
+\end_layout
+
+\begin_layout Plain Layout
+
+		memory test passed
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
 \end_body
 \end_document
--- a/docs/lyx/emu.lyx~	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/emu.lyx~	Tue Apr 22 00:57:06 2014 +0100
@@ -1881,22 +1881,7 @@
 
 \begin_layout Plain Layout
 
-	get PC
-\end_layout
-
-\begin_layout Plain Layout
-
-	if PC is a break point:
-\end_layout
-
-\begin_layout Plain Layout
-
-		end
-\end_layout
-
-\begin_layout Plain Layout
-
-	else:
+	while PC is not a break point:
 \end_layout
 
 \begin_layout Plain Layout
@@ -1906,6 +1891,11 @@
 
 \begin_layout Plain Layout
 
+	end
+\end_layout
+
+\begin_layout Plain Layout
+
 \end_layout
 
 \begin_layout Plain Layout
@@ -3397,7 +3387,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3419,7 +3409,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3453,7 +3443,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3493,7 +3483,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
@@ -3524,33 +3514,33 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,language=C"
 inline false
 status open
 
 \begin_layout Plain Layout
 
-SCON  = 0x50;     * SCON - mode 1, 8-bit UART, enable rcvr 
-\end_layout
-
-\begin_layout Plain Layout
-
-TMOD |= 0x20;     * TMOD - timer 1, mode 2, 8-bit reload 
-\end_layout
-
-\begin_layout Plain Layout
-
-TH1   = 0xE8;     * TH1 - reload value for 1200 baud @ 12MHz 
-\end_layout
-
-\begin_layout Plain Layout
-
-TR1   = 1;        * TR1 - timer 1 run 
-\end_layout
-
-\begin_layout Plain Layout
-
-TI    = 1;        * TI - set TI to send first char of UART */ 
+SCON  = 0x50; * SCON - mode 1, 8-bit UART, enable rcvr 
+\end_layout
+
+\begin_layout Plain Layout
+
+TMOD |= 0x20; * TMOD - timer 1, mode 2, 8-bit reload 
+\end_layout
+
+\begin_layout Plain Layout
+
+TH1   = 0xE8; * TH1 - reload value for 1200 baud@12MHz 
+\end_layout
+
+\begin_layout Plain Layout
+
+TR1   = 1;    * TR1 - timer 1 run 
+\end_layout
+
+\begin_layout Plain Layout
+
+TI    = 1;    * TI - set TI to send first char of UART
 \end_layout
 
 \end_inset
@@ -3575,7 +3565,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},language=C"
 inline false
 status open
 
@@ -3595,7 +3585,7 @@
 
 \begin_layout Standard
 \begin_inset listings
-lstparams "basicstyle={\ttfamily},language=C"
+lstparams "basicstyle={\ttfamily},frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},language=C"
 inline false
 status open
 
@@ -3620,5 +3610,51 @@
 Emulator Testing
 \end_layout
 
+\begin_layout Standard
+The assemblers memory structures and access functions were tested by using
+ the access function to set the memory structures to know values, and then
+ request the values back and write them to a file.
+ The file was then inspected by hand.
+ The test files and results can be found in the Supporting Material.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
+\begin_layout Standard
+The emulator could be more rigorously tested in conjunction with the debugger.
+ Below is a pseudo-code representation of an automated test procedure that
+ could be implemented with the debug class in python.
+\end_layout
+
+\begin_layout Standard
+\begin_inset ERT
+status open
+
+\begin_layout Plain Layout
+
+
+\backslash
+bigskip
+\end_layout
+
+\end_inset
+
+
+\end_layout
+
 \end_body
 \end_document
--- a/docs/lyx/review.lyx	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/review.lyx	Tue Apr 22 00:57:06 2014 +0100
@@ -141,16 +141,22 @@
 
 \end_deeper
 \begin_layout Enumerate
-Complete testing of emulator.
+Improve testing
 \end_layout
 
 \begin_deeper
 \begin_layout Enumerate
-Before any more emulator code is added, the instructions that have already
+Complete testing of emulator.
+ Before any more emulator code is added, the instructions that have already
  been implemented should be tested using something similar to the test method
  outlined in the Emulator Testing section
 \end_layout
 
+\begin_layout Enumerate
+Implement automated testing for the assembler to remove the need to inspect
+ files by eye.
+\end_layout
+
 \end_deeper
 \begin_layout Enumerate
 Develop emulated peripheral and peripheral driver code.
--- a/docs/lyx/review.lyx~	Tue Apr 22 00:21:59 2014 +0100
+++ b/docs/lyx/review.lyx~	Tue Apr 22 00:57:06 2014 +0100
@@ -131,7 +131,59 @@
  However the Python debug class can currently only interact with a file
  buffer for I/O.
  The debuggers send and receive functions need to be modified to deal with
- 
+ a serial buffer
+\end_layout
+
+\begin_layout Enumerate
+An option to enable this mode needs to be added to the command line interface
+ code
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+Complete testing of emulator.
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+Before any more emulator code is added, the instructions that have already
+ been implemented should be tested using something similar to the test method
+ outlined in the Emulator Testing section
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+Develop emulated peripheral and peripheral driver code.
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+Emulated peripherals such as an interrupt controller, timer and parallel
+ port I/O need to be developed.
+ They should be introduced as new modules to the PC build of the emulator.
+ The emulators main.c file will need to be updated to add them to the main
+ execution loop.
+\end_layout
+
+\begin_layout Enumerate
+Peripheral drivers need to be developed for the Intel MCS-51 build, These
+ drivers could be quite specific to the exact development board and/or 8052
+ implementation that is being used.
+ The current Intel MCS-51 build of the emulator uses 4135 bytes of code
+ memory and 56 bytes of RAM.
+ 8k ROM and 256 bytes of RAM this leaves almost half the available ROM and
+ 200 bytes of RAM for peripheral drivers to be integrated.
+\end_layout
+
+\end_deeper
+\begin_layout Enumerate
+Add the ability to handle segments and macros to the assembler.
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+The ELB816 specification document details how these should work, there is
+ no reason the assembler could not be modified to deal with them.
 \end_layout
 
 \end_deeper