version 0.5.2
[fw/sdcc] / sim / ucsim / doc / cmd_dump.html
1 <html>
2 <head>
3 <title>Dump commands of &micro;Csim</title>
4 </head>
5
6 <body bgcolor="white">
7
8
9 <h2>Dump commands of &micro;Csim</h2>
10
11 <a name="dump"><h3>dump <i>memory_type [start [end [bytes_per_line]]]</i>
12 <br>dump <i>bit_name...</i></h3></a>
13
14 First form can be used get content of memory while second form can be
15 used to check value of bit or bits.
16
17
18 <blockquote>
19
20 <a name="dump_memory"><h4>dump <i>memory_type [start [end
21 [bytes_per_line]]]</i></h4></a>
22
23 Hexadecimal dump of a memory region. First parameter specifies
24 memory. It can be name of an address space or a chip, and can be
25 checked using <a href="cmd_general.html#info_memory">info memory</a>
26 command which lists size and name of all available memories.
27
28 <p><b>start</b> and <b>end</b> parameters can be used to specify the
29 first and last address of the dumped region. If <b>end</b> is omitted
30 then 64 memory location is dumped. If both <b>start</b> and <b>end</b>
31 are omitted then next 64 memory location will be dumped out. Every
32 time when dump command is used the address of last dumped memory
33 location is stored and next dump command automatically continues at
34 next address.
35
36 <p>Last parameter can be used to specify how many memory locations
37 should be dumped out in one line. It is 8 by default.
38
39 <pre>
40 $ <font color="#118811">s51 remo.hex</font>
41 ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
42 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
43 This is free software, and you are welcome to redistribute it
44 under certain conditions; type `show c' for details.
45 > 55470 words read from remo.hex
46 55470 words read from remo.hex
47 > <font color="#118811">run</font>
48 Simulation started, PC=0x000000
49
50 Stop at 0x000515: (105) User stopped
51 F 0x000515
52 > <font color="#118811">du rom 20</font>
53 0x0014 00 ac ff ff ff ff ff ff ........
54 0x001c ff ff ff ff ff ff ff 02 ........
55 0x0024 01 1c ff ff ff ff ff 32 .......2
56 0x002c ff ff ff ff 02 0f a7 02 ........
57 0x0034 0e 9c 02 0d d2 02 08 41 .......A
58 0x003c c0 82 c0 83 c0 d0 c0 e0 ........
59 0x0044 c0 00 a2 90 c0 d0 c2 90 ........
60 0x004c 78 18 06 30 03 4b 20 92 x..0.K .
61 0x0054 48 30 07 05 c2 07 02 00 H0......
62 0x005c 9d 30 08 05 20 93 3a c2 .0.. .:.
63 > <font color="#118811">du xram 10 20 10</font>
64 0x000a ff 01 00 fa 01 01 40 01 01 44 ......@..D
65 0x0014 01                            .
66 > <font color="#118811">du xram</font>
67 0x0015 00 00 00 00 00 00 00 00 ........
68 0x001d 00 10 01 00 ae 01 00 ae ........
69 0x0025 02 12 e1 00 5a 85 00 01 ....Z...
70 0x002d 00 3b 00 00 5a 85 00 ab .;..Z...
71 0x0035 1f 80 00 00 01 00 01 00 ........
72 0x003d fa 0c 02 01 00 fa 00 02 ........
73 0x0045 00 01 00 ab 00 00 00 00 ........
74 0x004d 00 00 5a 85 ff 00 01 00 ..Z.....
75 0x0055 00 00 00 94 a7 01 0c a6 ........
76 0x005d 00 6f ff 00 00 00 00 00 .o......
77 >
78 </pre>
79
80 <hr>
81
82
83 <a name="dump_bit"><h4>dump <i>bit_name...</i></h4></a>
84
85 If the simulated controller supports addressable bits (such as MCS51
86 does) this command can be used to print out values of bit(s). <a
87 href="syntax.html#bit_param">Any form of bit address</a> can be used
88 as parameter:
89
90 <pre>
91 0> <font color="#118811">dump ac p1.2 0x21</font>
92      PSW.6 0xd0 00 0
93       P1.2 0x90 ff 1
94     0x24.1 0x24 24 0
95 0> 
96 </pre>
97
98 Please note, that this command can not be used, if there is no address
99 space called <b>sfr</b>.
100
101 <pre>
102 $ <font color="#118811">sz80</font>
103 uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
104 uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
105 This is free software, and you are welcome to redistribute it
106 under certain conditions; type `show c' for details.
107 0> dump 0.0
108 No memory specified. Use "info memory" for available memories
109 0> 
110 </pre>
111
112
113 </blockquote>
114
115 <hr>
116
117
118 <a name="dch"><h3>dch <i>[start [stop]]</i></h3></a>
119
120 Hexadecimal dump of code memory area from address <b>start</b> to
121 address <b>stop</b>. Default value of start address is address of
122 following memory cell which was dumped by previous <b>dch</b>
123 command. If <b>stop</b> parameter is not given <b>dch</b> command
124 lists 10 lines 8 bytes per line.
125
126 <pre>
127 $ <font color="#118811">s51 remo.hex</font>
128 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
129 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
130 This is free software, and you are welcome to redistribute it
131 under certain conditions; type `show c' for details.
132 58659 bytes read from remoansi.hex
133 > <font color="#118811">wc remo</font>
134 0013da 52 65 6d 6f             Remo
135 > <font color="#118811">dch 0x13da</font>
136 0013da 52 65 6d 6f 20 00 56 65 Remo .Ve
137 0013e2 72 73 69 6f 6e 20 31 2e rsion 1.
138 0013ea 30 20 00 43 6f 70 79 72 0 .Copyr
139 0013f2 69 67 68 74 20 28 63 29 ight (c)
140 0013fa 20 00 31 39 39 34 2c 39  .1994,9
141 001402 35 20 00 54 61 6c 6b 65 5 .Talke
142 00140a 72 20 42 74 2e 00 53 75 r Bt..Su
143 001412 6e 64 61 79 2e 00 4d 6f nday..Mo
144 00141a 6e 64 61 79 2e 00 54 68 nday..Th
145 001422 75 65 73 64 61 79 2e 00 uesday..
146 > </pre>
147
148 First element in every lines is address of first byte dumped out in
149 the line. Next elements are hexadecimal values of bytes followed by
150 ASCII charactes of bytes dumped out in the line. If value of the
151 memory cell is not printable than a dot is dumped out.
152
153 <hr>
154
155
156 <a name="dc"><h3>dc <i>[start [stop]]</i></h3></a>
157
158 Disassembled dump of code memory area. This command simply produces
159 disassambled list of memory area specified by the parameters. Default
160 value of <b>start</b> parameter is last address listed by previous
161 <b>dc</b> command. If <b>stop</b> parameter is not given 20 lines are
162 listed.
163
164 <pre>
165 $ <font color="#118811">s51 remoansi.hex</font> 
166 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
167 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
168 This is free software, and you are welcome to redistribute it
169 under certain conditions; type `show c' for details.
170 58659 bytes read from remoansi.hex
171 > <font color="#118811">dc</font>
172    000000 02 01 60 LJMP  0160
173  * 000003 02 00 3c LJMP  003c
174  * 000006 ff       MOV   R7,A
175  * 000007 ff       MOV   R7,A
176  * 000008 ff       MOV   R7,A
177  * 000009 ff       MOV   R7,A
178  * 00000a ff       MOV   R7,A
179  * 00000b 02 3b e0 LJMP  3be0
180  * 00000e ff       MOV   R7,A
181  * 00000f ff       MOV   R7,A
182  * 000010 ff       MOV   R7,A
183  * 000011 ff       MOV   R7,A
184  * 000012 ff       MOV   R7,A
185  * 000013 02 00 ac LJMP  00ac
186  * 000016 ff       MOV   R7,A
187  * 000017 ff       MOV   R7,A
188  * 000018 ff       MOV   R7,A
189  * 000019 ff       MOV   R7,A
190  * 00001a ff       MOV   R7,A
191  * 00001b ff       MOV   R7,A
192  * 00001c ff       MOV   R7,A
193 > </pre>
194
195 <hr>
196
197
198 <a name="disassemble"><h3>disassemble <i>[start [offset
199 [lines]]]</i></h3></a>
200
201 Disassemble code. This command can be used to list disassembled
202 instructions which discovered by the <a href="analyzer.html">code
203 analyzer</a>. First two parameters specify the address where the list
204 starts. First parameter is address where the command starts to search
205 an instruction. This search goes forward. When the first instruction
206 marked by code analyzer found the simulator skips as many instructions
207 as you specify in second parameter. If <b>offset</b> is negative the
208 simulator goes backward and skips specified number of
209 instructions. Default value of
210 <b>start</b> parameter is last address which was listed by previous
211 <b>dis</b> command and default value of <b>offset</b> is -1. It means
212 you can make continuous list repeating parameterless <b>dis</b>
213 command.
214
215 <p>In third parameter you can specify how many instructions you want
216 to list. Default value is 20.
217
218 <pre>
219 $ <font color="#118811">s51 remoansi.hex</font>
220 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
221 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
222 This is free software, and you are welcome to redistribute it
223 under certain conditions; type `show c' for details.
224 58659 bytes read from remoansi.hex
225 > <font color="#118811">dis</font>
226    000000 02 01 60 LJMP  0160
227    000160 c2 90    CLR   P1.0
228    000162 c2 97    CLR   P1.7
229    000164 d2 b5    SETB  P3.5
230    000166 d2 b4    SETB  P3.4
231    000168 75 81 22 MOV   SP,#22
232    00016b 75 d0 00 MOV   PSW,#00
233    00016e 7e 00    MOV   R6,#00
234    000170 7f 00    MOV   R7,#00
235    000172 79 04    MOV   R1,#04
236    000174 12 0d b8 LCALL 0db8
237    000177 0f       INC   R7
238    000178 d9 fa    DJNZ  R1,0174
239    00017a 75 0b 00 MOV   0b,#00
240    00017d 75 0c 00 MOV   0c,#00
241    000180 02 02 2a LJMP  022a
242    000183 78 22    MOV   R0,#22
243    000185 76 00    MOV   @R0,#00
244    000187 d8 fc    DJNZ  R0,0185
245 > <font color="#118811">br 0x180</font>
246 > <font color="#118811">tbr 0x189</font>
247 > <font color="#118811">dis 0x180 -3 10</font>
248    000178 d9 fa    DJNZ  R1,0174
249    00017a 75 0b 00 MOV   0b,#00
250    00017d 75 0c 00 MOV   0c,#00
251 F  000180 02 02 2a LJMP  022a
252    000183 78 22    MOV   R0,#22
253    000185 76 00    MOV   @R0,#00
254    000187 d8 fc    DJNZ  R0,0185
255 D  000189 22       RET
256    00018a 90 09 ec MOV   DPTR,#09ec
257    00018d ae 83    MOV   R6,DPH
258 > </pre>
259
260 If there is an <b>F</b> or <b>D</b> character at the beginning of the
261 line, it means that there is a fix or dynamic fetch breakpoint at
262 listed address. Next element on the list can be an asterix (<b>*</b>)
263 which means that the listed address is not marked by the code
264 analyzer. <b>dis</b> lists marked instructions only so asterix never
265 appears in the list. Next element of the list is address displayed as
266 six digit hexadecimal number. Address is followed by hexadecimal dump
267 of instruction's code. Last element of the list is disassembled
268 instruction. Every number appeared on the list is hexadecimal number.
269
270 <hr>
271
272
273 <a name="di"><h3>di <i>[start [stop]]</i></h3></a>
274
275 Hexadecimal dump of <b>iram</b> named address space area from address
276 <b>start</b> to address <b>stop</b>. Default value of start address is
277 address of following memory cell which was dumped by previous
278 <b>di</b> command. If <b>stop</b> parameter is not given <b>di</b>
279 command lists 10 lines 8 bytes per line.
280
281 <pre>
282 $ <font color="#118811">s51 remoansi.hex</font>
283 ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
284 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
285 This is free software, and you are welcome to redistribute it
286 under certain conditions; type `show c' for details.
287 58659 bytes read from remoansi.hex
288 0> <font color="#118811">set opt irq_stop 1</font>
289 0> <font color="#118811">go</font>
290 Simulation started, PC=0x000000
291 Stop at 000023: (5) Interrupt
292 F 000023
293 0> <font color="#118811">di</font>
294 000000 18 02 16 ba 00 02 00 0a ........
295 000008 00 00 00 00 00 00 00 00 ........
296 000010 00 00 00 00 00 00 00 00 ........
297 000018 4a 00 00 00 00 00 00 00 J.......
298 000020 bc 27 06 2d 02 ee 35 8f .'.-..5.
299 000028 31 e7 42 01 0e 01 0b 00 1.B.....
300 000030 ec 0b 7f 10 7f a9 7e 08 ......~.
301 000038 fe 03 09 00 00 00 af 08 ........
302 000040 af 08 00 00 00 00 00 00 ........
303 000048 00 00 00 00 00 00 00 00 ........
304 0>
305 </pre>
306
307 <hr>
308
309
310 <a name="dx"><h3>dx <i>[start [stop]]</i></h3></a>
311
312 Hexadecimal dump of <b>xram</b> named address space area from address
313 <b>start</b> to address <b>stop</b>. Default value of start address is
314 address of following memory cell which was dumped by previous
315 <b>dx</b> command. If <b>stop</b> parameter is not given <b>dx</b>
316 command lists 10 lines 8 bytes per line.
317
318 <pre>
319 $ <font color="#118811">s51 remoansi.hex</font>
320 ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
321 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
322 This is free software, and you are welcome to redistribute it
323 under certain conditions; type `show c' for details.
324 58659 bytes read from remoansi.hex
325 0> <font color="#118811">set opt irq_stop 1</font>
326 0> <font color="#118811">go</font>
327 Simulation started, PC=0x000000
328 Stop at 000023: (5) Interrupt
329 F 000023
330 0> <font color="#118811">dx 0x100</font>
331 000100 00 00 00 00 00 00 00 00 ........
332 000108 00 00 00 00 00 00 00 00 ........
333 000110 00 00 00 00 00 00 00 00 ........
334 000118 00 00 00 00 00 00 00 00 ........
335 000120 00 00 00 00 00 00 00 00 ........
336 000128 00 00 00 00 00 00 00 44 .......D
337 000130 61 6e 69 00 00 00 02 02 ani.....
338 000138 07 00 00 ff 00 00 07 cb ........
339 000140 08 0c 32 00 07 cb 06 05 ..2.....
340 000148 02 00 24 00 00 00 00 00 ..$.....
341 0>
342 </pre>
343
344 <hr>
345
346
347 <a name="ds"><h3>ds <i>[start [stop]]</i></h3></a>
348
349 Hexadecimal dump of <b>sfr</b> named address space area from address
350 <b>start</b> to address <b>stop</b>. Default value of start address is
351 address of following memory cell which was dumped by previous
352 <b>ds</b> command. If <b>stop</b> parameter is not given <b>ds</b>
353 command lists 10 lines 8 bytes per line.
354
355 <pre>
356 $ <font color="#118811">s51 remo.hex</font>
357 ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
358 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
359 This is free software, and you are welcome to redistribute it
360 under certain conditions; type `show c' for details.
361 58659 bytes read from remoansi.hex
362 0> <font color="#118811">set opt irq_stop 1</font>
363 0> <font color="#118811">go</font>
364 Simulation started, PC=0x000000
365 Stop at 000023: (5) Interrupt
366 F 000023
367 0> <font color="#118811">ds</font>
368 0x80 ff 2a 1e 13 00 00 00 80 .*......
369 0x88 d5 21 f7 fd 50 fd 00 00 .!..P...
370 0x90 fe 00 00 00 00 00 00 00 ........
371 0x98 7e 0a 00 00 00 00 00 00 ~.......
372 0xa0 ff 00 00 00 00 00 00 00 ........
373 0xa8 97 00 00 00 00 00 00 00 ........
374 0xb0 ff 00 00 00 00 00 00 00 ........
375 0xb8 15 00 00 00 00 00 00 00 ........
376 0xc0 00 00 00 00 00 00 00 00 ........
377 0xc8 00 00 00 00 00 00 00 00 ........
378 0>
379 </pre>
380
381 <hr>
382
383
384 </body>
385 </html>