File: vice_9.html

package info (click to toggle)
vice 1.19-1etch1
  • links: PTS
  • area: contrib
  • in suites: etch
  • size: 27,132 kB
  • ctags: 33,406
  • sloc: ansic: 257,145; cpp: 13,395; sh: 3,674; makefile: 3,380; perl: 1,801; yacc: 622; lex: 258; asm: 4
file content (467 lines) | stat: -rw-r--r-- 14,969 bytes parent folder | download | duplicates (2)
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.52
     from ../vice.texi on 7 January 2006 -->

<TITLE>VICE Manual - 9  Monitor</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="vice_1.html">first</A>, <A HREF="vice_8.html">previous</A>, <A HREF="vice_10.html">next</A>, <A HREF="vice_16.html">last</A> section, <A HREF="vice_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC136" HREF="vice_toc.html#TOC136">9  Monitor</A></H1>

<P>
Every VICE emulator has a complete built-in monitor, which can be used
to examine, disassemble and assemble machine language programs, as
well as debug them through breakpoints.  It can be activated by using
the "Activate monitor" command (left button menu).  Notice that you
have to run the emulator from a terminal emulation program (such as
<CODE>rxvt</CODE> or <CODE>xterm</CODE>) in order to use the monitor.

</P>
<P>
<B>Warning</B>: this version of the monitor is still under construction,
and some of the features are not fully working yet.

</P>



<H2><A NAME="SEC137" HREF="vice_toc.html#TOC137">9.1  Terminology</A></H2>

<DL COMPACT>

<DT><SAMP>`address_space'</SAMP>
<DD>
This refers to the range of memory locations and a set of registers.
This can be the addresses available to the computer's processor, the
disk drive's processor or a specific memory configuration of one of
the mentioned processors.

<DT><SAMP>`bankname'</SAMP>
<DD>
The CPU can only see 64k of memory at any one time, due to its 16 bit
address bus. The C64 and other computers have more than this amount,
and this is handled by banking: a memory address can have different
contents, depending on the active memory bank. 
A bankname names a specific bank in the current address_space.

<DT><SAMP>`register'</SAMP>
<DD>
One of the following: program counter (PC), stack pointer (SP),
accumulator (A), X register (X), or Y register (Y).

<DT><SAMP>`address'</SAMP>
<DD>
A specific memory location in the range $0000 to $FFFF.

<DT><SAMP>`address_range'</SAMP>
<DD>
Two addresses.  If the second address is less than the first, the
range is assumed to wraparound from $FFFF to $0000.  Both addresses
must be in the same address space.

<DT><SAMP>`address_opt_range'</SAMP>
<DD>
An address or an address range.

<DT><SAMP>`prompt'</SAMP>
<DD>
The prompt has the format [x:y].  If x is -, memory reads from the
monitor do not have side effects.  Otherwise, x is S.  The second part
of the prompt, y, shows the default address space.

<DT><SAMP>`checkpoint'</SAMP>
<DD>
The monitor has the ability to setup triggers that perform an action
when a specified situation occurs.  There are three types of
checkpoints; breakpoints, tracepoints and watchpoints.

<DT><SAMP>`breakpoint'</SAMP>
<DD>
A breakpoint is triggered based on the program counter.  When it is
triggered, the monitor is entered.

<DT><SAMP>`tracepoint'</SAMP>
<DD>
Like breakpoints, a tracepoint is triggered based on the program
counter.  Instead of entering the monitor, the program counter is
printed and execution continues.

<DT><SAMP>`watchpoint'</SAMP>
<DD>
Watchpoints are triggered by a read and/or write to an address.  When
a watchpoint is triggered, the monitor is entered.

<DT><SAMP>`&#60;...&#62;'</SAMP>
<DD>
A data type.

<DT><SAMP>`*'</SAMP>
<DD>
Zero or more occurrences.

<DT><SAMP>`[...]'</SAMP>
<DD>
An optional argument.

</DL>



<H2><A NAME="SEC138" HREF="vice_toc.html#TOC138">9.2  Machine state commands</A></H2>

<DL COMPACT>

<DT><CODE>goto &#60;address&#62;</CODE>
<DD>
Change the PC to address and continue execution.

<DT><CODE>io</CODE>
<DD>
Nothing yet.  Will display VIC/VIA/CIA/SID registers.

<DT><CODE>next [&#60;count&#62;]</CODE>
<DD>
Advance to the next instruction.  Subroutines are treated as a single
instruction.

<DT><CODE>registers [&#60;reg_name&#62; = &#60;number&#62; [, &#60;reg_name&#62; = &#60;number&#62;]*]</CODE>
<DD>
Assign respective registers.  With no parameters, display register
values.

<DT><CODE>return</CODE>
<DD>
Continues execution  and returns to the monitor just
after the next RTS or RTI is executed.

<DT><CODE>step [&#60;count&#62;]</CODE>
<DD>
Single step through instructions.  An optional count allows stepping
more than a single instruction at a time.

</DL>



<H2><A NAME="SEC139" HREF="vice_toc.html#TOC139">9.3  Memory commands</A></H2>

<DL COMPACT>

<DT><CODE>bank [&#60;bankname&#62;]</CODE>
<DD>
Without a bankname, display all available banks for the current
address_space. With a bankname given, switch to the specified
bank. If a bank is not completely filled (ROM banks for example)
normally the <CODE>ram</CODE> bank is used where the bank has holes.
The <CODE>cpu</CODE> bank uses the bank currently used by the CPU.

<DT><CODE>compare &#60;address_range&#62; &#60;address&#62;</CODE>
<DD>
Compare memory from the source specified by the address range to the
destination specified by the address.  The regions may overlap.  Any
values that miscompare are displayed using the default displaytype.

<DT><CODE>device [c:|8:|9:]</CODE>
<DD>
Set the default address space to either the computer `c:' or the
specified drive `8:' or `9:'
<DT><CODE>fill &#60;address_range&#62; &#60;data_list&#62;</CODE>
<DD>
Fill memory in the specified address range with the data in
&#60;data_list&#62;.  If the size of the address range is greater than the
size of the data_list, the data_list is repeated.

<DT><CODE>hunt &#60;address_range&#62; &#60;data_list&#62;</CODE>
<DD>
Hunt memory in the specified address range for the data in
&#60;data_list&#62;.  If the data is found, the starting address of the match
is displayed.  The entire range is searched for all possible matches.

<DT><CODE>i &#60;address_opt_range&#62;</CODE>
<DD>
Display memory contents as PETSCII text.

<DT><CODE>m [&#60;data_type&#62;] [&#60;address_opt_range&#62;]</CODE>
<DD>
Display the contents of memory.  If no datatype is given, the default
is used.  If only one address is specified, the length of data
displayed is based on the datatype.  If no addresses are given, the
'dot' address is used.

<DT><CODE>mc [&#60;data_type&#62;] [&#60;address_opt_range&#62;]</CODE>
<DD>
Display the contents of memory as character data.  If only one address
is specified, only one character is displayed.  If no addresses are
given, the "dot" address is used.

<DT><CODE>ms [&#60;data_type&#62;] [&#60;address_opt_range&#62;]</CODE>
<DD>
Display the contents of memory as sprite data.  If only one address is
specified, only one sprite is displayed.  If no addresses are given,
the "dot" address is used.

<DT><CODE>move &#60;address_range&#62; &#60;address&#62;</CODE>
<DD>
Move memory from the source specified by the address range to the
destination specified by the address.  The regions may overlap.

<DT><CODE>sidefx [on|off|toggle]</CODE>
<DD>
Control how monitor generated reads affect memory locations that have
read side-effects, like CIA interrupt registers for example.  
If the argument is 'on' then reads may cause side-effects.  If the
argument is 'off' then reads don't cause side-effects.  If the
argument is 'toggle' then the current mode is switched.  No argument
displays the current state.

<DT><CODE>&#62; [&#60;address&#62;] &#60;data_list&#62;</CODE>
<DD>
Write the specified data at <CODE>address</CODE>.

</DL>



<H2><A NAME="SEC140" HREF="vice_toc.html#TOC140">9.4  Assembly commands</A></H2>

<DL COMPACT>

<DT><CODE>a &#60;address&#62; [ &#60;instruction&#62; [: &#60;instruction&#62;]* ]</CODE>
<DD>
Assemble instructions to the specified address.  If only one
instruction is specified, enter assembly mode (enter an empty line to
exit assembly mode).

<DT><CODE>d [&#60;address&#62; [&#60;address&#62;]]</CODE>
<DD>
Disassemble instructions.  If two addresses are specified, they are
used as a start and end address.  If only one is specified, it is
treated as the start address and a default number of instructions are
disassembled.  If no addresses are specified, a default number of
instructions are disassembled from the dot address.

</DL>



<H2><A NAME="SEC141" HREF="vice_toc.html#TOC141">9.5  Checkpoint commands</A></H2>

<DL COMPACT>

<DT><CODE>break [&#60;address&#62; [if &#60;cond_expr&#62;] ]</CODE>
<DD>
This command allows setting a breakpoint or listing the current
breakpoints.  If no address is given, the currently valid checkpoints
are printed.  If an address is given, a breakpoint is set for that
address and the breakpoint number is printed.  A conditional
expression can also be specified for the breakpoint.  For more
information on conditions, see the CONDITION command.

<DT><CODE>enable &#60;checknum&#62;</CODE>
<DD>
<DT><CODE>disable &#60;checknum&#62;</CODE>
<DD>
Each checkpoint can be enabled or disabled.  This command allows
changing between these states.

<DT><CODE>command &#60;checknum&#62; "&#60;command&#62;"</CODE>
<DD>
When checkpoint <CODE>checknum</CODE> is hit, the specified command is
executed by the monitor.  Note that the <CODE>x</CODE> command is not yet
supported as a command argument.

<DT><CODE>condition &#60;checknum&#62; if &#60;cond_expr&#62;</CODE>
<DD>
Each time the specified checkpoint is examined, the condition is
evaluated.  If it evalutes to true, the checkpoint is activated.
Otherwise, it is ignores.  If registers are specified in the
expression, the values used are those at the time the checkpoint is
examined, not when the condition is set.

<DT><CODE>delete &#60;checknum&#62;</CODE>
<DD>
Delete the specified checkpoint.

<DT><CODE>ignore &#60;checknum&#62; [&#60;count&#62;]</CODE>
<DD>
Ignore a checkpoint after a given number of crossings.  If no count is
given, the default value is 1.

<DT><CODE>trace [address [address]]</CODE>
<DD>
This command is similar to the <CODE>break</CODE> command except that it
operates on tracepoints.  A tracepoint differs from a breakpoint by
not stopping execution but simply printing the PC, giving the user an
execution trace.  The second optional address can be used to specify
the end of an range of addresses to be traced.

<DT><CODE>watch [loadstore] [address [address]]</CODE>
<DD>
This command is similar to the previous two commands except that it
operates on watchpoints.  A watchpoint differs from the others by
stopping on a read and/or write to an address or range of addresses.
If no addresses are given, a list of all the watchpoints is printed.
The loadstore parameter can be either "load" or "store" to determine
on which operation the monitor breaks. If not specified, the monitor
breaks on both operations.

</DL>



<H2><A NAME="SEC142" HREF="vice_toc.html#TOC142">9.6  General commands</A></H2>

<DL COMPACT>

<DT><CODE>cd &#60;directory&#62;</CODE>
<DD>
Change the working directory.

<DT><CODE>device [c:|d:]</CODE>
<DD>
Set the default memory device to either the computer (<CODE>c:</CODE>) or
the disk (<CODE>d:</CODE>).

<DT><CODE>radix [H|D|O|B]</CODE>
<DD>
Set the default radix to hex, decimal, octal, or binary.  With no
argument, the current radix is printed.

<DT><CODE>sidefx [on|off|toggle]</CODE>
<DD>
Control how monitor generated reads affect memory locations that have
read side-effects.  If the argument is 'on' then reads may cause
side-effects.  If the argument is 'off' then reads don't cause
side-effects.  If the argument is 'toggle' then the current mode is
switched.  No argument displays the current state.

<DT><CODE>system &#60;system command&#62;</CODE>
<DD>
Nothing yet.

</DL>



<H2><A NAME="SEC143" HREF="vice_toc.html#TOC143">9.7  Disk commands</A></H2>

<DL COMPACT>

<DT><CODE>br &#60;track&#62; &#60;sector&#62; [&#60;address&#62;]</CODE>
<DD>
Read the block at the specified track and sector.  If an address is
specified, the data is loaded into memory.  If no address is given,
the data is displayed using the default datatype.

<DT><CODE>bw &#60;track&#62; &#60;sector&#62; &#60;address&#62;</CODE>
<DD>
Write a block of data at <CODE>address</CODE> to the specified track and
sector of disk in drive 8.

<DT><CODE>@&#60;disk command&#62;</CODE>
<DD>
Perform a disk command on the currently attached disk image on drive
8.  The specified disk command is sent to the drive's channel #15.

<DT><CODE>load "&#60;filename&#62;" &#60;device&#62; [&#60;address&#62;]</CODE>
<DD>
Load the specified file into memory.  If no address is given, the file
is loaded to the address specified by the first two bytes read from
the file.  If address is given, the file is loaded to the specified
address and the first two bytes read from the file are skipped.  If
device is 0, the file is read from the file system.

<DT><CODE>save "&#60;filename&#62;" &#60;device&#62; &#60;address1&#62; &#60;address2&#62;</CODE>
<DD>
Save the memory from address1 to address2 to the specified file.  If
device is 0, the file is written to the file system.

</DL>



<H2><A NAME="SEC144" HREF="vice_toc.html#TOC144">9.8  Command file commands</A></H2>

<DL COMPACT>

<DT><CODE>playback "&#60;filename&#62;"</CODE>
<DD>
Monitor commands from the specified file are read and executed.  This
command stops at the end of file or when a STOP command is read.

<DT><CODE>record "&#60;filename&#62;"</CODE>
<DD>
After this command, all commands entered are written to the specified
file until the STOP command is entered.

<DT><CODE>stop</CODE>
<DD>
Stop recording commands.  See <CODE>record</CODE>.

</DL>



<H2><A NAME="SEC145" HREF="vice_toc.html#TOC145">9.9  Label commands</A></H2>

<DL COMPACT>

<DT><CODE>add_label &#60;address&#62; &#60;label&#62;</CODE>
<DD>
Map a given address to a label.  This label can be used when entering
assembly code and is shown during disassembly.

<DT><CODE>delete_label [&#60;memspace&#62;] &#60;label&#62;</CODE>
<DD>
Remove the specified label from the label tables.  If no memory space is
checked, all tables are checked.

<DT><CODE>load_labels [&#60;memspace&#62;] "&#60;filename&#62;"</CODE>
<DD>
Load a file containing a mapping of labels to addresses.  If no memory
space is specified, the default readspace is used.

<DT><CODE>save_labels [&#60;memspace&#62;] "&#60;filename&#62;"</CODE>
<DD>
Save labels to a file.  If no memory space is specified, all of the
labels are saved.

<DT><CODE>show_labels [&#60;memspace&#62;]</CODE>
<DD>
Display current label mappings.  If no memory space is specified, show
all labels.

</DL>



<H2><A NAME="SEC146" HREF="vice_toc.html#TOC146">9.10  Miscellaneous commands</A></H2>

<DL COMPACT>

<DT><CODE>exit</CODE>
<DD>
Leave the monitor and return to execution.

<DT><CODE>print &#60;expression&#62;</CODE>
<DD>
Evaluate the specified expression and output the result.

<DT><CODE>quit</CODE>
<DD>
Exit the emulator immediately.

<DT><CODE>~ &#60;number&#62;</CODE>
<DD>
Display the specified number in decimal, hex, octal and binary.

</DL>

<P><HR><P>
Go to the <A HREF="vice_1.html">first</A>, <A HREF="vice_8.html">previous</A>, <A HREF="vice_10.html">next</A>, <A HREF="vice_16.html">last</A> section, <A HREF="vice_toc.html">table of contents</A>.
</BODY>
</HTML>