changeset 40:6b947f6d69d9

more docs and last minute bug fixes
author james <jb302@eecs.qmul.ac.uk>
date Tue, 22 Apr 2014 00:21:59 +0100
parents 0f3bd942a7d4
children a9bf262f557b
files asm/asm.py asm/asm.pyc cli.py dbg/dbg.py dbg/dbg.pyc docs/lyx/#dbg.lyx# docs/lyx/#review.lyx# docs/lyx/dbg.lyx docs/lyx/dbg.lyx~ docs/lyx/intro.lyx docs/lyx/intro.lyx~ docs/lyx/review.lyx docs/lyx/review.lyx~ out tests/asm/full tests/asm/full.asm tests/asm/full.dsm utils/test.c
diffstat 17 files changed, 3122 insertions(+), 265 deletions(-) [+]
line wrap: on
line diff
--- a/asm/asm.py	Mon Apr 21 19:37:21 2014 +0100
+++ b/asm/asm.py	Tue Apr 22 00:21:59 2014 +0100
@@ -118,6 +118,12 @@
                 asm.append([mne, args, ('',), const])
                 pc = pc + len(const)
                 continue
+            elif mne == 'ds':
+                asm.append([mne, args, ('',), ''])
+                pc = pc + stoi(args[0])
+                continue
+
+
             
             # tokenize
             sym, const = tokenize(mne, args)
@@ -153,6 +159,9 @@
                 f.write(const)
                 pc = pc + len(const)
                 continue
+            elif mne == 'ds':
+                pc = pc + stoi(args[0])
+                continue
             
             # replace labels with addresses
             i = 0
Binary file asm/asm.pyc has changed
--- a/cli.py	Mon Apr 21 19:37:21 2014 +0100
+++ b/cli.py	Tue Apr 22 00:21:59 2014 +0100
@@ -3,6 +3,7 @@
 #          the debug control class
 
 import struct
+import sys
 from StringIO import StringIO
 from io import BytesIO
 from subprocess import Popen, PIPE, STDOUT
@@ -45,6 +46,7 @@
 # command line command strings
 cmds = {
         'step':emu.step,
+        'frun':emu.free_run,
         'run':emu.run,
         'runl':emu.run_len,
         'gr':emu.get_reg,
@@ -146,6 +148,13 @@
 
 
 if __name__ == '__main__':
+    try:
+        with open(sys.argv[1], 'rb') as f:
+            prog = bytearray(f.read())
+            emu.set_block(0, 0, prog)
+    except IndexError:
+        pass
+
     while True:
         req_run()
 
--- a/dbg/dbg.py	Mon Apr 21 19:37:21 2014 +0100
+++ b/dbg/dbg.py	Tue Apr 22 00:21:59 2014 +0100
@@ -10,16 +10,18 @@
     
     def __init__(self):
         self.Emu = None
+        self.snd = self.snd_file
+        self.rcv = self.rcv_file
         open('out', 'w').close()
     
     # Alternetive snd and rcv functions need to be
     # written read/write using serial buffer to make
     # this class talk to an emulator running on
     # an MCU
-    def snd(self, m):
+    def snd_file(self, m):
         self.Emu.stdin.write(struct.pack('>B', m))
 
-    def rcv(self, l):
+    def rcv_file(self, l):
         lc = 0
         while lc != l:
             lc = os.path.getsize('out')
Binary file dbg/dbg.pyc has changed
--- a/docs/lyx/#dbg.lyx#	Mon Apr 21 19:37:21 2014 +0100
+++ b/docs/lyx/#dbg.lyx#	Tue Apr 22 00:21:59 2014 +0100
@@ -233,7 +233,7 @@
 \begin_inset Text
 
 \begin_layout Plain Layout
-byte, length
+length
 \end_layout
 
 \end_inset
@@ -664,8 +664,8 @@
 \end_layout
 
 \begin_layout Standard
-The class also has the attribute 'Emu' which can be set to change between
- serial and file mode for the snd and rcv functions.
+The class also has the attribute 'Emu' which can be set to point the debugger
+ at either an emulator process or a serial port.
 \end_layout
 
 \begin_layout Standard
@@ -676,13 +676,762 @@
 \end_layout
 
 \begin_layout Standard
-The debuggers
+The rcv function needs to check that the emulator's output buffer is the
+ correct length before returning the data to the user.
+ Below is a pseudo-code representation of how this is achieved.
+\end_layout
+
+\begin_layout Standard
+\begin_inset listings
+lstparams "basicstyle={\ttfamily},captionpos=b,frame=tb,framexbottommargin=1em,framextopmargin=1em,keywordstyle={\color{blue}},tabsize=4"
+inline false
+status open
+
+\begin_layout Plain Layout
+
+rcv ( length ):
+\end_layout
+
+\begin_layout Plain Layout
+
+	while output buffer size != length:
+\end_layout
+
+\begin_layout Plain Layout
+
+		wait
+\end_layout
+
+\begin_layout Plain Layout
+
+	return output buffer
+\end_layout
+
+\end_inset
+
+
 \end_layout
 
 \begin_layout Subsection
 cli.py
 \end_layout
 
+\begin_layout Standard
+This file offers the user a text based interface to the debug class.
+ It implements the following commands:
+\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">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="left" valignment="top" width="2cm">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Command
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Function
+\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
+step
+\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
+step
+\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
+run
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+run
+\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
+sr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_reg
+\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
+gr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_reg
+\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
+sf
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_flag
+\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
+gr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_flag
+\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
+sb
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_block
+\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
+gb
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_block
+\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
+ga
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_a
+\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
+gf
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_flags
+\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
+gir
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_ir
+\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
+runl
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+run_length
+\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
+frun
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+free_run
+\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
+sbp
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_bp
+\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
+exc
+\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
+exc
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\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
+Commands are issued at a terminal followed by any arguments separated by
+ a space.
+ The exc function enables the interpreter mode described in the EDE Use
+ Cases section above.
+\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.
+\end_layout
+
+\begin_layout Standard
+\begin_inset Tabular
+<lyxtabular version="3" rows="16" 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
+Register
+\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
+R0_0
+\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
+R
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\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
+
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\end_layout
+
 \begin_layout Section
 Debugger Testing
 \end_layout
--- a/docs/lyx/#review.lyx#	Mon Apr 21 19:37:21 2014 +0100
+++ b/docs/lyx/#review.lyx#	Tue Apr 22 00:21:59 2014 +0100
@@ -64,8 +64,128 @@
 \end_layout
 
 \begin_layout Standard
+The diagram below shows an overview of the goal of this project with the
+ completed components and interfaces highlighted in green.
+\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 Graphics
+	filename /home/jmz/qm/ede/docs/img/ede/state_of_ede.svg
+	display false
+
+\end_inset
+
+
+\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 Newpage pagebreak
+\end_inset
+
+
+\end_layout
+
+\begin_layout Section
+Strategy for the completion of EDE
+\end_layout
+
+\begin_layout Enumerate
+Complete debugger interface code.
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+Both the PC and 8052 versions have fully implemented control interface functions.
+ 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
 \end_body
 \end_document
--- a/docs/lyx/dbg.lyx	Mon Apr 21 19:37:21 2014 +0100
+++ b/docs/lyx/dbg.lyx	Tue Apr 22 00:21:59 2014 +0100
@@ -716,6 +716,955 @@
 cli.py
 \end_layout
 
+\begin_layout Standard
+This file offers the user a text based interface to the debug class.
+ It implements the following commands:
+\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">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="left" valignment="top" width="2cm">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Command
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Function
+\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
+step
+\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
+step
+\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
+run
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+run
+\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
+sr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_reg
+\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
+gr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_reg
+\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
+sf
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_flag
+\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
+gr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_flag
+\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
+sb
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_block
+\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
+gb
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_block
+\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
+ga
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_a
+\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
+gf
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_flags
+\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
+gir
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_ir
+\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
+runl
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+run_length
+\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
+frun
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+free_run
+\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
+sbp
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_bp
+\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
+exc
+\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
+exc
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\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
+Commands are issued at a terminal followed by any arguments separated by
+ a space.
+ The exc function enables the interpreter mode described in the EDE Use
+ Cases section above.
+\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 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="17" 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
+Register
+\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
+R0_0
+\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
+R1_0
+\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
+R2_0
+\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
+R3_0
+\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
+DPH
+\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
+SPH
+\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
+PCH
+\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" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+TMPH
+\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
+7
+\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
+R0_1
+\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
+8
+\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
+R1_1
+\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
+9
+\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
+R2_1
+\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
+10
+\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
+R3_1
+\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
+11
+\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
+DPL
+\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
+12
+\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
+SPL
+\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
+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
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+TMPL
+\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
+15
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\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
+
 \begin_layout Section
 Debugger Testing
 \end_layout
--- a/docs/lyx/dbg.lyx~	Mon Apr 21 19:37:21 2014 +0100
+++ b/docs/lyx/dbg.lyx~	Tue Apr 22 00:21:59 2014 +0100
@@ -664,8 +664,8 @@
 \end_layout
 
 \begin_layout Standard
-The class also has the attribute 'Emu' which can be set to change between
- serial and file mode for the snd and rcv functions.
+The class also has the attribute 'Emu' which can be set to point the debugger
+ at either an emulator process or a serial port.
 \end_layout
 
 \begin_layout Standard
@@ -716,6 +716,955 @@
 cli.py
 \end_layout
 
+\begin_layout Standard
+This file offers the user a text based interface to the debug class.
+ It implements the following commands:
+\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">
+<features tabularvalignment="middle">
+<column alignment="center" valignment="top" width="0">
+<column alignment="left" valignment="top" width="2cm">
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Command
+\end_layout
+
+\end_inset
+</cell>
+<cell multicolumn="1" alignment="left" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+Function
+\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
+step
+\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
+step
+\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
+run
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+run
+\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
+sr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_reg
+\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
+gr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_reg
+\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
+sf
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_flag
+\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
+gr
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_flag
+\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
+sb
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_block
+\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
+gb
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_block
+\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
+ga
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_a
+\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
+gf
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_flags
+\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
+gir
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+get_ir
+\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
+runl
+\end_layout
+
+\end_inset
+</cell>
+<cell multirow="3" alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+run_length
+\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
+frun
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+free_run
+\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
+sbp
+\end_layout
+
+\end_inset
+</cell>
+<cell alignment="left" valignment="top" topline="true" leftline="true" rightline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+set_bp
+\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
+exc
+\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
+exc
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\end_inset
+
+
+\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
+Commands are issued at a terminal followed by any arguments separated by
+ a space.
+ The exc function enables the interpreter mode described in the EDE Use
+ Cases section above.
+\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.
+\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="17" 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
+Register
+\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
+R0_0
+\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
+R1_0
+\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
+R2_0
+\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
+R3_0
+\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
+DPH
+\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
+SPH
+\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
+PCH
+\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" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+TMPH
+\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
+7
+\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
+R0_1
+\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
+8
+\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
+R1_1
+\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
+9
+\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
+R2_1
+\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
+10
+\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
+R3_1
+\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
+11
+\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
+DPL
+\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
+12
+\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
+SPL
+\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
+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
+</cell>
+</row>
+<row>
+<cell alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" usebox="none">
+\begin_inset Text
+
+\begin_layout Plain Layout
+TMPL
+\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
+15
+\end_layout
+
+\end_inset
+</cell>
+</row>
+</lyxtabular>
+
+\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
+
 \begin_layout Section
 Debugger Testing
 \end_layout
--- a/docs/lyx/intro.lyx	Mon Apr 21 19:37:21 2014 +0100
+++ b/docs/lyx/intro.lyx	Tue Apr 22 00:21:59 2014 +0100
@@ -80,7 +80,7 @@
 .
  The combination of an ELB816 emulator, debugger and assembler could be
  used as a set of tools for learning or teaching micro-processor programming
- without the intricacies of real-world commercial microprocessors getting
+ without the intricacies of real-world commercial micro-processors getting
  in the way of a fundamental understanding of the subject.
  A PC based emulator would allow students to quickly develop and debug programs
  written in a simple assembly language on any modern desktop or laptop,
--- a/docs/lyx/intro.lyx~	Mon Apr 21 19:37:21 2014 +0100
+++ b/docs/lyx/intro.lyx~	Tue Apr 22 00:21:59 2014 +0100
@@ -83,8 +83,8 @@
  without the intricacies of real-world commercial microprocessors getting
  in the way of a fundamental understanding of the subject.
  A PC based emulator would allow students to quickly develop and debug programs
- written in a simple assembly language on any modern desktop or laptop and
- an MCS-51 port running on an 8052 would allow students to test programs
+ written in a simple assembly language on any modern desktop or laptop,
+ and an MCS-51 port running on an 8052 would allow students to test programs
  in an actual circuit.
  EDE aims to bring together these components in order to provide an environment
  for using ELB816 as an educational tool.
@@ -164,7 +164,7 @@
 
 \begin_layout Standard
 The debug interface will be developed along side the emulator.
- It will communicate with a a simple control function built into the emulator
+ It will communicate with a a simple control function, built into the emulator,
  that will read commands using C's 
 \begin_inset listings
 lstparams "basicstyle={\ttfamily}"
--- a/docs/lyx/review.lyx	Mon Apr 21 19:37:21 2014 +0100
+++ b/docs/lyx/review.lyx	Tue Apr 22 00:21:59 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
--- a/docs/lyx/review.lyx~	Mon Apr 21 19:37:21 2014 +0100
+++ b/docs/lyx/review.lyx~	Tue Apr 22 00:21:59 2014 +0100
@@ -110,9 +110,30 @@
 
 \end_layout
 
+\begin_layout Standard
+\begin_inset Newpage pagebreak
+\end_inset
+
+
+\end_layout
+
 \begin_layout Section
 Strategy for the completion of EDE
 \end_layout
 
+\begin_layout Enumerate
+Complete debugger interface code.
+\end_layout
+
+\begin_deeper
+\begin_layout Enumerate
+Both the PC and 8052 versions have fully implemented control interface functions.
+ 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
+ 
+\end_layout
+
+\end_deeper
 \end_body
 \end_document
Binary file tests/asm/full has changed
--- a/tests/asm/full.asm	Mon Apr 21 19:37:21 2014 +0100
+++ b/tests/asm/full.asm	Tue Apr 22 00:21:59 2014 +0100
@@ -4,6 +4,7 @@
 data16 EQU ((0x2BAB * 2) - data8 + 0x01 + data8)
 port_addr EQU 'P'
 vect8 EQU 'V'
+DS 0x0F
 
 NOP
 SET C
--- a/tests/asm/full.dsm	Mon Apr 21 19:37:21 2014 +0100
+++ b/tests/asm/full.dsm	Tue Apr 22 00:21:59 2014 +0100
@@ -1,248 +1,248 @@
-0x8	0x0	 	nop	
-0x9	0x8	 	set	C
-0xa	0x9	 	clr	C
-0xb	0xa	 	set	BS
-0xc	0xb	 	clr	BS
-0xd	0xc	 	set	iE
-0xe	0xd	 	clr	IE
-0xf	0xe	 	cpl	C
-0x10	0xf	 	cpl	A
-0x11	0x10	 	xcsd	
-0x12	0x11	 	sfa	
-0x13	0x12	 	laf	
-0x14	0x13	 	mov	DPTR, SP
-0x15	0x14	 	mov	SP, DPTR
-0x16	0x15	0x42	mov	A, #'B'
-0x18	0x16	0x5757	mov	SP, #'WW'
-0x1b	0x17	0x5757	mov	DPTR, #((0x2BAB * 2) - 0x42 + 0x01 + 0x42)
-0x1e	0x18	0x161	mov	A, 353
-0x21	0x19	0x161	mov	353, A
-0x24	0x1a	 	mov	A, @A+DPTR
-0x25	0x1b	 	mov	A, @A+PC
-0x26	0x1c	0x161	mov	A, @353
-0x29	0x1d	0x161	mov	@353, A
-0x2c	0x1e	 	mov	A, @DPTR
-0x2d	0x1f	 	mov	@DPTR, A
-0x2e	0x20	 	mov	@DPTR, R0
-0x2f	0x21	 	mov	@DPTR, R1
-0x30	0x22	 	mov	@DPTR, R2
-0x31	0x23	 	mov	@DPTR, R3
-0x32	0x24	 	mov	@DPTR, DPH
-0x33	0x25	 	mov	@DPTR, DPL
-0x34	0x26	 	mov	@DPTR, SPH
-0x35	0x27	 	mov	@DPTR, SPL
-0x36	0x28	0x42	mov	R0, #0x42
-0x38	0x29	0x42	mov	R1, #0x42
-0x3a	0x2a	0x42	mov	R2, #0x42
-0x3c	0x2b	0x42	mov	R3, #0x42
-0x3e	0x2c	0x42	mov	DPH, #0x42
-0x40	0x2d	0x42	mov	DPL, #0x42
-0x42	0x2e	0x42	mov	SPH, #0x42
-0x44	0x2f	0x42	mov	SPL, #0x42
-0x46	0x30	 	mov	R0, A
-0x47	0x31	 	mov	R1, A
-0x48	0x32	 	mov	R2, A
-0x49	0x33	 	mov	R3, A
-0x4a	0x34	 	mov	DPH, A
-0x4b	0x35	 	mov	DPL, A
-0x4c	0x36	 	mov	SPH, A
-0x4d	0x37	 	mov	SPL, A
-0x4e	0x38	 	mov	A, R0
-0x4f	0x39	 	mov	A, R1
-0x50	0x3a	 	mov	A, R2
-0x51	0x3b	 	mov	A, R3
-0x52	0x3c	 	mov	A, DPH
-0x53	0x3d	 	mov	A, DPL
-0x54	0x3e	 	mov	A, SPH
-0x55	0x3f	 	mov	A, SPL
-0x56	0x40	 	mov	R0, @DPTR
-0x57	0x41	 	mov	R0, R1
-0x58	0x42	 	mov	R0, R2
-0x59	0x43	 	mov	R0, R3
-0x5a	0x44	 	mov	R0, DPH
-0x5b	0x45	 	mov	R0, DPL
-0x5c	0x46	 	mov	R0, SPH
-0x5d	0x47	 	mov	R0, SPL
-0x5e	0x48	 	mov	R1, R0
-0x5f	0x49	 	mov	R1, @DPTR
-0x60	0x4a	 	mov	R1, R2
-0x61	0x4b	 	mov	R1, R3
-0x62	0x4c	 	mov	R1, DPH
-0x63	0x4d	 	mov	R1, DPL
-0x64	0x4e	 	mov	R1, SPH
-0x65	0x4f	 	mov	R1, SPL
-0x66	0x50	 	mov	R2, R0
-0x67	0x51	 	mov	R2, R1
-0x68	0x52	 	mov	R2, @DPTR
-0x69	0x53	 	mov	R2, R3
-0x6a	0x54	 	mov	R2, DPH
-0x6b	0x55	 	mov	R2, DPL
-0x6c	0x56	 	mov	R2, SPH
-0x6d	0x57	 	mov	R2, SPL
-0x6e	0x58	 	mov	R3, R0
-0x6f	0x59	 	mov	R3, R1
-0x70	0x5a	 	mov	R3, R2
-0x71	0x5b	 	mov	R3, @DPTR
-0x72	0x5c	 	mov	R3, DPH
-0x73	0x5d	 	mov	R3, DPL
-0x74	0x5e	 	mov	R3, SPH
-0x75	0x5f	 	mov	R3, SPL
-0x76	0x60	 	mov	DPH, R0
-0x77	0x61	 	mov	DPH, R1
-0x78	0x62	 	mov	DPH, R2
-0x79	0x63	 	mov	DPH, R3
-0x7a	0x64	 	mov	DPH, @DPTR
-0x7b	0x65	 	mov	DPH, DPL
-0x7c	0x66	 	mov	DPH, SPH
-0x7d	0x67	 	mov	DPH, SPL
-0x7e	0x68	 	mov	DPL, R0
-0x7f	0x69	 	mov	DPL, R1
-0x80	0x6a	 	mov	DPL, R2
-0x81	0x6b	 	mov	DPL, R3
-0x82	0x6c	 	mov	DPL, DPH
-0x83	0x6d	 	mov	DPL, @DPTR
-0x84	0x6e	 	mov	DPL, SPH
-0x85	0x6f	 	mov	DPL, SPL
-0x86	0x70	 	mov	SPH, R0
-0x87	0x71	 	mov	SPH, R1
-0x88	0x72	 	mov	SPH, R2
-0x89	0x73	 	mov	SPH, R3
-0x8a	0x74	 	mov	SPH, DPH
-0x8b	0x75	 	mov	SPH, DPL
-0x8c	0x76	 	mov	SPH, @DPTR
-0x8d	0x77	 	mov	SPH, SPL
-0x8e	0x78	 	mov	SPL, R0
-0x8f	0x79	 	mov	SPL, R1
-0x90	0x7a	 	mov	SPL, R2
-0x91	0x7b	 	mov	SPL, R3
-0x92	0x7c	 	mov	SPL, DPH
-0x93	0x7d	 	mov	SPL, DPL
-0x94	0x7e	 	mov	SPL, SPH
-0x95	0x7f	 	mov	SPL, @DPTR
-0x96	0x80	 	anl	A, R0
-0x97	0x81	 	anl	A, R1
-0x98	0x82	 	anl	A, R2
-0x99	0x83	 	anl	A, R3
-0x9a	0x84	 	anl	A, DPH
-0x9b	0x85	 	anl	A, DPL
-0x9c	0x86	0x42	anl	A, #0x42
-0x9e	0x87	 	anl	A, @DPTR
-0x9f	0x88	 	orl	A, R0
-0xa0	0x89	 	orl	A, R1
-0xa1	0x8a	 	orl	A, R2
-0xa2	0x8b	 	orl	A, R3
-0xa3	0x8c	 	orl	A, DPH
-0xa4	0x8d	 	orl	A, DPL
-0xa5	0x8e	0x42	orl	A, #0x42
-0xa7	0x8f	 	orl	A, @DPTR
-0xa8	0x90	 	xrl	A, R0
-0xa9	0x91	 	xrl	A, R1
-0xaa	0x92	 	xrl	A, R2
-0xab	0x93	 	xrl	A, R3
-0xac	0x94	 	xrl	A, DPH
-0xad	0x95	 	xrl	A, DPL
-0xae	0x96	0x42	xrl	A, #0x42
-0xb0	0x97	 	xrl	A, @DPTR
-0xb1	0x98	 	rl	A
-0xb2	0x99	 	rlc	A
-0xb3	0x9a	 	rr	A
-0xb4	0x9b	 	rrc	A
-0xb5	0x9c	 	inc	DPTR
-0xb6	0x9d	 	dec	DPTR
-0xb7	0x9e	 	inc	A
-0xb8	0x9f	 	dec	A
-0xb9	0xa0	 	add	A, R0
-0xba	0xa1	 	add	A, R1
-0xbb	0xa2	 	add	A, R2
-0xbc	0xa3	 	add	A, R3
-0xbd	0xa4	 	add	A, DPH
-0xbe	0xa5	 	add	A, DPL
-0xbf	0xa6	0x42	add	A, #0x42
-0xc1	0xa7	 	add	A, @DPTR
-0xc2	0xa8	 	addc	A, R0
-0xc3	0xa9	 	addc	A, R1
-0xc4	0xaa	 	addc	A, R2
-0xc5	0xab	 	addc	A, R3
-0xc6	0xac	 	addc	A, DPH
-0xc7	0xad	 	addc	A, DPL
-0xc8	0xae	0x42	addc	A, #0x42
-0xca	0xaf	 	addc	A, @DPTR
-0xcb	0xb0	 	sub	A, R0
-0xcc	0xb1	 	sub	A, R1
-0xcd	0xb2	 	sub	A, R2
-0xce	0xb3	 	sub	A, R3
-0xcf	0xb4	 	sub	A, DPH
-0xd0	0xb5	 	sub	A, DPL
-0xd1	0xb6	0x42	sub	A, #0x42
-0xd3	0xb7	 	sub	A, @DPTR
-0xd4	0xb8	 	subb	A, R0
-0xd5	0xb9	 	subb	A, R1
-0xd6	0xba	 	subb	A, R2
-0xd7	0xbb	 	subb	A, R3
-0xd8	0xbc	 	subb	A, DPH
-0xd9	0xbd	 	subb	A, DPL
-0xda	0xbe	0x42	subb	A, #0x42
-0xdc	0xbf	 	subb	A, @DPTR
-0xdd	0xc1	0x61	pjmp	353
-0xdf	0xc1	0x61	pjmp	353
-0xe1	0xc1	0x61	pjmp	353
-0xe3	0xc1	0x61	pjmp	353
-0xe5	0xc1	0x61	pjmp	353
-0xe7	0xc1	0x61	pjmp	353
-0xe9	0xc1	0x61	pjmp	353
-0xeb	0xc1	0x61	pjmp	353
-0xed	0xc9	0x61	pcall	353
-0xef	0xc9	0x61	pcall	353
-0xf1	0xc9	0x61	pcall	353
-0xf3	0xc9	0x61	pcall	353
-0xf5	0xc9	0x61	pcall	353
-0xf7	0xc9	0x61	pcall	353
-0xf9	0xc9	0x61	pcall	353
-0xfb	0xc9	0x61	pcall	353
-0xfd	0xd0	0x64	djnz	R0, 100
-0xff	0xd1	0x62	djnz	R1, 98
-0x101	0xd2	0x60	djnz	R2, 96
-0x103	0xd3	0x5e	djnz	R3, 94
-0x105	0xd4	0x5c	cjne	R0, #0x42, 92
-0x107	0xd5	0x5a	cjne	R1, #0x42, 90
-0x109	0xd6	0x58	cjne	R2, #0x42, 88
-0x10b	0xd7	0x56	cjne	R3, #0x42, 86
-0x10d	0xd8	0x161	ljmp	353
-0x110	0xd9	0x161	lcall	353
-0x113	0xda	 	ret	
-0x114	0xdb	 	reti	
-0x115	0xdc	0x4c	sjmp	76
-0x117	0xdd	 	jmp	@A+DPTR
-0x118	0xde	 	jmp	@DPTR
-0x119	0xdf	0x4248	cjne	A, #0x42, 72
-0x11c	0xe0	0x45	jz	69
-0x11e	0xe1	0x43	jnz	67
-0x120	0xe2	0x41	jc	65
-0x122	0xe3	0x3f	jnc	63
-0x124	0xe4	0x3d	jpo	61
-0x126	0xe5	0x3b	jpe	59
-0x128	0xe6	0x39	js	57
-0x12a	0xe7	0x37	jns	55
-0x12c	0xe8	 	push	R0
-0x12d	0xe9	 	push	R1
-0x12e	0xea	 	push	R2
-0x12f	0xeb	 	push	R3
-0x130	0xec	 	push	DPH
-0x131	0xed	 	push	DPL
-0x132	0xee	 	push	A
-0x133	0xef	 	push	FLAGS
-0x134	0xf0	 	pop	R0
-0x135	0xf1	 	pop	R1
-0x136	0xf2	 	pop	R2
-0x137	0xf3	 	pop	R3
-0x138	0xf4	 	pop	DPH
-0x139	0xf5	 	pop	DPL
-0x13a	0xf6	 	pop	A
-0x13b	0xf7	 	pop	FLAGS
-0x13c	0xf8	 	mul	R0, R1
-0x13d	0xf9	 	div	R0, R1
-0x13e	0xfa	 	da	A
-0x13f	0xfc	0x50	in	A, 'P'
-0x141	0xfd	0x50	out	'P', A
-0x143	0xfe	0x56	int	'V'
-0x145	0xff	 	hlt	
+0x17	0x0	 	nop	
+0x18	0x8	 	set	C
+0x19	0x9	 	clr	C
+0x1a	0xa	 	set	BS
+0x1b	0xb	 	clr	BS
+0x1c	0xc	 	set	iE
+0x1d	0xd	 	clr	IE
+0x1e	0xe	 	cpl	C
+0x1f	0xf	 	cpl	A
+0x20	0x10	 	xcsd	
+0x21	0x11	 	sfa	
+0x22	0x12	 	laf	
+0x23	0x13	 	mov	DPTR, SP
+0x24	0x14	 	mov	SP, DPTR
+0x25	0x15	0x42	mov	A, #'B'
+0x27	0x16	0x5757	mov	SP, #'WW'
+0x2a	0x17	0x5757	mov	DPTR, #((0x2BAB * 2) - 0x42 + 0x01 + 0x42)
+0x2d	0x18	0x161	mov	A, 353
+0x30	0x19	0x161	mov	353, A
+0x33	0x1a	 	mov	A, @A+DPTR
+0x34	0x1b	 	mov	A, @A+PC
+0x35	0x1c	0x161	mov	A, @353
+0x38	0x1d	0x161	mov	@353, A
+0x3b	0x1e	 	mov	A, @DPTR
+0x3c	0x1f	 	mov	@DPTR, A
+0x3d	0x20	 	mov	@DPTR, R0
+0x3e	0x21	 	mov	@DPTR, R1
+0x3f	0x22	 	mov	@DPTR, R2
+0x40	0x23	 	mov	@DPTR, R3
+0x41	0x24	 	mov	@DPTR, DPH
+0x42	0x25	 	mov	@DPTR, DPL
+0x43	0x26	 	mov	@DPTR, SPH
+0x44	0x27	 	mov	@DPTR, SPL
+0x45	0x28	0x42	mov	R0, #0x42
+0x47	0x29	0x42	mov	R1, #0x42
+0x49	0x2a	0x42	mov	R2, #0x42
+0x4b	0x2b	0x42	mov	R3, #0x42
+0x4d	0x2c	0x42	mov	DPH, #0x42
+0x4f	0x2d	0x42	mov	DPL, #0x42
+0x51	0x2e	0x42	mov	SPH, #0x42
+0x53	0x2f	0x42	mov	SPL, #0x42
+0x55	0x30	 	mov	R0, A
+0x56	0x31	 	mov	R1, A
+0x57	0x32	 	mov	R2, A
+0x58	0x33	 	mov	R3, A
+0x59	0x34	 	mov	DPH, A
+0x5a	0x35	 	mov	DPL, A
+0x5b	0x36	 	mov	SPH, A
+0x5c	0x37	 	mov	SPL, A
+0x5d	0x38	 	mov	A, R0
+0x5e	0x39	 	mov	A, R1
+0x5f	0x3a	 	mov	A, R2
+0x60	0x3b	 	mov	A, R3
+0x61	0x3c	 	mov	A, DPH
+0x62	0x3d	 	mov	A, DPL
+0x63	0x3e	 	mov	A, SPH
+0x64	0x3f	 	mov	A, SPL
+0x65	0x40	 	mov	R0, @DPTR
+0x66	0x41	 	mov	R0, R1
+0x67	0x42	 	mov	R0, R2
+0x68	0x43	 	mov	R0, R3
+0x69	0x44	 	mov	R0, DPH
+0x6a	0x45	 	mov	R0, DPL
+0x6b	0x46	 	mov	R0, SPH
+0x6c	0x47	 	mov	R0, SPL
+0x6d	0x48	 	mov	R1, R0
+0x6e	0x49	 	mov	R1, @DPTR
+0x6f	0x4a	 	mov	R1, R2
+0x70	0x4b	 	mov	R1, R3
+0x71	0x4c	 	mov	R1, DPH
+0x72	0x4d	 	mov	R1, DPL
+0x73	0x4e	 	mov	R1, SPH
+0x74	0x4f	 	mov	R1, SPL
+0x75	0x50	 	mov	R2, R0
+0x76	0x51	 	mov	R2, R1
+0x77	0x52	 	mov	R2, @DPTR
+0x78	0x53	 	mov	R2, R3
+0x79	0x54	 	mov	R2, DPH
+0x7a	0x55	 	mov	R2, DPL
+0x7b	0x56	 	mov	R2, SPH
+0x7c	0x57	 	mov	R2, SPL
+0x7d	0x58	 	mov	R3, R0
+0x7e	0x59	 	mov	R3, R1
+0x7f	0x5a	 	mov	R3, R2
+0x80	0x5b	 	mov	R3, @DPTR
+0x81	0x5c	 	mov	R3, DPH
+0x82	0x5d	 	mov	R3, DPL
+0x83	0x5e	 	mov	R3, SPH
+0x84	0x5f	 	mov	R3, SPL
+0x85	0x60	 	mov	DPH, R0
+0x86	0x61	 	mov	DPH, R1
+0x87	0x62	 	mov	DPH, R2
+0x88	0x63	 	mov	DPH, R3
+0x89	0x64	 	mov	DPH, @DPTR
+0x8a	0x65	 	mov	DPH, DPL
+0x8b	0x66	 	mov	DPH, SPH
+0x8c	0x67	 	mov	DPH, SPL
+0x8d	0x68	 	mov	DPL, R0
+0x8e	0x69	 	mov	DPL, R1
+0x8f	0x6a	 	mov	DPL, R2
+0x90	0x6b	 	mov	DPL, R3
+0x91	0x6c	 	mov	DPL, DPH
+0x92	0x6d	 	mov	DPL, @DPTR
+0x93	0x6e	 	mov	DPL, SPH
+0x94	0x6f	 	mov	DPL, SPL
+0x95	0x70	 	mov	SPH, R0
+0x96	0x71	 	mov	SPH, R1
+0x97	0x72	 	mov	SPH, R2
+0x98	0x73	 	mov	SPH, R3
+0x99	0x74	 	mov	SPH, DPH
+0x9a	0x75	 	mov	SPH, DPL
+0x9b	0x76	 	mov	SPH, @DPTR
+0x9c	0x77	 	mov	SPH, SPL
+0x9d	0x78	 	mov	SPL, R0
+0x9e	0x79	 	mov	SPL, R1
+0x9f	0x7a	 	mov	SPL, R2
+0xa0	0x7b	 	mov	SPL, R3
+0xa1	0x7c	 	mov	SPL, DPH
+0xa2	0x7d	 	mov	SPL, DPL
+0xa3	0x7e	 	mov	SPL, SPH
+0xa4	0x7f	 	mov	SPL, @DPTR
+0xa5	0x80	 	anl	A, R0
+0xa6	0x81	 	anl	A, R1
+0xa7	0x82	 	anl	A, R2
+0xa8	0x83	 	anl	A, R3
+0xa9	0x84	 	anl	A, DPH
+0xaa	0x85	 	anl	A, DPL
+0xab	0x86	0x42	anl	A, #0x42
+0xad	0x87	 	anl	A, @DPTR
+0xae	0x88	 	orl	A, R0
+0xaf	0x89	 	orl	A, R1
+0xb0	0x8a	 	orl	A, R2
+0xb1	0x8b	 	orl	A, R3
+0xb2	0x8c	 	orl	A, DPH
+0xb3	0x8d	 	orl	A, DPL
+0xb4	0x8e	0x42	orl	A, #0x42
+0xb6	0x8f	 	orl	A, @DPTR
+0xb7	0x90	 	xrl	A, R0
+0xb8	0x91	 	xrl	A, R1
+0xb9	0x92	 	xrl	A, R2
+0xba	0x93	 	xrl	A, R3
+0xbb	0x94	 	xrl	A, DPH
+0xbc	0x95	 	xrl	A, DPL
+0xbd	0x96	0x42	xrl	A, #0x42
+0xbf	0x97	 	xrl	A, @DPTR
+0xc0	0x98	 	rl	A
+0xc1	0x99	 	rlc	A
+0xc2	0x9a	 	rr	A
+0xc3	0x9b	 	rrc	A
+0xc4	0x9c	 	inc	DPTR
+0xc5	0x9d	 	dec	DPTR
+0xc6	0x9e	 	inc	A
+0xc7	0x9f	 	dec	A
+0xc8	0xa0	 	add	A, R0
+0xc9	0xa1	 	add	A, R1
+0xca	0xa2	 	add	A, R2
+0xcb	0xa3	 	add	A, R3
+0xcc	0xa4	 	add	A, DPH
+0xcd	0xa5	 	add	A, DPL
+0xce	0xa6	0x42	add	A, #0x42
+0xd0	0xa7	 	add	A, @DPTR
+0xd1	0xa8	 	addc	A, R0
+0xd2	0xa9	 	addc	A, R1
+0xd3	0xaa	 	addc	A, R2
+0xd4	0xab	 	addc	A, R3
+0xd5	0xac	 	addc	A, DPH
+0xd6	0xad	 	addc	A, DPL
+0xd7	0xae	0x42	addc	A, #0x42
+0xd9	0xaf	 	addc	A, @DPTR
+0xda	0xb0	 	sub	A, R0
+0xdb	0xb1	 	sub	A, R1
+0xdc	0xb2	 	sub	A, R2
+0xdd	0xb3	 	sub	A, R3
+0xde	0xb4	 	sub	A, DPH
+0xdf	0xb5	 	sub	A, DPL
+0xe0	0xb6	0x42	sub	A, #0x42
+0xe2	0xb7	 	sub	A, @DPTR
+0xe3	0xb8	 	subb	A, R0
+0xe4	0xb9	 	subb	A, R1
+0xe5	0xba	 	subb	A, R2
+0xe6	0xbb	 	subb	A, R3
+0xe7	0xbc	 	subb	A, DPH
+0xe8	0xbd	 	subb	A, DPL
+0xe9	0xbe	0x42	subb	A, #0x42
+0xeb	0xbf	 	subb	A, @DPTR
+0xec	0xc1	0x61	pjmp	353
+0xee	0xc1	0x61	pjmp	353
+0xf0	0xc1	0x61	pjmp	353
+0xf2	0xc1	0x61	pjmp	353
+0xf4	0xc1	0x61	pjmp	353
+0xf6	0xc1	0x61	pjmp	353
+0xf8	0xc1	0x61	pjmp	353
+0xfa	0xc1	0x61	pjmp	353
+0xfc	0xc9	0x61	pcall	353
+0xfe	0xc9	0x61	pcall	353
+0x100	0xc9	0x61	pcall	353
+0x102	0xc9	0x61	pcall	353
+0x104	0xc9	0x61	pcall	353
+0x106	0xc9	0x61	pcall	353
+0x108	0xc9	0x61	pcall	353
+0x10a	0xc9	0x61	pcall	353
+0x10c	0xd0	0x55	djnz	R0, 85
+0x10e	0xd1	0x53	djnz	R1, 83
+0x110	0xd2	0x51	djnz	R2, 81
+0x112	0xd3	0x4f	djnz	R3, 79
+0x114	0xd4	0x4d	cjne	R0, #0x42, 77
+0x116	0xd5	0x4b	cjne	R1, #0x42, 75
+0x118	0xd6	0x49	cjne	R2, #0x42, 73
+0x11a	0xd7	0x47	cjne	R3, #0x42, 71
+0x11c	0xd8	0x161	ljmp	353
+0x11f	0xd9	0x161	lcall	353
+0x122	0xda	 	ret	
+0x123	0xdb	 	reti	
+0x124	0xdc	0x3d	sjmp	61
+0x126	0xdd	 	jmp	@A+DPTR
+0x127	0xde	 	jmp	@DPTR
+0x128	0xdf	0x4239	cjne	A, #0x42, 57
+0x12b	0xe0	0x36	jz	54
+0x12d	0xe1	0x34	jnz	52
+0x12f	0xe2	0x32	jc	50
+0x131	0xe3	0x30	jnc	48
+0x133	0xe4	0x2e	jpo	46
+0x135	0xe5	0x2c	jpe	44
+0x137	0xe6	0x2a	js	42
+0x139	0xe7	0x28	jns	40
+0x13b	0xe8	 	push	R0
+0x13c	0xe9	 	push	R1
+0x13d	0xea	 	push	R2
+0x13e	0xeb	 	push	R3
+0x13f	0xec	 	push	DPH
+0x140	0xed	 	push	DPL
+0x141	0xee	 	push	A
+0x142	0xef	 	push	FLAGS
+0x143	0xf0	 	pop	R0
+0x144	0xf1	 	pop	R1
+0x145	0xf2	 	pop	R2
+0x146	0xf3	 	pop	R3
+0x147	0xf4	 	pop	DPH
+0x148	0xf5	 	pop	DPL
+0x149	0xf6	 	pop	A
+0x14a	0xf7	 	pop	FLAGS
+0x14b	0xf8	 	mul	R0, R1
+0x14c	0xf9	 	div	R0, R1
+0x14d	0xfa	 	da	A
+0x14e	0xfc	0x50	in	A, 'P'
+0x150	0xfd	0x50	out	'P', A
+0x152	0xfe	0x56	int	'V'
+0x154	0xff	 	hlt	
--- a/utils/test.c	Mon Apr 21 19:37:21 2014 +0100
+++ b/utils/test.c	Tue Apr 22 00:21:59 2014 +0100
@@ -1,9 +1,5 @@
 #include <stdio.h>
 
-unsigned char regs[0x10];
-
 void
 main(void) {
-        unsigned char C = 0xFD;
-        printf("%i", (signed char)C);
 }