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