Saturn DSP Emulator System (c) Copyright A.R.Hartley 1995,
	Version 1.0 Beta

Features


 . Full instruction emulation.
 . Source level debugging with Psyq.
 . Symbolic debugging with Psyq.
 . Built in file viewer.
 . Help facility.

Command Line Options


DSPEMU	<options> test.bin

-E	- Use mode 80x50 emulation for EGA monitors
-U	- Force symbols to upper case

Main Keys Quick Reference


F1	- Display help file
F2	- Toggle breakpoint
F7	- Trace into
F8	- Trace over
F9	- Run full speed
F10	- Source level debuging toggle

A	- Alter memory
B	- Set break expression
C	- Clear all breakpoints
D	- Set dump address
F	- Run fast trace
G	- Goto address
L	- Load to current dump memory
M	- Load and view a file
R	- Set registor (reg = expression)
S	- Save from current dump memory
U	- Trace until break expression met
V	- Calculate an expression
HOME	- Center on PC

ALT-B	- Select next dump display size type, (byte,word,long)
ALT-M	- Toggle to last viewed file
ALT-N	- Goto next dump memory (m0,m1,m2,m3,prg,dma)
ALT-R	- Reset processor and program.
ALT-X	- Exit
CTRL-X	- Exit
CTRL-TAB	- Cycle through instruction bars

ALT-CURSOR	- Scroll memory dump up, down, left, right
CTL-CURSOR	- Moves memory alter cursor around dump

Format for Setting Regs


Command key:

R	- Set registor (reg = expression)

Registor types:

	RX	- long reg
	RY	- long reg
	PH	- word reg
	PL	- long reg
	ACH	- high word part of accumulator
	ACL	- low long part of accumulator

	RA0	- dma external read address
	WA0	- dma external write address

	CT0	- m0 long pointer address
	CT1	- m1 long pointer address
	CT2	- m2 long pointer address
	CT3	- m3 long pointer address

	TOP	- loop top address
	LOP	- loop count reg

	FLAGS	- system flags

	FLAG_Z	- zero flag
	FLAG_S	- sign flag
	FLAG_C	- carry flag
	FLAG_T	- dma active flag (tn0)
	FLAG_V	- overflag parity flag

	PC	- pc address (in bytes)
	CYCS	- amount of cycles

To set say rx to 1,

	RX = 1

and to set pc to 100h

	PC = #100

You can use all of you program symbols (if you use PSYQ)
to form any expression.

	PC = copy_dma_prg

Changing the State of the Flags


To clear the zero flag,

	FLAG_Z = 0

or set the carry flag,

	FLAG_C = 1

Setting Breakpoints


F2	- Toggle breakpoint

This is easy, all you have to do is to put the cursor over
the instruction you want to break on and press F2, to remove it
just toggle it. When you run the program it should stop.

You can also clear all breakpoints by pressing 'C'
the program will ask you if you really want too, if you do
press 'y'.

Setting the Break Condition


B	- Set break expression
U	- Trace until break expression met

If you type 'B', the program will ask you to enter an expression
try typing,

	RX > 966 AND RY == 10

If you then push 'U' the program will run until the break condition
is met or it hits a breakpoint.


Examples,

	PC == 96		;Until pc = 96
	PC = 69			;Until pc = 96
	RY > 51 OR PH < 4	;Until ry > 51 or ph < 4
	FLAG_Z = 1		;Until carry set

Using Dumps


D	- Set dump

To set dump locations you just enter the loction expression.

	#4000

This will view $4000 in the current type, pressing ALT-B
will switch dump types, this will not change the dump address


Examples,

	Topdata		;Set dump to address of topdata
	$32		;Set dump to 32h

so you see, you can make these expression a complex as you wish.

Memory Map


	Program ram	00000000 to 000003FF
	ram0 (m0)	00000000 to 000000FF
	ram1 (m1)	00000000 to 000000FF
	ram2 (m2)	00000000 to 000000FF
	ram3 (m3)	00000000 to 000000FF
	dsp extrn ram	00000000 to 0000FFFF

Note: The contents of the 64k of DSP Ram are repeated throughout
memory.

Saving and loading memory


Saving and loading will always be read/written to the current
selected dump memory, to say a file of the dspram, first use
ALT N to set the currect dump, and then press S entering,

	filename,start,size

Example,
	TEST.BIN,$100,$99
	
this will save bytes to disk from address $100 to $199.


To load from disk, first select the select the current dump,
press L to load from disk,

	filename,start,<len>

Example,
	TEST.BIN,$200		(load all of file)
	TEST.BIN,$200,$50	(only load $50 bytes)

the bytes in you file will be loaded in to the selected dump memory,
if you use a length then you can crop the size of the file input.
	

Emulator expressions


Internal expressions are evaluated with priorty, brackets etc,
using C standard operators,

123	- Decimal number
#1F0	- Hex number
$1F0	- Hex number
%11011	- Binary number
'1234'	- Ascii
label	- Equated label

(exp)	- Sub-expressions
-	- Unary Negate
* /	- Multiplication, Division
%  	- Modulo
+ -	- Addition, Subtraction
<< >>	- Shift Left, Shift Right
< >	- Less or Greater
<=	- Greater Than or Equal To
>=	- Less Than or Equal To
==	- Equal to
=	- Equal to
!=	- Not Equal to
<>	- Not Equal to
& 	- Bitwise And
^ 	- Bitwise Xor
| 	- Bitwise Or
&&	- Logical And
AND	- Logical And
||	- Logical Or
OR	- Logical Or

Functions:

BYTE()	- Get a byte from memory at expression
WORD()	- Get a word from memory at expression
LONG()	- Get a long from memory at expression

Note- Memory tested when using BYTE() or WORD() functions
      is from the current dump.


If you have any problems or comments please contact,

	SN Systems software ltd,
	Tel.	0117 929 9733

	Tony Hartley,
	Granngsringen 35 tr 3
	13544 Tyres,
	Sweden.

	Tel.	+46 8 798 3257
	office.	+46 8 676 8251
	mobile.	+46 70 7672751 (gsm)  
	eMail	tony_h@algonet.se
