

				  xnitpic: a Microchip PIC simulator


This program is an X Window-based simulator for the Microchip PIC series of
microcontrollers.  It's written in C++ and is known to compile correctly
with gcc-2.5.8 under Linux and SunOS4.1.3U.  This is an alpha release, with
many known incompletenesses and suspected bugs, as well as a great deal of
cruft that I plan to clean up before beta. It currently supports the
PIC16C84 only, but I have kept other processors in mind while coding, and I
think it will be trivial to add support for the rest of the PIC family, and
pretty easy even for unrelated CPUs.

I'd appreciate hearing about problems you may have, as well as suggestions
for improvements.  I'll be away on business for the next two weeks, but plan
to continue working on this when I return.

dave madden <dhm@vheissu.net.dcl.co.jp>
12-nov-94

Notes - 13/11/98 - Andrew D. Balsa <andrebalsa@altern.org>
	- Compiled under GNU/Linux with gcc 2.7.2, glibc and kernel 2.0.34.
	- fixed RRF instruction handling.
	- fixed SUBWF (C and Z flags incorrect).
	- changed default input file format to inhx8m from previous
non-standard .pt format (check defaults in file pu_lib.c).
	- Example file simple (.c, .asm, .hex) in /examples.
	- check /doc for some notes.

Nice work, Dave!


Known shortcomings:

* The 16C84 EEPROM data memory is not implemented
* Writing PCL doesn't cause a jump
  (ADB - I think I have fixed this one).
* Interrupts, including RTCC rollover, don't work
* The "File" button doesn't let you load a new object file
* No warning on stack overflow
* The I/O ports aren't handled properly (there's something screwy
  about read/modify/write instructions that I don't understand yet).
* I'm not sure the ADD and SUB instructions set C and DC properly.
  (ADB - I fixed a bug but I am almost sure there are a few left :-)

Bugs:

* Sometimes the instruction pointer gets screwed up (note --
  the simulator keeps working). The Program Counter jumps to another part of
  memory but the instruction window does not display the correct region.
  Only NOP instructions are executed until we loop back to address zero.
  (ADB - again, I _think_ I fixed this one; it seems the bug was in function
  get_addr in 16c84.cc) 

Futures:

* Fix all the known shortcomings.
* Fix the bug.
* Document this package.
* Use a modern widget set (suggestion: Qt + KDE).
* "LEDs" to indicate IC pin states.
* Logic traces of IC pin states.
* Breakpoints.
* Some method to provide input signals.
* Change 16C84 simulator to use an "instruction prefetch" cycle.
  Jumps will replace the prefetched instruction with a NOP, which will
  be executed while the jump target instruction is being fetched.
  (This is how the real thing works, isn't it?)
* Add simulators for other PICs.

Installation
------------

- xmkmf
- make
- copy the XPICsim file to /usr/X11R6/lib/X11/app-defaults
- xnitpic {hex file}