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