-
Notifications
You must be signed in to change notification settings - Fork 1
/
st20emu3.txt
238 lines (182 loc) · 7 KB
/
st20emu3.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
ST20 emulator V3.0
V2.0 March 15, 2002
V3.0 December 20, 2011
V3.1 December 31, 2011
V3.2 January 04, 2012
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.
Some settings are read from 'st20emu.ini' file, that must be in the
same directory of the emulator. The content of this file is easily
understandable and the commands are self-explanatory.
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
db <value>
Search in the internal DB some info's about
the specified register passed as arguments (hex number).
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.
During execution you can press the 'g' key to stop'em all :)
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
omr
show the contents of the 'Other Machine Registers', clock, some
status registers, trap, interrupts and others.
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
va <address> <value>
set the word at the specified address with the specified value.
vaa <address> <range>
views the number of words specified by the range parameter,
starting from the specified address
ver
show the content of the 'Enables' register, with descriptive
labels for every bit set to 1.
vra
"V"erbose "R"egister "A"ccess, set the correspondent flag
for a verbose output when a devlb/sb devlw/sb instruction is
executed. (only STi5518 regs are supported at moment).
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
>
And this with the 'vra' mode ON (if an entry is found in the internal DB)
------------
7fff01a4 2f f1 devsb
>
NOTE: At 0x7fff01a4 Write to device at address 00000e00, value=0x00000007
REGN: MPEG_CONTROL_7_0 bits:8 access:R/W
DESC: MPEG Audio/Video buffer control register
A=0x7fff01d2 B=0xaaaaaaaa C=0xaaaaaaaa Iptr=0x7fff01a6
Wptr 0=0x7fff01d2 1=0xaaaaaaaa 2=0xaaaaaaaa 3=0xaaaaaaaa
4=0x7ffffff0 5=0xaaaaaaaa 6=0xaaaaaaaa
7fff01a6 27 40 ldc 70
>
------------
Where:
NOTE is the usual field put there by st20emu
REGN stand for (REG)ister (N)ame
bits: is the register extension in bit
access: is the access allowed for this register (R)ead (W)rite etc.
DESC: stand for (DESC)ription, when available.
This is the output of the 'omr' command...
------------
> omr
OTHER MACHINE REGISTERS
-----------------------
Enables=0xffffc000
ClockRegHP=0x20000000 ClockRegLP=0x20000000 ClockEnables=0x03
HP_ErrFlag=0x00 LP_ErrFlag=0x00 HaltOnError=0x00
>
------------
...and this for 'ver'
> ver
Enables Register Value=0xffffc000
LP_PROCESS_INT_ENB is set
LP_TIMESLICE_ENB is set
LP_EXTERNALEVENT_ENB is set
LP_TIMER_ALRM_ENB is set
HP_PROCESS_INT_ENB is set
HP_TIMESLICE_ENB is set
HP_EXTERNALEVENT_ENB is set
HP_TIMER_ALRM_ENB is set
>
------------
devls/lb/lw and devss/sb/sw can be used for memory access too, so if a specific
address isn't found in the internal DB, a more generic description is returned
based over the Datasheet memory map description. Example:
NOTE: At 0xc0402804 Write to device at address c042a5e8, value=0x00000002
DESCR: Address is into Shared SDRAM (Region 1)
------------
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
---------------
*Mar 2002
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.
*Dec 2011
Can be compiled with VC++ Express, work fine in 2K/XP/Win7.