ST20 emulator V2.0

March 15, 2002


How to use
----------

To start, type 'st20emu' in a DOS command window.  At the '>'
prompt, type

    l 7ff80000 <filename>

where <filename> is the name of a file with ST20 instructions in
it (e.g. a TSOP dump).  If you forget to do this, you'll get lots
of errors since the emulator won't have any ST20 instructions to
emulate.

Now you can start issuing commands to the emulator


Emulator commands
-----------------

Before going into the commands, here is a list of the parameters
that the commands use.

<value> refers to a 32 bit octal word.
<address> refers to a 32 bit octal address
<filename> refers to a TSOP dump filename
<register> is either
    a (A register)
    b (B register)
    c (C register)
    i (Iptr)
<index> is an octal number representing a valid Wptr index


Here are the commands...

<ENTER>
    The ENTER key executes next instruction

a <value>
    Sets the A register to the specified value

b <value>
    Sets the B register to the specified value

c <value>
    Sets the C register to the specified value

g
    Tells the emulator to run the emulation from the current
    address.  The prompting for commands is shut off.  Prompts
    will appear when a watch condition is met (see the 's'
    command) or when 1,000,000 instructions were executed without
    encountering a watch condition.  You can't execute a 'g'
    command if no watches are set.

i <value>
    Sets the Iptr register to the specified value

l <address> <filename>
    Loads the specified file into memory at starting at the
    specified address

load <name>
    Loads a presaved ST20 state that was saved by the save command

q
    quits the emulator

s <register> <value>
    sets a watch condition.  When the specified register is set
    to the specified value, a watch condition is triggered.

save <name>
    Creates a directory with the specified name that contains a
    dump of the memory contents and the CPU state.
    The memory contents are dumped in 8K chunks.
    The .bin files are the memory contents.  These can be loaded
    into a hex editor or into IDA for further processing.
    The .use files are flags indicating if a particular byte in
    memory has been defined or not.
    The cpu.bin file contains the CPU state.

v <address>
    views the word at the specified memory address

w <index> <value>
    sets the workspace word at index <index> to the specified
    value.

After a command is executed, the emulator will show
- the contents of the A, B, C and Iptr registers
- all of the allocated workspace words will also be shown
- next, the address of the next command, the octal values of
  the bytes that comprise the command and the mnemonic of the
  next command will be displayed
- finally, the command prompt ('>') will be displayed.

Here's an example of what you might see:
------------

A=0x7fff0014 B=0xaaaaaaaa C=0xaaaaaaaa  Iptr=0x7fff0038
Wptr  0=0x7fff0014  1=0x7ffffff0  2=0xaaaaaaaa 3=0xaaaaaaaa
      4=0x7ffffff0

7fff0038  60 bd  ajw fffffffd
>

------------
The ajw command has not been executed yet.  If you hit the ENTER
key, it will be executed and the results of its execution will be
displayed.


Notes
-----

Unused words are given the bit pattern 0xAAAAAAAA

The workspace has been assigned to the memory addresses from
0x1FFFF000 to 0x1FFFFFFF.  The first workspace word is stored
at 0x1FFFFFFC.  The workspace words are stored at consecutively
lower words.

Only the most common ST20 instructions have been implemented.
The emulator will warn you when an unimplemented instruction
has been encountered.

I still have lots of things to add to this emulator
- implement the complete set of instructions
- allow people to give names to addresses
- add a command to step over subroutines
- etc.
I'm willing to accept other suggestions but there's no guarantee
that I'll get any of the work done very quickly.


Troubleshooting
---------------

You need the CW3215.DLL file in the emulator's directory before
it will run.

This is a WIN32 app.  I don't think it will run in a 16 bit
environment (does anyone actually use these any more?).  I wrote
this for Win98.  I have no idea whether it works in NT/2000/XP.
