Skip to content
The portable, extendable 6809 simulator
C
Branch: trunk
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
prog Converted 6809 simulator to use autoconf for configuration. Oct 21, 2006
6809.c Implement some 6309 instructions. Jul 16, 2009
6809.h
COPYING Import of exec09 source files and sample hello program Jun 18, 2006
Makefile.am Miscellaneous changes. EON2 configuration uses new device types. Jul 18, 2009
Makefile.in Miscellaneous changes. EON2 configuration uses new device types. Jul 18, 2009
README Add shell commands to the README. Sep 4, 2008
command.c Add support for readline(), enabled at config time by --enable-readline. Jul 3, 2009
config.h.in Add support for readline(), enabled at config time by --enable-readline. Jul 3, 2009
configure Several new additions: Jul 16, 2009
configure.ac Add support for readline(), enabled at config time by --enable-readline. Jul 3, 2009
disk.c Move disk device into a separate file. Jul 18, 2009
eon.c Miscellaneous changes. EON2 configuration uses new device types. Jul 18, 2009
eon.h Several new additions: Jul 16, 2009
fileio.c Remove redundant include. Sep 6, 2008
imux.c Fix CPU interface to the imux; also add FIRQ support. Jul 18, 2009
ioexpand.c Miscellaneous changes. EON2 configuration uses new device types. Jul 18, 2009
machine.c Miscellaneous changes. EON2 configuration uses new device types. Jul 18, 2009
machine.h Miscellaneous changes. EON2 configuration uses new device types. Jul 18, 2009
main.c Exit program after using -h option. Jul 22, 2009
mmu.c Several new additions: Jul 16, 2009
monitor.c Comments/general cleanup. Jul 16, 2009
monitor.h Further updates: Aug 21, 2008
serial.c Checkin serial.c Jul 20, 2009
symtab.c Several improvements to the debugger: Jan 16, 2009
timer.c Generate timer interrupts correctly if enabled. Jul 18, 2009
wpc-run Change IRQ frequency for WPC machine. Jan 10, 2009
wpc.c Change the MMU flags to support un-readable pages as well. Jun 18, 2009
wpclib.c Modify WPC backend to send DMD date to a remote client. Sep 7, 2008
wpclib.h Modify WPC backend to send DMD date to a remote client. Sep 7, 2008

README

This is a rewrite of Arto Salmi's 6809 simulator.  Many changes
have been made to it.  This program remains licensed under the
GNU General Public License.

Input Files


Machines

The simulator now has the notion of different 'machines':
which says what types of I/O devices are mapped into the 6809's
address space and how they can be accessed.  Adding support for
a new machine is fairly easy.

There are 3 builtin machine types at present.  The default,
called 'simple', assumes that you have a full 64KB of RAM,
minus some input/output functions mapped at $FF00 (see I/O below).
If you compile a program with gcc6809 with no special linker
option, you'll get an S-record file that is suitable for running
on this machine.  The S-record file will include a vector table
at $FFF0, with a reset vector that points to a _start function,
which will call your main() function.  When main returns,
_start writes to an 'exit register' at $FF01, which the simulator
interprets and causes it to stop.

gcc6809 also has a builtin notion of which addresses are used
for text and data.  The simple machine enforces this and will
"fault" on invalid accesses.

The second machine is 'wpc', and is an emulation of the
Williams Pinball Controller which was the impetus for me
working on the compiler in the first place.

The third machine, still in development, is called 'eon'
(for Eight-O-Nine).  It is similar to simple but has some
more advanced I/O capabilities, like a larger memory space
that can be paged in/out, and a disk emulation for programs
that wants to have persistence.

TODO : Would anyone be interested in a CoCo machine type?


Faults


Debugging

The simulator supports interactive debugging similar to that
provided by 'gdb'.

b <expr>
	Set a breakpoint at the given address.

bl
	List all breakpoints.

c
	Continue running.

d <num>
	Delete a breakpoint/watchpoint.

di <expr>
	Add a display expression.  The value of the expression
	is display anytime the CPU breaks.

h
	Display help.

l <expr>
	List CPU instructions.

me <expr>
	Measure the amount of time that a function named by
	<expr> takes.

n
	Continue until the next instruction is reached.
	If the current instruction is a call, then
	the debugger resumes after control returns.

p <expr>
	Print the value of an expression.  See "Expressions" below.

q
	Quit the simulator.

re
	Reset the CPU/machine.

runfor <expr>
	Continue but break after a certain period of (simulated) time.

s
	Step one CPU instruction.

set <expr>
	Sets the value of an internal variable or target memory.
	See "Expressions" below for details on the syntax.

so <file>
	Run a set of debugger commands from another file.
	The commands may start/stop the CPU.  When the commands
	are finished, control returns to the previous input
	source (the file that called it, or the keyboard.)

sym <file>
	Load a symbol table file.  Currently, the only format
	supported is an aslink map file.

td
	Dump the last 256 instructions that were executed.

wa <expr>
	Add a watchpoint.  The CPU will break when the
	memory given by <expr> is modified.

x <expr>
	Examine target memory at the address given.


-----------------------------------------------------------------

Original README text from Arto:


simple 6809 simulator under GPL licence

NOTE! this software is beta stage, and has bugs.
To compile it you should have 32-bit ANSI C complier.

This simulator is missing all interrupt related SYNC, NMI Etc...

I am currently busy with school, thus this is relased.
if you have guestion or found something funny in my code please mail me.

have fun!

arto salmi	asalmi@ratol.fi

history:

2001-01-28 V1.0  original version
2001-02-15 V1.1  fixed str_scan function, fixed dasm _rel_???? code.
2001-06-19 V1.2  Added changes made by Joze Fabcic:
                 - 6809's memory is initialized to zero
                 - function dasm() had two bugs when using vc6.0 complier:
                   - RDWORD macro used two ++ in same variable
                   - _rel_byte address was wrong by 1.
                - after EXIT command, if invalid instruction is encountered, monitor is activated again
                - default file format is motorola S-record
                - monitor formatting


You can’t perform that action at this time.