ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/Frodo4/Docs/sam.html
Revision: 1.2
Committed: 2010-04-25T11:52:11Z (12 years, 7 months ago) by cebix
Content type: text/html
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +5 -4 lines
Log Message:
documentation update

File Contents

# Content
1 <HTML>
2 <HEAD>
3 <TITLE>SAM</TITLE>
4 </HEAD>
5 <BODY>
6
7 <H1>SAM</H1>
8
9 <CITE>
10 "Frodo! Mr.Frodo, my dear!" cried Sam,<BR>
11 tears almost blinding him. "It's Sam, I've come!"
12 </CITE>
13
14 <HR>
15
16 Frodo has a built-in machine language monitor that can be activated at any
17 time by pressing F9 (Unix, not available in full-screen mode) or selecting
18 the appropriate menu item (BeOS/AmigaOS/MacOS): SAM (Simple Assembler and
19 Monitor). It provides full access to the memory and hardware of the emulated
20 C64 and 1541 (under BeOS, you should only start SAM if you launched Frodo
21 from the Shell).<P>
22
23 SAM is controlled by a command-based interface, all numbers are in hex.
24 With the command "h" you can display a list of all commands. The command
25 "x" quits SAM and returns to Frodo.<P>
26
27 SAM has two modes of operation, indicated by the prompt "C64>" or "1541>".
28 You can switch between them with the "64" and "1541" commands. In "C64"
29 mode, all commands that access memory or the CPU operate on the memory/CPU
30 of the emulated C64. In "1541" mode, they operate on the emulated 1541
31 (this is only useful if the processor-level 1541 emulation is turned
32 on).<P>
33
34 All commands that access the C64 memory use the memory configuration set
35 with the "k" command. On starting up SAM, the configuration is set to the
36 one the processor is in. Accesses from within SAM have the same effect as
37 accesses of the emulated processor. This affects especially the I/O
38 registers: a memory dump of $dc00-$de00 clears pending CIA interrupts as
39 SAM reads from $dc0d and $dd0d. With the "v" commands, you can examine the
40 state of the I/O chips without modifying the state of the emulation.<P>
41
42 In all places where SAM expects a number (except in the assembler) you can
43 also enter an expression of hex numbers containing '+', '-', '*', '/' and
44 parens. Commands that create a longer output can be interrupted with
45 Ctrl-C.<P>
46
47 Here is a description of all commands ('[]' marks a parameter than can be
48 left out, '{}' marks a parameter that can be repeated many times. If a
49 [start] parameter is left out, SAM continues at the address where the last
50 command stopped):<P>
51
52
53 <PRE>
54 a [start] Assemble
55 </PRE><P>
56
57 starts the assembler at the address "start". SAM always prints the address
58 where the next instruction will be written to. The syntax of the
59 instructions conforms to the standard except for shift/rotation
60 instructions in the "accumulator" addressing mode. Those have to be entered
61 without operand, e.g. "lsr" instead of "lsr a". Entering a blank line quits
62 the assembler and returns to the command mode of SAM.<P>
63
64
65 <PRE>
66 b [start] [end] Binary dump
67 </PRE><P>
68
69 displays the memory from "start" to "end" byte-wise binary. With this
70 command, you can view character sets.<P>
71
72
73 <PRE>
74 c start end dest Compare memory
75 </PRE><P>
76
77 compares the memory in the range from "start" to (and including) "end"
78 with the memory at "dest". The addresses of all different bytes and the
79 total number of differences (decimal) are printed.<P>
80
81
82 <PRE>
83 d [start] [end] Disassemble
84 </PRE><P>
85
86 disassembles the memory from "start" to "end". Undocumented opcodes are
87 markes with a star '*'.<P>
88
89
90 <PRE>
91 e Show interrupt vectors
92 </PRE><P>
93
94 shows the currently active interrupt vectors of the 6510 (C64) or 6502
95 (1541) and (in C64 mode, if the Kernal ROM is mapped in) of the Kernal.<P>
96
97
98 <PRE>
99 f start end byte Fill memory
100 </PRE><P>
101
102 fills the memory in the range from "start" to (and including) "end" with
103 the value "byte".<P>
104
105
106 <PRE>
107 i [start] [end] ASCII/PETSCII dump
108 </PRE><P>
109
110 shows the memory from "start" to "end" as ASCII/PETSCII characters.<P>
111
112
113 <PRE>
114 k [config] Show/set C64 memory configuration
115 </PRE><P>
116
117 "k" without parameters shows the memory configuration that is set for SAM,
118 "k" with parameter modifies it. On exiting SAM, the configuration set with
119 the processor port is reactivated. The memory configuration has no effect
120 in 1541 mode. The 8 possible configurations are:
121
122 <PRE>
123 # $a000-$bfff $d000-$dfff $e000-$ffff
124 ----------------------------------------
125 0 RAM RAM RAM
126 1 RAM Char ROM RAM
127 2 RAM Char ROM Kernal ROM
128 3 Basic ROM Char ROM Kernal ROM
129 4 RAM RAM RAM
130 5 RAM I/O RAM
131 6 RAM I/O Kernal ROM
132 7 Basic ROM I/O Kernal ROM
133
134 </PRE>
135
136
137 <PRE>
138 l start "file" Load data
139 </PRE><P>
140
141 loads the contents of the specified file into memory starting from address
142 "start". The file name must be enclosed in quotation marks even if it
143 contains no spaces. This command cannot be used to load C64 programs as
144 it doesn't respect the embedded load address in the programs.<P>
145
146
147 <PRE>
148 m [start] [end] Memory dump
149 </PRE><P>
150
151 displays the memory from "start" to "end" as hexadecimal numbers and ASCII
152 characters.<P>
153
154
155 <PRE>
156 n [start] [end] Screen code dump
157 </PRE><P>
158
159 displays the memory from "start" to "end" as ASCII characters, interpreting
160 each byte as a screen code of the standard character set.<P>
161
162
163 <PRE>
164 o ["file"] Redirect output
165 </PRE><P>
166
167 When a file name is specified, all following output is redirected to this
168 file. The file name must be enclosed in quotation marks even if it contains
169 no spaces. Entering "o" without parameters closes the file and directs the
170 output into the window of SAM again.<P>
171
172
173 <PRE>
174 p [start] [end] Sprite dump
175 </PRE><P>
176
177 displays the memory from "start" to "end" binary with three bytes per line.
178 With this command, you can display sprite data.<P>
179
180
181 <PRE>
182 r [reg value] Show/set CPU registers
183 </PRE><P>
184
185 "r" without parameters shows all 6510 (C64) or 6502 (1541) registers and
186 flags and the instruction at the address specified by the program counter.
187 For the 6510, "DR" and "PR" are the data direction register and data
188 register of the processor port. To modify a register, give its name ("reg")
189 and the new value ("value") as parameters.<P>
190
191
192 <PRE>
193 s start end "file" Save data
194 </PRE><P>
195
196 writes the memory from "start" to (and including) "end" to the specified
197 file. The file name must be enclosed in quotation marks even if it contains
198 no spaces. This command cannot be used to save C64 programs as it doesn't
199 save a load address in the file.<P>
200
201
202 <PRE>
203 t start end dest Transfer memory
204 </PRE><P>
205
206 transfers the memory from "start" to (and including) "end" to "dest".
207 Source and destination may overlap.<P>
208
209
210 <PRE>
211 vc1 View CIA 1 state
212 </PRE><P>
213
214 shows the state of CIA 1 ($dc00).<P>
215
216
217 <PRE>
218 vc2 View CIA 2 state
219 </PRE><P>
220
221 shows the state of CIA 2 ($dd00).<P>
222
223
224 <PRE>
225 vf View floppy state
226 </PRE><P>
227
228 shows the state of the processor-level 1541 emulation.<P>
229
230
231 <PRE>
232 vs View SID state
233 </PRE><P>
234
235 shows the state of the SID.<P>
236
237
238 <PRE>
239 vv View VIC state
240 </PRE><P>
241
242 shows the state of the VIC.<P>
243
244
245 <PRE>
246 x Return to Frodo
247 </PRE><P>
248
249 quits SAM and returns to Frodo.<P>
250
251
252 <PRE>
253 : addr {byte} Modify memory
254 </PRE><P>
255
256 writes the space-separated values "byte" into memory starting at "addr".<P>
257
258
259 <PRE>
260 1541 Switch to 1541 mode
261 </PRE><P>
262
263 switches to 1541 mode. All commands that access memory or the CPU will then
264 operate on the emulated 1541 (processor-level).<P>
265
266
267 <PRE>
268 64 Switch to C64 mode
269 </PRE><P>
270
271 switches to C64 mode. All commands that access memory or the CPU will then
272 operate on the emulated C64.<P>
273
274
275 <PRE>
276 ? expression Calculate expression
277 </PRE><P>
278
279 calculates the value of the given expression and displays it in decimal
280 and hexadecimal.<P>
281
282 </BODY>
283 </HTML>