At 12:24 PM 2/10/2018 -0700, you wrote:
Does anyone have source to a 6809 monitor program?
I'm looking for something I can make work in a CoCo.
Functionality I'm looking for is something that will let me read and
write to memory.
Attached is the zipped C source code for a 6809 monitor I wrote in the early 1990s.
Compiler used was HiTech C. Build files included.
It worked, but of course 'there may be bugs.' :)
It's fairly generic, so not many changes needed for other CPUs. I also did an 80C196
ver.
If the zip file attachment fails, it's online here:
http://everist.org/texts/6809_Mon_V2.zip
Doco from the MONITOR.C file:
/* File: MONITOR.C
For machine: Dual 6809 game board.
Compiler: Hitech 6809 C.
Written: Guy Dunphy, 4/9/94, derived from an earlier version. (by me)
This file contains all code for a versatile serial monitor.
It is event driven, and time sliced, so it can operate in the
background with other CPU tasks.
All data is stored big-endian.
All serial I/O is via the functions aux_get_ch(), aux_put_ch().
Serial Tx is polled, while Rx can be either polled, or buffered interrupt
driven with hardware handshaking (via RTS). See monitor_init().
This monitor can be used in multi CPU systems, where only one CPU has a
serial comms interface, and each has different IO/mem maps and codespaces.
If there is a means for passing strings between the CPUs, then the one
with serial IO is used to run a 'master' copy of the monitor, and the
other CPU(s) runs a 'slave' monitor version.
The master CPU does all command line entry/edit operations, and can be
set to pass complete command lines on to other CPU(s). It also will echo
text returned from the slave CPU(s) to the serial interface.
To use this file:-
* For single CPU operation, just compile it as is.
* As a 'master' (talks to a slave), predefine symbol MON_MASTER.
* As a 'slave', predefine symbol MON_SLAVE.
Monitor commands (See also mon_help_text[] )
----------------
Multiple cmds allowed on a line, use ';' to separate.
Upper/lower case of commands and parameters is not significant.
A 'range' may be:-
start
start end
start length (Shorthand form: if length is small and < start.)
start L length
space (as 1st char) Repeat last command. Execute or re-edit.
tab (as 1st char) Repeat 'saved' command. Execute or re-edit.
tab (not 1st char) Copy cmd to 'save' buffer.
esc (as 1st char) Allow re-edit of following 'repeat' cmd.
(... twice ) Kill 'pass cmds to slave' mode.
D range Dump mem.
D (no other chars) Dump another 64 bytes
F[W][I] range data Fill memory. W=word, I=increment.
G addr Go (call) to addr
M start [data]... Modify mem.
data ::= hex_byte | string | char
string ::= "text"
char ::= 'c
R [reg_name = value] Optionally modify register(s), then display all regs.
reg_name ::= cc a b d dp x y u pc
Z [flag_val] Zot! Set operation mode. Bit flags set are:-
b0 Halt system (no return from monitor).
b1 Inhibit serial echo.
b2 Inhibit serial prompt output.
b3 Inhibit all monitor output (incl help).
b4 Pass all cmds to slave CPU. ESC,ESC to exit.
Examples:-
Z Re-initialize monitor. Lose trailing cmds.
Z 0 Restore normal operation, continue.
Z F Just accept commands, no system, echo, etc.
Z 2 Normal, but no echo (ie half duplex).
S1ccaaaadddddd....ddss<CR> Motorola data record. Load to memory.
Each hex line is treated as a command, so there is no special 'load' cmd.
Before sending hex, best to do a Z6 or Z7 to stop all other time
consuming tasks. When finished, do a Z 0 to restore normal ops.
An ASCII ACK ($06) is sent when line processing is complete and no
error found. This can be used as an acknowledge.
If an error is found, a '?' is returned. See s19_decode().
S0.... and S9.... Header and end records: ignored.