]> git.sur5r.net Git - cc65/blob - doc/sim65.sgml
remote TABs in doc/ and test/
[cc65] / doc / sim65.sgml
1 <!doctype linuxdoc system>      <!-- -*- text-mode -*- -->
2
3 <article>
4
5 <title>sim65 Users Guide
6 <author><url url="mailto:polluks@sdf.lonestar.org" name="Stefan A. Haubenthal">
7
8 <abstract>
9 sim65 is a simulator for 6502 and 65C02 CPUs. It allows to test target
10 independed code.
11 </abstract>
12
13 <!-- Table of contents -->
14 <toc>
15
16 <!-- Begin the document -->
17
18 <sect>Overview<p>
19
20
21 sim65 is the only solution as part of the toolchain to execute code. The
22 binary needs to be compiled with <tt/--target sim6502/ or <tt/--target sim65c02/.
23
24
25 <sect>Usage<p>
26
27 The simulator is called as follows:
28
29 <tscreen><verb>
30         Usage: sim65 [options] file [arguments]
31         Short options:
32           -h                    Help (this text)
33           -c                    Print amount of executed CPU cycles
34           -v                    Increase verbosity
35           -V                    Print the simulator version number
36           -x <num>              Exit simulator after <num> cycles
37
38         Long options:
39           --help                Help (this text)
40           --cycles              Print amount of executed CPU cycles
41           --verbose             Increase verbosity
42           --version             Print the simulator version number
43 </verb></tscreen>
44
45
46 <sect1>Command line options in detail<p>
47
48 Here is a description of all the command line options:
49
50 <descrip>
51
52   <tag><tt>-h, --help</tt></tag>
53
54   Print the short option summary shown above.
55
56
57   <tag><tt>-c, --cycles</tt></tag>
58
59   Print the number of executed CPU cycles when the program terminates.
60   The cycles for the final "<tt>jmp exit</tt>" are not included in this
61   count.
62
63
64   <tag><tt>-v, --verbose</tt></tag>
65
66   Increase the simulator verbosity.
67
68
69   <tag><tt>-V, --version</tt></tag>
70
71   Print the version number of the utility. When submitting a bug report,
72   please include the operating system you're using, and the compiler
73   version.
74
75
76   <tag><tt>-x num</tt></tag>
77
78   Exit simulator after num cycles.
79 </descrip>
80
81
82 <sect>Input and output<p>
83
84 The simulator will read one binary file per invocation and can log the
85 program loading and paravirtualization calls to stderr.
86
87 Example output for the command
88 <tscreen><verb>
89 sim65 --verbose --verbose samples/gunzip65
90 </verb></tscreen>
91 <tscreen><verb>
92 Loaded 'samples/gunzip65' at $0200-$151F
93 PVWrite ($0001, $13C9, $000F)
94 GZIP file name:PVWrite ($0001, $151F, $0001)
95
96 PVRead ($0000, $FFD7, $0001)
97 PVOpen ("", $0001)
98 PVRead ($0003, $1520, $6590)
99 PVClose ($0003)
100 PVWrite ($0001, $13D9, $000F)
101 Not GZIP formatPVWrite ($0001, $151F, $0001)
102
103 PVExit ($01)
104 </verb></tscreen>
105
106
107
108 <sect>Copyright<p>
109
110 sim65 (and all cc65 binutils) are (C) Copyright 1998-2000 Ullrich von
111 Bassewitz. For usage of the binaries and/or sources the following conditions
112 do apply:
113
114 This software is provided 'as-is', without any expressed or implied
115 warranty.  In no event will the authors be held liable for any damages
116 arising from the use of this software.
117
118 Permission is granted to anyone to use this software for any purpose,
119 including commercial applications, and to alter it and redistribute it
120 freely, subject to the following restrictions:
121
122 <enum>
123 <item>  The origin of this software must not be misrepresented; you must not
124         claim that you wrote the original software. If you use this software
125         in a product, an acknowledgment in the product documentation would be
126         appreciated but is not required.
127 <item>  Altered source versions must be plainly marked as such, and must not
128         be misrepresented as being the original software.
129 <item>  This notice may not be removed or altered from any source
130         distribution.
131 </enum>
132
133 </article>