e0483de03fc95e6f09ba5eb527ef798c6d375437
[fw/sdcc] / sim / ucsim / doc / cmd_general.html
1 <html>
2 <head>
3 <title>General commands of uCsim</title>
4 </head>
5
6 <body bgcolor="white">
7
8 <h2>General commands of uCsim</h2>
9
10
11 <p>Every command which changes content of ROM area such as <b><a
12 href="#dl">dl</a></b> or <b><a href="cmd_set#set_memory">set
13 memory</a></b> deletes result of code analyzer and causes to
14 re-analyze the code.
15
16
17 <a name="show"><h3>show</h3></a>
18
19 Show command can be used to display different kind of information. It
20 must be followed by a subcommand. Subcommands are:
21
22 <p>show <a href="#show_copying">copying</a>
23 <br>show <a href="#show_warranty">warranty</a>
24
25
26 <a name="show_copying"><h4>show copying</h4></a>
27
28 This command can be used to list licensing information. It is first 10
29 point of the version 2 of GNU Genral Public License. If you do not
30 accept GPL simply do not use the program.
31
32
33 <a name="show_warranty"><h4>show warranty</h4></a>
34
35 This command prints out last 2 point of the license ("NO WARRANTY"
36 message).
37
38
39 <a name="dl"><h3>download,dl</h3></a>
40
41 Download command. It is same as <a href="#l">load</a> above but it
42 reads information from command console which is standard input by
43 default. This command stops read records when it detects an "END"
44 record which is normaly the last record. This command has two
45 equivalent forms <b>download</b> and <b>dl</b>.
46
47 <pre>
48 $ <font color="#118811">s51 -V</font>
49 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
50 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
51 This is free software, and you are welcome to redistribute it
52 under certain conditions; type `show c' for details.
53 > <font color="#118811">do
54 :03000000020003F8
55 :1000030075812078207600D8FC900000AE83AF8203
56 :100013009000001200416005E4F0A380F690009F79
57 :1000230012004A9000A312004A9000A712006890A1
58 :1000330000AD12006875D0001200B50200B3EF6581
59 :10004300827003EE658322E493F8740193F97402DA
60 :1000530093FE740393F5828E83E869700122E4931F
61 :10006300F6A30880F4E493FC740193FD740293FEF9
62 :10007300740393FF740493F8740593F582888312D1
63 :100083000041700122E493A3A883A9828C838D820B
64 :10009300F0A3AC83AD828883898280E3212100B5FC
65 :1000A300212100B5000000B500B5000000B500B582
66 :0200B30080FECD
67 :1000B5007520117501AA850120750102850120228F
68 :00000001FF</font>
69 197 bytes loaded
70 > </pre>
71
72
73 <a name="q"><h3>quit</h3></a>
74
75 Quit. This command terminates actual console, it does not ask you to
76 confirm your intention. Simulator always reads commands from a file so
77 end of file condition finishes too. If command console is on standard
78 input/output, pressing the CTRL-D will quit just like the quit
79 command.
80
81 <p>Note that if <a href="invoke.html#Zoption">-Z option</a> was used at
82 invokation then the quit command does not terminate the simulator
83 program. In this case <a href="#kill">kill</a> command can be used to
84 terminate the simulator. See for more information about <a
85 href="mulcons.html">using multiple consoles</a>.
86
87 <pre>$ <font color="#118811">s51</font>
88 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
89 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
90 This is free software, and you are welcome to redistribute it
91 under certain conditions; type `show c' for details.
92 > <font color="#118811">q</font>
93 $ </pre>
94
95
96 <a name="kill"><h3>kill</h3></a>
97
98 This kommand terminates the simulator. It does not ask for
99 confirmation. It doesn't matter how many consoles are used and what
100 commands are running on them.
101
102
103 <a name="h"><h3>?,help [command]</h3></a>
104
105 Help command. It prints out short description of the commands.
106
107 <p>If a command name is given as parameter then uCsim prints out all
108 command that has the same name.
109
110 <p>If parameter is unique name of a command then long description of
111 the command is printed out.
112
113
114 <a name="reset"><h3>reset</h3></a>
115
116 Reset command. It resets the microcontroller. It has same effect as
117 active signal on the RST pin.
118
119 <pre>
120 $ <font color="#118811">s51 -V remoansi.hex</font>
121 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
122 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
123 This is free software, and you are welcome to redistribute it
124 under certain conditions; type `show c' for details.
125 58659 bytes read from remoansi.hex
126 > <font color="#118811">dr</font>
127 000000 00 00 00 00 00 00 00 00 ........
128 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
129 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
130    000000 02 01 60 LJMP  0160
131 > <font color="#118811">s 2</font>
132 000000 00 00 00 00 00 00 00 00 ........
133 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
134 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
135    000160 c2 90    CLR   P1.0
136 000000 00 00 00 00 00 00 00 00 ........
137 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
138 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
139    000162 c2 97    CLR   P1.7
140 > <font color="#118811">res</font>
141 > <font color="#118811">dr</font>
142 000000 00 00 00 00 00 00 00 00 ........
143 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
144 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
145    000000 02 01 60 LJMP  0160
146 > </pre>
147
148
149 <a name="where"><h3>where,Where memory_type data...</h3></a>
150
151 Searching for some data in memory. First parameter specifies
152 memory. Class name of the memory must be used, it can be checked using
153 <a href="cmd_general.html#conf">conf</a> command which lists size and
154 class name of all available memories.
155
156 <p>Other parameters can be mixed list of strings (characters between "
157 and ") and numbers. Strings can contain escape sequencies. Ucsim
158 merges all parameters together and will search for megred list of
159 values in specified memory.
160
161 <p><b>where</b> command do case unsensitive search while <b>Where</b>
162 command is for case sensitive search.
163
164 <p>Search is done in whole memory and all matches are dumped out.
165
166 <pre>
167 $ <font color="#118811">/s51</font>
168 ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
169 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
170 This is free software, and you are welcome to redistribute it
171 under certain conditions; type `show c' for details.
172 > <font color="#118811">set mem x 20 "Dani d ani D ani dani Dani"</font>
173 0x0014 44 61 6e 69 20 64 20 61 Dani d a
174 0x001c 6e 69 20 44 20 61 6e 69 ni D ani
175 0x0024 20 64 61 6e 69 20 44 61  dani Da
176 0x002c 6e 69                   ni
177 > <font color="#118811">where x "dani"</font>
178 0x0014 44 61 6e 69             Dani
179 0x0025 64 61 6e 69             dani
180 0x002a 44 61 6e 69             Dani
181 > <font color="#118811">Where x "d ani"</font>
182 0x0019 64 20 61 6e 69          d ani
183 > </pre>
184
185
186 <a name="conf"><h3>conf</h3></a>
187
188 This command prints out configuration of the simulator:
189
190 <pre>
191 > <font color="#118811">conf</font>
192 ucsim version 0.2.37
193 Type of microcontroller: 51 CMOS
194 Controller has 8 hardware element(s).
195   timer0[0]
196   timer1[1]
197   uart[0]
198   port[0]
199   port[1]
200   port[2]
201   port[3]
202   irq[0]
203 Memories:
204   ROM  size= 0x010000  65536 width=  8 class= "rom"
205   XRAM size= 0x010000  65536 width=  8 class= "xram"
206   IRAM size= 0x000100    256 width=  8 class= "iram"
207   SFR  size= 0x000100    256 width=  8 class= "sfr"
208
209 </pre>
210
211 First line contains version number of the program. Second line informs
212 about type of the simulated microcontroller. Third line prints out how
213 many hardware elements are simulated. Following lines contain
214 information about memories. Note that size of the simulated memory
215 segment can be bigger than size of addressable part of the memory as
216 you see above SFR type of the memory has bigger simulated than
217 addressable size.
218
219
220 <a name="state"><h3>state</h3></a>
221
222 State of the simulator and the simulated microcontroller:
223
224 <pre>
225 > <font color="#118811">state</font>
226 CPU state= OK PC= 0x004349 XTAL= 1.10592e+07
227 Total time since last reset= 0.614873 sec (6800004 clks)
228 Time in isr = 0.0144227 sec (159504 clks) 2.3%
229 Time in idle= 0 sec (0 clks)   0%
230 Max value of stack pointer= 0x000049, avg= 0x000026
231
232 </pre>
233
234 The "CPU state" in the first line is an internal information. PC is
235 value of the program counter. First line shows XTAL frequency too.
236
237 <p>Following lines contain information about simulated time. First,
238 full simulated time (elapsed from last reset) is printed out in
239 seconds and number of clock periods then same data is printed out
240 about time spent in interrupt service routines as well as in idle
241 mode. Last data in lines of ISR and IDLE time shows ratio of ISRs,
242 Idle times and main program.
243
244 <p>Last line infroms about maximum value of the stack pointer and a
245 "not very well" calculated average value of it.
246
247
248 <a name="file"><h3>file,load "FILE"</h3></a>
249
250 Loads file named FILE into the simulated code memory. File must
251 contain data in Intel HEX format.
252
253 <pre>
254 > <font color="#118811">file "../../remo.hex"</font>
255 55470 words read from ../../remo.hex
256
257 </pre>
258
259 Don't forget to enclose file name in quotes to make the parameter to
260 be a string.
261
262
263 <a name="info"><h3>info</h3></a>
264
265 This command prints out information about different things which must
266 be specified as paramater to the command. Following subcommands are
267 known:
268
269 <p>info <a href="#info_bp">breakpoints</a>
270 <br>info <a href="#info_reg">registers</a>
271 <br>info <a href="#info_hw">hardware</a>
272
273
274 <a name="info_bp"><h4>info breakpoints</h4></a>
275
276 This subcommand prints out information about breakpoints:
277
278 <pre>
279 > <font color="#118811">b 12</font>
280 Breakpoint 1 at 0x00000c: MOV   R7,A
281 > <font color="#118811">tb 43</font>
282 Breakpoint 2 at 0x00002b: MOV   R7,A
283 > <font color="#118811">bse ws f 0x80</font>
284 > <font color="#118811">i b</font>
285 Num Type       Disp Hit   Cnt   Address  What
286 1   fetch      keep 1     1     0x00000c MOV   R7,A
287 2   fetch      del  1     1     0x00002b MOV   R7,A
288 1   event      keep 1     1     0x000080 ws
289
290 </pre>
291
292 As you see above, the command can be shortened to "i b". The list of
293 breakpoints contains 7 columns:
294
295 <dl><dt><b>Num</b> <dd>Number of the breakpoint. Normal and event
296 breakpoints are numbered separately.
297
298 <dt><b>Type</b> <dd>This column shows type of the breakpoint. It can
299 be <i>fetch</i> for normal breakpoints or <i>event</i> for event
300 breakpoints. First the normal breakpoints are listed and then the
301 event breakpoints.
302
303 <dt><b>Disp</b> <dd>This shows if the breakpoint is temporary
304 (<i>del</i>) or not (<i>keep</i>).
305
306 <dt><b>Hit</b> <dd>How many times the breakpoint must be hit before it
307 really stops the program.
308
309 <dt><b>Cnt</b> <dd>Counter of breakpint hits. This counter decrements
310 and the breakpoint is activated if it reaches zero.
311
312 <dt><b>Address</b> <dd>Address where the breakpoint is set.
313
314 <dt><b>What</b> <dd>For normal breakpoints this field contains
315 disassembled instruction where the breakpoint is set. For event
316 breakpoints it contains type of event.
317
318 </dl>
319
320 <a name="info_reg"><h4>info registers</h4></a>
321
322 This subcommand prints out full register set of the CPU. Output of
323 this command depends of type of CPU.
324
325 <h5>Registers of MCS51 family</h5>
326
327 <pre>
328 $ <font color="#118811">s51 remoansi.hex</font> 
329 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
330 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
331 This is free software, and you are welcome to redistribute it
332 under certain conditions; type `show c' for details.
333 58659 bytes read from remoansi.hex
334 > <font color="#118811">sopt stopit 1</font>
335 > <font color="#118811">g</font>
336 5
337  * 000023 02 01 1c LJMP  011c
338 > <font color="#118811">i r</font>
339 000000 18 02 16 ba 00 02 00 0a ........
340 000018 4a J  ACC= 0x0a  10 .  B= 0x00   DPTR= 0x16ba @DPTR= 0x00   0 .
341 000002 16 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
342  * 000023 02 01 1c LJMP  011c
343 > </pre>
344
345 In first line the actual register bank is dumped out. Register banks
346 reside in internal RAM, address at the begining of the line shows
347 start address of actual register bank selected by RS0 and RS1 bits of
348 PSW register.
349
350 <p>Next two lines begin with value of indirectly addressed internal
351 RAM cells. Second line shows IRAM cell pointed by R0 while third line
352 shows IRAM addressed by R1.
353
354 <p>Second line displays some important registers. First one is the
355 accumulator. Its value dumped out in hexadecimal, decimal form and
356 then the ASCII character of its value. It is followed by value of the
357 B register which is dumped out in hexadecimal form only. Next is DPTR
358 register in hexadecimal and then external RAM cell which is addressed
359 by DPTR. This is dumped out in hexadecimal, decimal and ASCII too.
360
361 <p>In third line you find program status word in hexadecimal and then
362 some flag bits of PSW register. Last line is disassembled instruction
363 at PC.
364
365 <h5>Registers of AVR family</h5>
366
367 <pre>
368 $ <font color="#118811">savr test_arith.hex</font>
369 ucsim 0.2.37, Copyright (C) 1997 Daniel Drotos, Talker Bt.
370 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
371 This is free software, and you are welcome to redistribute it
372 under certain conditions; type `show c' for details.
373 > 83 words read from test_arith.hex
374 83 words read from test_arith.hex
375 > <font color="#118811">run</font>
376
377 Stop at 0x000047: (105) User stopped
378 F 0x000047
379 > <font color="#118811">i r</font>
380 000000 00 2c 21 23 20 35 19 14 03 00 00 00 00 00 00 00 .,!# 5..........
381 000010 00 01 1e 89 01 00 10 e2 14 00 01 10 00 00 00 00 ................
382 ITHSVNZC  SREG= 0x03   3 .
383 00000011  SP  = 0x000000
384 X= 0x1001 [X]= 0x00   0 .  Y= 0x0000 [Y]= 0x00   0 .  Z= 0x0000 [Z]= 0x00   0 .
385  * 000047 940c 0047 jmp   0x000047
386
387 </pre>
388
389 First two lines show first 32 bytes of internal RAM which is the
390 register set of AVR controllers.
391
392 <p>At the beginning of next two lines bits of status register are
393 printed. These lines present hexadecimal, decimal and ASCII values of
394 the status register too, and value of the stack pointer.
395
396 <p>Following line shows indirect addressing registers X, Y, and Z as
397 well as pointed memory values.
398
399 <p>Last line is disassembled instruction ap PC.
400
401 <a name="info_hw"><h4>info hardware|hw identifier</h4></a>
402
403 This subcommand prints out information about a unit of the
404 controller. <b>identifier</b> specifies hardware element. One form of
405 it is a name. Names of hardware elements can be checked by <a
406 href="#conf">conf</a> command. This form is accepted only when name is
407 unique. If more than one element exists with the same name then name
408 must be followed by id number is squere brackets in same form as it is
409 listed by <a href="#conf">conf</a> command.
410
411 <p>Ouput format of this command depends on CPU family and type of the
412 CPU too because requested unit can be different in different type of
413 controller even in the same CPU family.
414
415 <pre>
416 $ <font color="#118811">s51 -t 51</font>
417 ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
418 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
419 This is free software, and you are welcome to redistribute it
420 under certain conditions; type `show c' for details.
421 > <font color="#118811">conf</font>
422 ucsim version 0.2.38-pre2
423 Type of microcontroller: 51 CMOS
424 Controller has 8 hardware element(s).
425   timer0[0]
426   timer1[1]
427   uart[0]
428   port[0]
429   port[1]
430   port[2]
431   port[3]
432   irq[0]
433 Memories:
434   ROM  size= 0x010000  65536 width=  8 class= "rom"
435   XRAM size= 0x010000  65536 width=  8 class= "xram"
436   IRAM size= 0x000100    256 width=  8 class= "iram"
437   SFR  size= 0x000100    256 width=  8 class= "sfr"
438 > <font color="#118811">i h port[2]</font>
439 port[2]
440 P2    11111111 0xff 255 . (Value in SFR register)
441 Pin2  11111111 0xff 255 . (Output of outside circuits)
442 Port2 11111111 0xff 255 . (Value on the port pins)
443 > <font color="#118811">i h t[0]</font>
444 timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0
445 > <font color="#118811">i h u</font>
446 uart[0] Shift, fixed clock MultiProc=none irq=dis prio=0
447 Receiver OFF RB8=0 irq=0
448 Transmitter TB8=0 irq=0
449
450 </pre>
451
452 Timer #2 differs a little bit from other timers of MCS51:
453
454 <pre>
455 $ <font color="#118811">s51 -t 52</font>
456 ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
457 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
458 This is free software, and you are welcome to redistribute it
459 under certain conditions; type `show c' for details.
460 > <font color="#118811">i h timer0</font>
461 timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0
462 > <font color="#118811">i h t[2]</font>
463 timer2[2] 0x0000 reload 0x0000 timer OFF irq=0 dis prio=0
464
465 </pre>
466
467
468 <a name="timer"><h3>timer a|d|g|r|s|v id [value]</h3></a>
469
470 Handling of timers. First parameter of timer command determines the
471 operation which can be
472
473 <dl><dt><b>add (or simply a)</b> <dd>to create a new timer. New timers
474 are turned ON by default and initialized to value 0.
475
476 <dt><b>del (or simply d)</b> <dd>to remove a timer if you don't need
477 it any more.
478
479 <dt><b>get (or simply g)</b> <dd>to get value of timers. See comment
480 below.
481
482 <dt><b>run (or simply r)</b> <dd>to turn a timer ON.
483
484 <dt><b>stop (or simply s)</b> <dd>to turn a timer OFF. It still exist
485 but doesn't count xtal periods.
486
487 <dt><b>value (or simply v)</b> <dd>to set value of the timer (number
488 of xtal periods). `param' is the new value.
489
490 </dl>
491
492 <b>id</b> can be a number or a string. Timers are numbered from 1. You
493 can use any number greater than 0 to identify a timer. Or you can use
494 a simbolic name, in this case simulator uses the first unused number
495 to allocate a new timer:
496
497 <pre>
498 > <font color="#118811">tim a 3</font>
499 > <font color="#118811">tim g 0</font>
500 timer #0("time") ON: 0.463255 sec (5123232 clks)
501 timer #0("isr") ON: 0.0051888 sec (57384 clks)
502 timer #3("unnamed") ON: 0 sec (0 clks)
503 > <font color="#118811">tim a "a"</font>
504 > <font color="#118811">tim g 0</font>
505 timer #0("time") ON: 0.463255 sec (5123232 clks)
506 timer #0("isr") ON: 0.0051888 sec (57384 clks)
507 timer #1("a") ON: 0 sec (0 clks)
508 timer #3("unnamed") ON: 0 sec (0 clks)
509
510 </pre>
511
512 If you use 0 as timer id in "get" operation, simulator prints out
513 value of all timers including predefined ones.
514
515
516 <a name="set"><h3>set</h3></a>
517
518 This command can be used to set various kind of things. It requires a
519 subcommand to specify what is going to be set. Known subcommands are:
520
521 <p>set <a href="#set_memory">memory</a>
522 <br>set <a href="#set_bit">bit</a>
523 <br>set <a href="#set_port">port</a>
524 <br>set <a href="#set_option">option</a>
525
526
527 <a name="set_memory"><h4>set memory memory_type address
528 data...</h4></a>
529
530 This command can be used to modify content of any simulated
531 memory. First parameter must be a class name to specify type of
532 memory. Class names can de checked by <a
533 href="cmd_general.html#conf">conf</a> command.
534
535 <p>Second parameter specifies start address of the modification.
536
537 <p>Remaining parameters will be written into the memory starting at
538 address specified by second parameter. Data list can include numbers
539 as well as strings. See <a href="syntax.html">syntax</a> for more
540 details.
541 q
542 <p>Modified memory locations are dumped out.
543
544 <pre>
545 $ <font color="#118811">s51</font>
546 ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
547 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
548 This is free software, and you are welcome to redistribute it
549 under certain conditions; type `show c' for details.
550 > <font color="#118811">set mem x 1 "ab\tcd\0ef\012ghq" 2 "ABC"</font>
551 0x0001 61 62 09 63 64 00 65 66 ab.cd.ef
552 0x0009 0a 67 68 71 02 41 42 43 .ghq.ABC
553 > <font color="#118811">set mem sfr pcon 0x34</font>
554 0x87 34                      4
555 > </pre>
556
557
558 <a name="set_bit"><h4>set bit address 0|1</h4></a>
559
560 Set one bit to 0 or 1. First parameter specifies the bit. It can be
561 the address of the bit (number or syqmbolic name) or it can be
562 specified in <i>address<b>.</b>bitnumber</i> format where
563 <i>address</i> addresses SFR area and <i>bitnumber</i> is number of
564 bit in specified SFR location. Using this syntax any SFR (and 8051's
565 internal RAM) location can be modified it need not be really bit
566 addressable.
567
568 <p>Second parameter interpreted as 1 if it is not zero.
569
570 <p>Modified memory location is dumped out.
571
572 <pre>
573 $ <font color="#118811">s51 </font>
574 ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
575 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
576 This is free software, and you are welcome to redistribute it
577 under certain conditions; type `show c' for details.
578 > <font color="#118811">set bit tf1 1</font>
579 0x88 80 .
580 > <font color="#118811">set bit 130 0</font>
581 0x80 fb .
582 > <font color="#118811">set bit pcon.2 1</font>
583 0x87 04 .
584 > <font color="#118811">set bit 10.7 1</font>
585 0x0a 80 .
586
587 </pre>
588
589
590 <a name="set_port"><h4>set port hardware_id data</h4></a>
591
592 This command can be used to set value of external circuits which
593 connected to ports of simulated controller. First parameter specifies
594 port number. It can be an array which specifies a hardware element or
595 simply a number.
596
597 <pre>
598 > <font color="#118811">set port 0 12</font>
599 > <font color="#118811">i h po[0]</font>
600 port[0]
601 P0    11111111 0xff 255 . (Value in SFR register)
602 Pin0  00001100 0x0c  12 . (Output of outside circuits)
603 Port0 00001100 0x0c  12 . (Value on the port pins)
604 > <font color="#118811">set port port[0] 23</font>
605 > <font color="#118811">i h po[0]</font>
606 port[0]
607 P0    11111111 0xff 255 . (Value in SFR register)
608 Pin0  00010111 0x17  23 . (Output of outside circuits)
609 Port0 00010111 0x17  23 . (Value on the port pins)
610 > </pre>
611
612
613 <a name="set_option"><h4>set option name value</h4></a>
614
615 <p>Set option value. Options described at (<a
616 href="#get_option"><b>get option</b></a>) command can be set using
617 this command. First parameter must be an option name and second the
618 new value. Interpretation of the value depends on type of the
619 option. Value for a boolean type of option interpreted as follows: if
620 first character of the value is one of <tt>1</tt>, <tt>t</tt>,
621 <tt>T</tt>, <tt>y</tt>, <tt>Y</tt> then value will be TRUE otherwise
622 it will be FALSE.
623
624 <pre>
625 $ <font color="#118811">s51 -V</font>
626 ucsim 0.2.38, Copyright (C) 1997 Daniel Drotos, Talker Bt.
627 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
628 This is free software, and you are welcome to redistribute it
629 under certain conditions; type `show c' for details.
630 > <font color="#118811">get opt</font>
631 verbose TRUE Verbose flag.
632 stopit FALSE Stop if interrupt accepted.
633 debug FALSE Debug messages appears on this console.
634 > <font color="#118811">set opt debug t</font>
635 > <font color="#118811">get opt</font>
636 verbose TRUE Verbose flag.
637 stopit FALSE Stop if interrupt accepted.
638 debug TRUE Debug messages appears on this console.
639 > </pre>
640
641
642 <a name="get"><h3>get</h3></a>
643
644 This command can be used to get value of various kind of things. It
645 requires a subcommand to specify what is going to be set. Known
646 subcommands are:
647
648 <p>get <a href="#get_sfr">sfr</a>
649 <br>get <a href="#get_option">option</a>
650
651
652 <a name="get_sfr"><h4>get sfr address...</h4></a>
653
654 This command can be used to check values of SFR location(s) if SFR
655 exists in simulated memory. Note that <a
656 href="cmd_dump.html#dump_memory">dump memory</a> or <a
657 href="cmd_dump.html#ds">ds</a> can be used as well.
658
659 <p>Parameters are interpreted as SFR names or addresses and values of
660 addressed locations are dumped out.
661
662 <pre>
663 $ <font color="#118811">s51 </font>
664 ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
665 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
666 This is free software, and you are welcome to redistribute it
667 under certain conditions; type `show c' for details.
668 > <font color="#118811">get sfr pcon p1 0 0x80 kahd scon</font>
669 0x87 00 .
670 0x90 ff .
671 0x00 00 .
672 0x80 ff .
673 Warning: Invalid address kahd
674 0x98 00 .
675 > </pre>
676
677
678 <a name="get_option"><h4>get option name</h4></a>
679
680 Get actual value of option(s). Some options can be set by <a
681 href="#set_option"><b>set option</b></a> to modify behavior of the
682 simulator. Using <b>get option</b> you can get actual value of these
683 options. If you use this command without parameter you get list of all
684 options known by the program. In this way you can figure out which
685 options can be used.
686
687 <pre>
688 $ <font color="#118811">s51 -V</font>
689 ucsim 0.2.38, Copyright (C) 1997 Daniel Drotos, Talker Bt.
690 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
691 This is free software, and you are welcome to redistribute it
692 under certain conditions; type `show c' for details.
693 > <font color="#118811">get opt</font>
694 verbose TRUE Verbose flag.
695 stopit FALSE Stop if interrupt accepted.
696 debug FALSE Debug flag.
697 > <font color="#118811">get opt stopit</font>
698 stopit FALSE Stop if interrupt accepted.
699 > </pre>
700
701 This version of the simulator knows about three options. First element
702 of the list is name of the option (<b>verbose</b>, <b>debug</b> and
703 <b>stopit</b>). This name can be used to identify the option in
704 <b>gopt</b> and <a href="#set_option"><b>set option</b></a>
705 command. Second element of the list is the value of the option. In
706 this case type of both options is boolean, their value can be TRUE or
707 FALSE. Third element is a short description of the option.
708
709 <dl><dt><b>verbose</b> <dd>?
710
711 <dt><b>debug</b> <dd>Debug flag can be set by <b>-V</b> option of the
712 program to TRUE otherwise its default value is FALSE. If it is TRUE,
713 the simulator prints out short messages about important events.
714
715 <dt><b>stopit</b> <dd>Setting this option to TRUE (default value is
716 FALSE) forces execution to stop every time when CPU accepts an
717 interrupt. You do not have to use breakpoints to inspect interrupts.
718
719 </dl>
720
721
722 <a name="fill"><h3>fill memory_type start end data</h3></a>
723
724 Fill memory region with specified data. First parameter specifies
725 memory. Class name of the memory must be used, it can be checked using
726 <a href="cmd_general.html#conf">conf</a> command which lists size and
727 class name of all available memories.
728
729 <p><b>start</b> and <b>end</b> parameters specify first and last
730 address of the memory region to be filled.
731
732 <p><b>data</b> parameter specifies the data which is used to fill the
733 memory region.
734
735 <pre>
736 $ <font color="#118811">s51</font> 
737 ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
738 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
739 This is free software, and you are welcome to redistribute it
740 under certain conditions; type `show c' for details.
741 > <font color="#118811">fill x 12 0x12 0x56</font>
742 > <font color="#118811">dump x 0 0x20</font>
743 0x0000 00 00 00 00 00 00 00 00 ........
744 0x0008 00 00 00 00 56 56 56 56 ....VVVV
745 0x0010 56 56 56 00 00 00 00 00 VVV.....
746 0x0018 00 00 00 00 00 00 00 00 ........
747 0x0020 00                      .
748 > </pre>
749
750
751 <hr>
752
753 </body>
754 </html>