3 <title>Dump commands of uCsim</title>
10 <h2>Dump commands of uCsim</h2>
12 <a name="dis"><h3><img src="burst.gif" alt="[Repeatable]"> dis
13 [start [offset [lines]]]</h3></a>
15 Disassemble code. This command can be used to list disassembled
16 instructions which discovered by the code analyzer. First two
17 parameters specify the address where the list starts. First parameter
18 is address where the command starts to search an instruction. This
19 search goes forward. When the first instruction marked by code
20 analyzer found the simulator skips as many instructions as you specify
21 in second parameter. If <b>offset</b> is negative the simulator goes
22 backward and skips specified number of instructions. Default value of
23 <b>start</b> parameter is last address which was listed by previous
24 <b>dis</b> command and default value of <b>offset</b> is -1. It means
25 you can make continuous list repeating parameterless <b>dis</b>
28 <p>In third parameter you can specify how many instructions you want
29 to list. Default value is 20.
32 $ <font color="#118811">s51 remoansi.hex</font>
33 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
34 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
35 This is free software, and you are welcome to redistribute it
36 under certain conditions; type `show c' for details.
37 58659 bytes read from remoansi.hex
38 > <font color="#118811">dis</font>
40 000000 02 01 60 LJMP 0160
43 000164 d2 b5 SETB P3.5
44 000166 d2 b4 SETB P3.4
45 000168 75 81 22 MOV SP,#22
46 00016b 75 d0 00 MOV PSW,#00
47 00016e 7e 00 MOV R6,#00
48 000170 7f 00 MOV R7,#00
49 000172 79 04 MOV R1,#04
50 000174 12 0d b8 LCALL 0db8
52 000178 d9 fa DJNZ R1,0174
53 00017a 75 0b 00 MOV 0b,#00
54 00017d 75 0c 00 MOV 0c,#00
55 000180 02 02 2a LJMP 022a
56 000183 78 22 MOV R0,#22
57 000185 76 00 MOV @R0,#00
58 000187 d8 fc DJNZ R0,0185
59 > <font color="#118811">bs f 0x180</font>
60 > <font color="#118811">bs d 0x189</font>
61 > <font color="#118811">dis 0x180 -3 10</font>
62 000178 d9 fa DJNZ R1,0174
63 00017a 75 0b 00 MOV 0b,#00
64 00017d 75 0c 00 MOV 0c,#00
65 F 000180 02 02 2a LJMP 022a
66 000183 78 22 MOV R0,#22
67 000185 76 00 MOV @R0,#00
68 000187 d8 fc DJNZ R0,0185
70 00018a 90 09 ec MOV DPTR,#09ec
71 00018d ae 83 MOV R6,DPH
74 If there is an <b>F</b> or <b>D</b> character at the beginning of the
75 line, it means that there is a fix or dynamic fetch breakpoint at
76 listed address. Next element on the list can be an asterix (<b>*</b>)
77 which means that the listed address is not marked by the code
78 analyzer. <b>dis</b> lists marked instructions only so asterix never
79 appears in the list. Next element of the list is address displayed as
80 six digit hexadecimal number. Address is followed by hexadecimal dump
81 of instruction's code. Last element of the list is disassembled
82 instruction. Every number appeared on the list is hexadecimal number.
85 <a name="dc"><h3><img src="burst.gif" alt="[Repeatable]"> dc
86 [start [stop]]</h3></a>
88 Disassembled dump of code memory area. This command simply produces
89 disassambled list of memory area specified by the parameters. Default
90 value of <b>start</b> parameter is last address listed by previous
91 <b>dc</b> command. If <b>stop</b> parameter is not given 20 lines are
95 $ <font color="#118811">s51 remoansi.hex</font>
96 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
97 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
98 This is free software, and you are welcome to redistribute it
99 under certain conditions; type `show c' for details.
100 58659 bytes read from remoansi.hex
101 > <font color="#118811">dc</font>
102 000000 02 01 60 LJMP 0160
103 * 000003 02 00 3c LJMP 003c
109 * 00000b 02 3b e0 LJMP 3be0
115 * 000013 02 00 ac LJMP 00ac
126 <a name="dch"><h3><img src="burst.gif" alt="[Repeatable]"> dch
127 [start [stop]]</h3></a>
129 Hexadecimal dump of code memory area from address <b>start</b> to
130 address <b>stop</b>. Default value of start address is address of
131 following memory cell which was dumped by previous <b>dch</b>
132 command. If <b>stop</b> parameter is not given <b>dch</b> command
133 lists 10 lines 8 bytes per line.
136 $ <font color="#118811">s51 remo.hex</font>
137 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
138 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
139 This is free software, and you are welcome to redistribute it
140 under certain conditions; type `show c' for details.
141 58659 bytes read from remoansi.hex
142 > <font color="#118811">wc remo</font>
143 0013da 52 65 6d 6f Remo
144 > <font color="#118811">dch 0x13da</font>
145 0013da 52 65 6d 6f 20 00 56 65 Remo .Ve
146 0013e2 72 73 69 6f 6e 20 31 2e rsion 1.
147 0013ea 30 20 00 43 6f 70 79 72 0 .Copyr
148 0013f2 69 67 68 74 20 28 63 29 ight (c)
149 0013fa 20 00 31 39 39 34 2c 39 .1994,9
150 001402 35 20 00 54 61 6c 6b 65 5 .Talke
151 00140a 72 20 42 74 2e 00 53 75 r Bt..Su
152 001412 6e 64 61 79 2e 00 4d 6f nday..Mo
153 00141a 6e 64 61 79 2e 00 54 68 nday..Th
154 001422 75 65 73 64 61 79 2e 00 uesday..
157 First element in every lines is address of first byte dumped out in
158 the line. Next elements are hexadecimal values of bytes followed by
159 ASCII charactes of bytes dumped out in the line. If value of the
160 memory cell is not printable than a dot is dumped out.
163 <a name="di"><h3><img src="burst.gif" alt="[Repeatable]"> di
164 [start [stop]]</h3></a>
166 Hexadecimal dump of internal RAM area from address <b>start</b> to
167 address <b>stop</b>. Default value of start address is address of
168 following memory cell which was dumped by previous <b>di</b>
169 command. If <b>stop</b> parameter is not given <b>di</b> command
170 lists 10 lines 8 bytes per line.
173 $ <font color="#118811">s51 remoansi.hex</font>
174 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
175 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
176 This is free software, and you are welcome to redistribute it
177 under certain conditions; type `show c' for details.
178 58659 bytes read from remoansi.hex
179 > <font color="#118811">sopt stopit 1</font>
180 > <font color="#118811">g</font>
181 Simulation started, PC=0x000000
182 Stop at 000023: (5) Interrupt
184 > <font color="#118811">di</font>
185 000000 18 02 16 ba 00 02 00 0a ........
186 000008 00 00 00 00 00 00 00 00 ........
187 000010 00 00 00 00 00 00 00 00 ........
188 000018 4a 00 00 00 00 00 00 00 J.......
189 000020 bc 27 06 2d 02 ee 35 8f .'.-..5.
190 000028 31 e7 42 01 0e 01 0b 00 1.B.....
191 000030 ec 0b 7f 10 7f a9 7e 08 ......~.
192 000038 fe 03 09 00 00 00 af 08 ........
193 000040 af 08 00 00 00 00 00 00 ........
194 000048 00 00 00 00 00 00 00 00 ........
198 <a name="dx"><h3><img src="burst.gif" alt="[Repeatable]"> dx
199 [start [stop]]</h3></a>
201 Hexadecimal dump of external RAM area from address <b>start</b> to
202 address <b>stop</b>. Default value of start address is address of
203 following memory cell which was dumped by previous <b>dx</b>
204 command. If <b>stop</b> parameter is not given <b>dx</b> command
205 lists 10 lines 8 bytes per line.
208 $ <font color="#118811">s51 remoansi.hex</font>
209 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
210 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
211 This is free software, and you are welcome to redistribute it
212 under certain conditions; type `show c' for details.
213 58659 bytes read from remoansi.hex
214 > <font color="#118811">sopt stopit 1</font>
215 > <font color="#118811">g</font>
216 Simulation started, PC=0x000000
217 Stop at 000023: (5) Interrupt
219 > <font color="#118811">dx 0x100</font>
220 000100 00 00 00 00 00 00 00 00 ........
221 000108 00 00 00 00 00 00 00 00 ........
222 000110 00 00 00 00 00 00 00 00 ........
223 000118 00 00 00 00 00 00 00 00 ........
224 000120 00 00 00 00 00 00 00 00 ........
225 000128 00 00 00 00 00 00 00 44 .......D
226 000130 61 6e 69 00 00 00 02 02 ani.....
227 000138 07 00 00 ff 00 00 07 cb ........
228 000140 08 0c 32 00 07 cb 06 05 ..2.....
229 000148 02 00 24 00 00 00 00 00 ..$.....
233 <a name="dp"><h3>dp</h3></a>
235 Dump out ports. This command shows actual value of ports.
238 $ <font color="#118811">s51 remoansi.hex</font>
239 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
240 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
241 This is free software, and you are welcome to redistribute it
242 under certain conditions; type `show c' for details.
243 58659 bytes read from remoansi.hex
244 > <font color="#118811">sopt stopit 1</font>
245 > <font color="#118811">g</font>
247 * 000023 02 01 1c LJMP 011c
248 > <font color="#118811">dp</font>
249 P0 11111111 0xff 255 . P1 11111110 0xfe 254 .
250 Pin0 11111111 0xff 255 . Pin1 11111111 0xff 255 .
251 Port0 11111111 0xff 255 . Port1 11111110 0xfe 254 .
253 P2 11111111 0xff 255 . P3 11111111 0xff 255 .
254 Pin2 11111111 0xff 255 . Pin3 11111111 0xff 255 .
255 Port2 11111111 0xff 255 . Port3 11111111 0xff 255 .
258 First lines on the list (labeled with Px) are value of SFRs which are
259 internal latch registers. Second lines (labeled with Pinx) are outputs
260 of external devices connected to port pins of the
261 microcontroller. These values can be set by you using <a
262 href="#sp"><b>sp</b></a> command. Third lines (labeled with Portx)
263 show actual values can be measured on pins of the device. These values
264 are calculated with following pseudo formula:
266 <p><tt>Portx= Px AND Pinx</tt>
268 <p>All three values are displayed in binary, hexadecimal, decimal form
269 and then the ASCII character of the value is shown.
272 <a name="ds"><h3>ds [addr...]</h3></a>
274 Print out SFR. This command can be used to get value of all or some
275 SFRs. If you do not specify any parameter the <b>ds</b> command simply
276 dumps out full SFR area 16 bytes per line.
279 $ <font color="#118811">s51 remoansi.hex</font>
280 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
281 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
282 This is free software, and you are welcome to redistribute it
283 under certain conditions; type `show c' for details.
284 58659 bytes read from remoansi.hex
285 > <font color="#118811">sopt stopit 1</font>
286 > <font color="#118811">g</font>
288 * 000023 02 01 1c LJMP 011c
289 > <font color="#118811">ds</font>
290 000080 ff 2a ba 16 00 00 00 00 55 a1 d7 fe 50 fd 00 00 .*......U...P...
291 000090 fe 00 00 00 00 00 00 00 7e 00 00 00 00 00 00 00 ........~.......
292 0000a0 ff 00 00 00 00 00 00 00 97 00 00 00 00 00 00 00 ................
293 0000b0 ff 00 00 00 00 00 00 00 15 00 00 00 00 00 00 00 ................
294 0000c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
295 0000d0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
296 0000e0 0a 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
297 0000f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
298 > <font color="#118811">ds p1 0x87</font>
301 > <font color="#118811">ds p2 ip scon</font>
307 If you specify one or more parameter the <b>ds</b> command prints out
308 value of registers specified by parameters. Parameter can be an
309 address or a symbolic name of the register. Note that the simulator
310 implements a register at all address in the address space which is not
311 true in real microcontroller where reading of an unimplemented
312 register gets undefined value. Value of the registers printed out in
313 hexadecimal, decimal, and ASCII form.
315 <p>Note that different type of controllers can implement different
319 $ <font color="#118811">s51</font>
320 ucsim 0.2.12, 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 > <font color="#118811">ds rcap2l</font>
325 > <font color="#118811">q</font>
326 $ <font color="#118811">s51 -t 52</font>
327 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
328 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
329 This is free software, and you are welcome to redistribute it
330 under certain conditions; type `show c' for details.
331 > <font color="#118811">ds rcap2l</font>
336 <a name="db"><h3><img src="burst.gif" alt="[Repeatable]"> db
339 Dump bits. This command can be used to get value of bits. At least one
340 parameter must be given. Bit address can be specified in three
341 forms. First of all name of the bit can be used if it has any. Direct
342 bit address is accepted too and it can be specified by address of IRAM
343 or SFR which contains the bit and bit number within the byte separated
344 by a dot. If the requested bit is in an SFR the address of the
345 register can be specified by its name.
348 $ <font color="#118811">s51</font>
349 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
350 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
351 This is free software, and you are welcome to redistribute it
352 under certain conditions; type `show c' for details.
353 > <font color="#118811">db it1 0x20.3 0x43 p2.5</font>
360 Value of bits are printed out one per line. The list starts direct
361 address of the bit followed by bit name or address of the memory cell
362 or SFR which contains the displayed bit and bit number within the byte
363 separated by a dot. At last the value of the bit is shown. Displaying
364 a port bit you get value of SFR latch:
367 > <font color="#118811">sp 1 0x0f</font>
368 > <font color="#118811">ss p1 0x55</font>
370 > <font color="#118811">dp</font>
371 P0 11111111 0xff 255 . P1 01010101 0x55 85 U
372 Pin0 11111111 0xff 255 . Pin1 00001111 0x0f 15 .
373 Port0 11111111 0xff 255 . Port1 00000101 0x05 5 .
375 P2 11111111 0xff 255 . P3 11111111 0xff 255 .
376 Pin2 11111111 0xff 255 . Pin3 11111111 0xff 255 .
377 Port2 11111111 0xff 255 . Port3 11111111 0xff 255 .
378 > <font color="#118811">db p1.2 p1.3 p1.4 p1.5 p1.6</font>