8051 emulator
copyright (c) 2006 Jari Komppa

No guarantees are given. Use at your own risk.
If it doesn't do something you want, you have the sources.

Things that might not work
- DA instruction is a bit unclear
- SUBB flags may be a bit flaky
- MOVX does not currently affect output ports
- 44780 4-bit mode seems to have some portability problems


Things not implemented
- Serial communication stuff
- External interrupt pins not emulated (i.e. timer/counter 
  count pins and external interrupt things)
- Emulation of specific '51 cores
- 8052 extra timer

-- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< --

v. 0.71 - 5.9.2006

- Bugfix: adding a memory value to acc did not actually
  perform the addition. Thanks to Kimmo Sauren for pointing 
  this out.

-- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< --

v. 0.7 - 14.5.2006

- Bugfix: stopping run mode with space left the silk 
  buttons saying "running"
- Bugfix: Memory editor view upper and sfr offsets started 
  from 0 instead of 0x80.
- Bugfix: If two interrupts were happening, one right after
  another, the emulator would have executed one normal
  instruction before vectoring out to the second interrupt.
- Emulation core feature: callbacks for external memory 
  read/write to help simulating some external peripherals
  (not used by anything in the simulator yet, though)
- Bugfix: movx indirect rx commands were not making sure
  the offset is inside the memory area, or even if the
  memory existed.. (neither mattered in the simulator
  though).
- New option: set the behavior of port input values for
  output latches set to low values (0, 1, random)
- Added lots of commandline options; basically all options
  are selectable through command line options. 
  Help is displayed if unknown option (such as /? or -h)
  is used.
- Logic board now also supports simulation of 44780-style
  2x16 character display.
- Bugfix: Stack view didn't show upper memory regions
- Largely re-written documentation due to harddrive crash.

-- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< --

v. 0.6 - 2.4.2006

- Some documentation
- Bugfix: Timers' gate logic was reversed
- Timer 0/1 mode 3 implemented
- Redesigned history system
  - Faster
  - Now shows proper history even after breaking from
    full speed mode
- Main view memory editor modes change with 'm', 
  freeing tab for focus changes
- Main view can be used to edit the common registers easily
  using tab to switch focus
- Can switch views with function keys    
- Main view memory editor supports pageup/pagedn 
  keys to move around faster, and the memory type
  is shown on the border.
- Logic board mode has some new widgets
  - 7 seg displays (8th seg is a dot)
  - 8bit shift registers
  - Very simple 1-bit audio out (to .wav file)
- Memory editor view
  - Shows all 5 types of memory at once
- New view: options.
  - Can disable exceptions
  - Can set emulated clock speed  
  
-- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< --

v. 0.4 - 29.3.2006

New stuff:
- Timer 0 and timer 1 modes 0, 1 and 2 implemented. 
  - Interrupt priority levels should also work
  - Interrupts check whether A, PSW or SP has changed since 
    interrupt starts and throws an emulation exception. 
    Since there is a very slim chance that someone might want
    to write a program that does some of the above legally,
    I'll have to add options to the simulator to disable
    exceptions..
  - Counters and external interrupts not implemented yet

-- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< --

v. 0.3 - 26.3.2006 - ~5300 lines

New stuff:
- Refactored the code to remove some redundancies and to
  simplify extension.
- Running speed now capped to emulation target speed
- Running speed improved by reducing screen updates
- Added new view: logic board mode, which is a leds/switches 
  view to ports P0 - P3.
- New key: k can be used to set or clear a breakpoint.

-- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< --

v. 0.2 - 25.3.2006 - ~5000 lines

New stuff:
- Memory editor, with modes for lower/upper/sfr/ext/rom
  - keys: tab switches modes, cursors move cursors, 0-9, a-f changes value
- Memory editor also shows the current byte's bit pattern
- Now prompts data from user whenever a port is read (P0, P1, P2, P3)
  - The prompts show the currently entered byte's bit pattern
- New key: g can be used to change PC (go to)
  - The 'go to' window shows the target address' disassembly
- A bit better help screen
- HOME key resets emulator state, with different options
  - only set PC to 0
  - set PC to 0, wipe registers (normal reset)
  - set PC to 0, wipe registers and memory (hard reset)

-- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< --

v. 0.1 - 23.3.2006 - ~4500 lines of code

Things that should work
- All opcodes implemented
- Loading (either through commandline parameter or with 'l' inside emulator)
- Stepping 
- Run modes 
- Reset modes 
- Exceptions on invalid instructions and stack problems 
- END key resets current tick / time count

-- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< ---- 8< -- 8< -- 8< --