?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download

  1. <html>
  2.   <head>
  3.     <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
  4.     <title>General commands of &mu;Csim</title>
  5.   </head>
  6.   <body style="background-color: white;">
  7.     <h2>General commands of <i>&mu;Csim</i></h2>
  8.     <h3><a name="conf">conf</a></h3>
  9.     Conf command can be used to display different kind of information about <i>&mu;Csim</i>.
  10.     It can be followed by a subcommand:
  11.     <p><a href="#conf_">conf</a> <br>
  12.       conf <a href="#conf_objects">objects</a> </p>
  13.     <blockquote>
  14.       <h4><a name="conf_">conf</a></h4>
  15.       This command (without a subcommand) prints out configuration of the
  16.       simulator:
  17.       <pre>0&gt; <font color="#118811">conf</font>
  18. ucsim version 0.5.0-pre3
  19. Type of microcontroller: 51 CMOS
  20. Controller has 9 hardware element(s).
  21.   timer0[0]
  22.   timer1[1]
  23.   uart[0]
  24.   port[0]
  25.   port[1]
  26.   port[2]
  27.   port[3]
  28.   irq[0]
  29.   _51_dummy[0]
  30. 0&gt;
  31. </pre> First line contains version number of the program. Second line informs
  32.       about type of the simulated microcontroller. Third line prints out how
  33.       many hardware elements are simulated.
  34.       <h4><a name="conf_objects">conf <i>objects</i></a></h4>
  35.       This command is for development only. </blockquote>
  36.     <hr>
  37.     <h3><a name="h">?,help <i>[command]</i></a></h3>
  38.     Help command. It prints out short description of the commands.
  39.     <p>If a command name is given as parameter then <i>&mu;Csim</i> prints out all
  40.       command that has similar names: </p>
  41.     <pre>0&gt; <font color="#118811">? s</font>
  42. show subcommand    Generic command for showing things about the uCsim
  43. set subcommand     Set, see `set' command for more help
  44. stop               Stop
  45. step               Step
  46. state              State of microcontroller
  47. statistic [mem [startaddr [endaddr]]]
  48.                   Statistic of memory accesses
  49. 0&gt; <font color="#118811">? s o</font>
  50. show option [name] Show internal data of options
  51. set option name|nr value
  52.                   Set value of an option
  53. 0&gt;
  54. </pre> Some commands have more than one name which can produce interesting
  55.    result:
  56.    <pre>0&gt; <font color="#118811">? t r</font>
  57. timer delete id    Delete a timer
  58. timer start id     Start a timer
  59. 0&gt;
  60. </pre> It looks that names of listed subcommands start with no "r" but take a
  61.    closer look on that commands:
  62.    <pre>0&gt; <font color="#118811">? t d</font>
  63. timer delete id    Delete a timer
  64. Names of command: delete remove
  65. long help of timer delete
  66. 0&gt; <font color="#118811">? t start</font>
  67. timer start id     Start a timer
  68. Names of command: run start
  69. long help of timer run
  70. 0&gt; </pre>
  71.    <p>If parameter is unique name of a command then long description of the
  72.      command is printed out. </p>
  73.    <hr>
  74.    <h3><a name="q">quit</a></h3>
  75.    Quit. This command terminates actual console, it does not ask you to confirm
  76.    your intention. Simulator always reads commands from a file so end of file
  77.    condition finishes too. If command console is on standard input/output,
  78.    pressing the CTRL-D will quit just like the quit command.
  79.    <p>Note that if <a href="invoke.html#Zoption">-Z option</a> was used at
  80.      invocation then the quit command does not terminate the simulator program.
  81.      In this case <a href="#kill">kill</a> command can be used to terminate
  82.      the simulator. See for more information about <a href="mulcons.html">using
  83.        multiple consoles</a>. </p>
  84.    <pre>$ <font color="#118811">s51</font>
  85. ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  86. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  87. This is free software, and you are welcome to redistribute it
  88. under certain conditions; type `show c' for details.
  89. &gt; <font color="#118811">q</font>
  90. $ </pre>
  91.    <hr>
  92.    <h3><a name="kill">kill</a></h3>
  93.    This command terminates the simulator. It does not ask for confirmation. It
  94.    doesn't matter how many consoles are used and what commands are running on
  95.     them.
  96.     <hr>
  97.     <h3><a name="exec">exec <i>file</i></a></h3>
  98.     Reads commands from "file" and executes them. This command opens a new
  99.     console (which will use same in/out file as the actual one) to execute the
  100.     file. This means the "quit" command in the file will not exit the simulator:
  101.     <pre>drdani@emma:~$ <font color="#118811">cat /tmp/x</font>
  102. get opt
  103. quit
  104. conf
  105. drdani@emma:~$ <font color="#118811">s51</font>
  106. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  107. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  108. This is free software, and you are welcome to redistribute it
  109. under certain conditions; type `show c' for details.
  110. 0&gt; <font color="#118811">exec "/tmp/x"</font>
  111. 1&gt; get opt
  112.  0. config_file(by application) is hidden!
  113.  1. console_on(by application) is hidden!
  114.  2. cpu_type(by application) is hidden!
  115.  3. debug(by console1): FALSE - Debug messages to console1
  116.  4. debug(by console0): FALSE - Debug messages to console0
  117.  5. debug(by application): FALSE - Print debug messages (-V)
  118.  6. irq_stop(by mcs51_controller): FALSE - Stop when IRQ accepted
  119.  7. null_prompt(by application): FALSE - Use \0 as prompt (-P)
  120.  8. prompt(by console1): "" - Prompt string of console1
  121.  9. prompt(by console0): "" - Prompt string of console0
  122. 10. prompt(by application): (null) - String of prompt (-p)
  123. 11. serial_in_file(by application) is hidden!
  124. 12. serial_out_file(by application) is hidden!
  125. 13. xtal(by application): 11059200.000 - Frequency of XTAL in Hz
  126. 1&gt; quit
  127. 0&gt;
  128. </pre>
  129.     <hr>
  130.     <h3><a name="expression">expression [/format] <i>expr</i></a></h3>
  131.     Executes "expr" as an expression. For more about expressions, see <a href="syntax.html">command
  132.       syntax</a>.
  133.     <pre>0&gt; <font color="#118811">expr 1 + 2</font>
  134. 3
  135. 0&gt; <font color="#118811">expr xram[256*dph+dpl]= &amp;sp</font>
  136. 129
  137. 0&gt;
  138. </pre>
  139.     <hr>
  140.     <h3><a name="show">show</a></h3>
  141.     Show command can be used to display different kind of information. It must
  142.     be followed by a subcommand. Subcommands are:
  143.     <p>show <a href="#show_copying">copying</a> <br>
  144.       show <a href="#show_warranty">warranty</a> <br>
  145.       show <a href="#show_option">option</a> <br>
  146.       show <a href="#show_error">error</a> </p>
  147.     <blockquote>
  148.       <h4><a name="show_copying">show copying</a></h4>
  149.       This command can be used to list licensing information. It is first 10
  150.       point of the version 2 of GNU General Public License. If you do not accept
  151.       GPL simply do not use the program.
  152.       <hr>
  153.       <h4><a name="show_warranty">show warranty</a></h4>
  154.       This command prints out last 2 point of the license ("NO WARRANTY"
  155.       message).
  156.       <hr>
  157.       <h4><a name="show_option">show option</a></h4>
  158.       This command is for development only.
  159.       <hr>
  160.       <h4><a name="show_error">show error</a></h4>
  161.       Errors or warnings are events which can happen in the simulated system
  162.       during simulation. Report of that events can be turned on or off using <a
  163.         href="#set_error"><b>set error</b></a> command. Errors are organized in
  164.       parent-child relationship. Childs are listed under the parent:
  165.       <pre>0&gt; <font color="#118811">sh er</font>
  166. Error: non-classified [on/ON]
  167.   Error: memory [on/ON]
  168.     Error: invalid_address [unset/ON]
  169.     Error: non_decoded [unset/ON]
  170.   Error: stack [off/OFF]
  171.     Error: stack_tracker [unset/OFF]
  172.       Error: stack_tracker_wrong_handle [unset/OFF]
  173.       Error: operation_on_empty_stack [unset/OFF]
  174.       Warning: stack_operation_unmatched_to_top_of_stack [unset/OFF]
  175.       Warning: stack_looks_corrupted [unset/OFF]
  176. 0&gt; </pre>
  177.       First element is the type (Error or Warning). Error stops the simulation.
  178.       Warning is just reported and simulation goes on. Next element is the name
  179.       of the error. Last element shows actual value and state. Value can be:
  180.       <dl>
  181.         <dt><b>on</b></dt>
  182.         <dd>state is ON </dd>
  183.         <dt><b>off</b></dt>
  184.         <dd>state is OFF </dd>
  185.         <dt><b>unset</b></dt>
  186.         <dd>state is inherited from the parent. </dd>
  187.       </dl>
  188.       If state is <b>ON</b> and the event happens, it is reported. If state is
  189.       <b>OFF</b> then the event is silently ignored. </blockquote>
  190.     <hr>
  191.     <h3><a name="get">get</a></h3>
  192.     This command can be used to get value of various kind of things. It requires
  193.     a subcommand to specify what is going to be set. Known subcommands are:
  194.     <p>get <a href="#get_sfr">sfr</a> <br>
  195.       get <a href="#get_option">option</a> <br>
  196.       get <a href="#get_error">error</a> </p>
  197.     <blockquote>
  198.       <h4><a name="get_sfr">get sfr <i>address...</i></a></h4>
  199.       This command can be used to check values of SFR location(s) if SFR exists
  200.       in simulated memory. Note that <a href="cmd_dump.html#dump_memory">dump
  201.         memory</a> or <a href="cmd_dump.html#ds">ds</a> can be used as well.
  202.       <p>Parameters are interpreted as SFR names or addresses and values of
  203.         addressed locations are dumped out. </p>
  204.       <pre>$ <font color="#118811">s51 </font>
  205. ucsim 0.5.0-pre3, 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. 0&gt; <font color="#118811">get sfr pcon p1 0 0x80 kahd scon 256</font>
  210. 0x87 00 .
  211. 0x90 ff .
  212. Warning: Invalid address 0
  213. 0x80 ff .
  214. Warning: Invalid address kahd
  215. 0x98 00 .
  216. Warning: Invalid address 256
  217. 0&gt; </pre>
  218.       <hr>
  219.       <h4><a name="get_option">get option <i>[name]</i></a></h4>
  220.       Get actual value of option(s). Some options can be set by <a href="#set_option"><b>set
  221.           option</b></a> to modify behaviour of the simulator. Using <b>get
  222.         option</b> you can get actual value of these options. If you use this
  223.       command without parameter you get list of all options known by the
  224.       program. In this way you can figure out which options can be used.
  225.       <pre>$ <font color="#118811">s51 -V</font>
  226. ucsim 0.5.0, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  227. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  228. This is free software, and you are welcome to redistribute it
  229. under certain conditions; type `show c' for details.
  230. 0&gt; <font color="#118811">get opt</font>
  231.  3. debug(by console0): FALSE - Debug messages to console0
  232.  4. debug(by application): FALSE - Print debug messages (-V)
  233.  5. irq_stop(by mcs51_controller): FALSE - Stop when IRQ accepted
  234.  6. null_prompt(by application): FALSE - Use \0 as prompt (-P)
  235.  7. prompt(by console0): "" - Prompt string of console0
  236.  8. prompt(by application): (null) - String of prompt (-p)
  237. 11. xtal(by application): 11059200.000 - Frequency of XTAL in Hz
  238. 0&gt;
  239. </pre> First element of the list is the number of the option. It is followed by
  240.       name of the option (<b>debug</b>, <b>irq_stop</b>, etc.). Number or the
  241.       name can be used to identify the option in <b>get option</b> and <a href="#set_option"><b>set
  242.           option</b></a> command. Next element shows which part of the simulator
  243.       created the option.
  244.       <p>Next element of the list is the value of the option. It can be an
  245.         integer or a floating point number, a string or a boolean value. </p>
  246.       <p>Last part describes the option. </p>
  247.       <p>Some options can have same name. An example is the <b>debug</b>
  248.         option. One is created by the application to store value given by -V
  249.         (see <a href="invoke.html">invocation</a>). This will be used as
  250.         default value when a new instance of a console is created: </p>
  251.       <pre>$ <font color="#118811">cat /tmp/x</font>
  252. get opt debug
  253. $ <font color="#118811">s51</font>
  254. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  255. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  256. This is free software, and you are welcome to redistribute it
  257. under certain conditions; type `show c' for details.
  258. 0&gt; <font color="#118811">get opt debug</font>
  259.  3. debug(by console0): FALSE - Debug messages to console0
  260.  4. debug(by application): FALSE - Print debug messages (-V)
  261. 0&gt; <font color="#118811">set opt 4 1</font>
  262. 0&gt; <font color="#118811">get opt debug</font>
  263.  3. debug(by console0): FALSE - Debug messages to console0
  264.  4. debug(by application): TRUE - Print debug messages (-V)
  265. 0&gt; <font color="#118811">exec "/tmp/x"</font>
  266. 1&gt; get opt debug
  267.  3. debug(by console1): TRUE - Debug messages to console1
  268.  4. debug(by console0): FALSE - Debug messages to console0
  269.  5. debug(by application): TRUE - Print debug messages (-V)
  270. 1&gt;
  271. 0&gt;
  272. </pre>
  273.       <hr>
  274.       <h4><a name="get_error">get error</a></h4>
  275.       Same as <a href="#show_error">show error</a>. </blockquote>
  276.     <hr>
  277.     <h3><a name="set">set</a></h3>
  278.     This command can be used to set various kind of things. It requires a
  279.     subcommand to specify what is going to be set. Known subcommands are:
  280.     <p>set <a href="#set_option">option</a> <br>
  281.       set <a href="#set_error">error</a> <br>
  282.       set <a href="#set_memory">memory</a> <br>
  283.       set <a href="#set_bit">bit</a> <br>
  284.       set <a href="#set_hardware">hardware</a> </p>
  285.     <blockquote>
  286.       <h4><a name="set_option">set option <i>name|nr value</i></a></h4>
  287.       <p>Set option value. Options described at (<a href="#get_option"><b>get
  288.             option</b></a>) command can be set using this command. First
  289.         parameter must be an option name or number and second the new value.
  290.         Interpretation of the value depends on type of the option. Value for a
  291.         boolean type of option interpreted as follows: if first character of the
  292.         value is one of <tt>1</tt>, <tt>t</tt>, <tt>T</tt>, <tt>y</tt>, <tt>Y</tt>
  293.         then value will be TRUE otherwise it will be FALSE. </p>
  294.       <pre>$ <font color="#118811">s51 -V</font>
  295. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  296. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  297. This is free software, and you are welcome to redistribute it
  298. under certain conditions; type `show c' for details.
  299. &gt; <font color="#118811">get opt</font>
  300.  0. config_file(by application) is hidden!
  301.  1. console_on(by application) is hidden!
  302.  2. cpu_type(by application) is hidden!
  303.  3. debug(by console0): TRUE - Debug messages to console0
  304.  4. debug(by application): TRUE - Print debug messages (-V)
  305.  5. irq_stop(by mcs51_controller): FALSE - Stop when IRQ accepted
  306.  6. null_prompt(by application): FALSE - Use \0 as prompt (-P)
  307.  7. prompt(by console0): "" - Prompt string of console0
  308.  8. prompt(by application): (null) - String of prompt (-p)
  309.  9. serial_in_file(by application) is hidden!
  310. 10. serial_out_file(by application) is hidden!
  311. 11. xtal(by application): 11059200.000 - Frequency of XTAL in Hz
  312. &gt; <font color="#118811">set opt debug f</font>
  313. Ambiguous option name, use number instead
  314. &gt; <font color="#118811">set opt 3 f</font>
  315. &gt; <font color="#118811">get opt debug</font>
  316.  3. debug(by console0): FALSE - Debug messages to console0
  317.  4. debug(by application): TRUE - Print debug messages (-V)
  318. &gt; </pre>
  319.       <hr>
  320.       <h4><a name="set_error">set error <i>error_name on|off|unset</i></a></h4>
  321.       This command can be used to set if an error event should be reported or
  322.       not. Actual settings can be retrieved by <a href="show_error">show error</a>
  323.       command.<br>
  324.       <hr>
  325.       <h4><a name="set_console">set console <i>interactive
  326.             [on|off]|noninteractive|raw|edited</i><br>
  327.         </a></h4>
  328.       <hr>
  329.       <h4><a name="set_memory">set memory <i>memory_type address data...</i></a></h4>
  330.       This command can be used to modify content of any simulated memory. First
  331.       parameter must be a class name to specify type of memory. Class names can
  332.       de checked by <a href="cmd_general.html#info_memory">info memory</a>
  333.       command. Chips and address spaces can be used as well.
  334.       <p>Second parameter specifies start address of the modification. </p>
  335.       <p>Remaining parameters will be written into the memory starting at
  336.         address specified by second parameter. Data list can include numbers as
  337.         well as strings. See <a href="syntax.html">syntax</a> for more details.
  338.       </p>
  339.       <p>Modified memory locations will be dumped out. </p>
  340.       <pre>0&gt; <font color="#118811">set mem xram 1 "ab\tcd\0ef\012ghq" 2 "ABC"</font>
  341. 0x0001 61 62 09 63 64 00 65 66 ab.cd.ef
  342. 0x0009 0a 67 68 71 02 41 42 43 .ghq.ABC
  343. 0&gt; <font color="#118811">set mem sfr pcon 0x34</font>
  344. 0x87 34                      4
  345. 0&gt; <font color="#118811">set mem xram_chip 1 2</font>
  346. 0x0001 02                      .
  347. 0&gt; </pre>
  348.       <hr>
  349.       <h4><a name="set_bit">set bit <i>address 0|1</i></a></h4>
  350.       Set one bit to 0 or 1. First parameter specifies the bit. It can be the
  351.       address of the bit (number or symbolic name) or it can be specified in <i>address<b>.</b>bitnumber</i>
  352.       format where <i>address</i> addresses SFR area and <i>bitnumber</i> is
  353.       number of bit in specified SFR location. Using this syntax any SFR (and
  354.       8051's internal RAM) location can be modified it need not be really bit
  355.      addressable.
  356.      <p>Second parameter interpreted as 1 if it is not zero. </p>
  357.      <p>Modified memory location is dumped out. </p>
  358.      <pre>$ <font color="#118811">s51 </font>
  359. ucsim 0.2.38-pre2, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  360. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  361. This is free software, and you are welcome to redistribute it
  362. under certain conditions; type `show c' for details.
  363. &gt; <font color="#118811">set bit tf1 1</font>
  364. 0x88 80 .
  365. &gt; <font color="#118811">set bit 130 0</font>
  366. 0x80 fb .
  367. &gt; <font color="#118811">set bit pcon.2 1</font>
  368. 0x87 04 .
  369. &gt; <font color="#118811">set bit 10.7 1</font>
  370. 0x0a 80 .
  371. &gt;
  372. </pre>
  373.      <hr>
  374.      <h4><a name="set_hardware">set hardware <i>hardware_id data</i></a></h4>
  375.      This command can be used to set value into a hardware element of the
  376.      controller (<a href="#conf">conf</a> command lists them).
  377.      <p>Actually only <b>port</b> element of MCS51 accepts this method. It can
  378.        be used to set value of external circuits which connected to ports of
  379.        simulated controller. First parameter specifies port element (as an
  380.        array), second is the new value. </p>
  381.      <pre>0&gt; <font color="#118811">conf</font>
  382. Type of microcontroller: 51 CMOS
  383. Controller has 9 hardware element(s).
  384.  timer0[0]
  385.  timer1[1]
  386.  uart[0]
  387.  port[0]
  388.  port[1]
  389.  port[2]
  390.  port[3]
  391.  irq[0]
  392.  _51_dummy[0]
  393. 0&gt; <font color="#118811">set hw port[0] 12</font>
  394. 0&gt; <font color="#118811">i h po[0]</font>
  395. port[0]
  396. P0    11111111 0xff 255 . (Value in SFR register)
  397. Pin0  00001100 0x0c  12 . (Output of outside circuits)
  398. Port0 00001100 0x0c  12 . (Value on the port pins)
  399. 0&gt; <font color="#118811">set hw port[0] 23</font>
  400. 0&gt; <font color="#118811">i h po[0]</font>
  401. port[0]
  402. P0    11111111 0xff 255 . (Value in SFR register)
  403. Pin0  00010111 0x17  23 . (Output of outside circuits)
  404. Port0 00010111 0x17  23 . (Value on the port pins)
  405. 0&gt; <font color="#118811">set hw irq[0] 12</font>
  406. Nothing to do
  407. 0&gt;
  408. </pre> </blockquote>
  409.    <hr>
  410.    <h3><a name="state">state</a></h3>
  411.    State of the simulator and the simulated microcontroller:
  412.    <pre>&gt; <font color="#118811">state</font>
  413. CPU state= OK PC= 0x004349 XTAL= 1.10592e+07
  414. Total time since last reset= 0.614873 sec (6800004 clks)
  415. Time in isr = 0.0144227 sec (159504 clks) 2.3%
  416. Time in idle= 0 sec (0 clks)   0%
  417. Max value of stack pointer= 0x000049, avg= 0x000026
  418. &gt;
  419. </pre> The "CPU state" in the first line is an internal information. PC is value
  420.    of the program counter. First line shows XTAL frequency too.
  421.    <p>Following lines contain information about simulated time. First, full
  422.      simulated time (elapsed from last reset) is printed out in seconds and
  423.      number of clock periods then same data is printed out about time spent in
  424.      interrupt service routines as well as in idle mode. Last data in lines of
  425.      ISR and IDLE time shows ratio of ISRs, Idle times and main program. </p>
  426.    <p>Last line informs about maximum value of the stack pointer and a "not
  427.      very well" calculated average value of it. </p>
  428.    <hr>
  429.    <h3><a name="reset">reset</a></h3>
  430.    Reset command. It resets the microcontroller. It has same effect as active
  431.    signal on the RST pin.
  432.    <pre>$ <font color="#118811">s51 -V remoansi.hex</font>
  433. ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  434. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  435. This is free software, and you are welcome to redistribute it
  436. under certain conditions; type `show c' for details.
  437. 58659 bytes read from remoansi.hex
  438. &gt; <font color="#118811">i r</font>
  439. 000000 00 00 00 00 00 00 00 00 ........
  440. 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
  441. 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  442.   000000 02 01 60 LJMP  0160
  443. &gt; <font color="#118811">s</font>
  444. 000000 00 00 00 00 00 00 00 00 ........
  445. 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
  446. 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  447.   000160 c2 90    CLR   P1.0
  448. &gt; <font color="#118811">s</font>
  449. 000000 00 00 00 00 00 00 00 00 ........
  450. 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
  451. 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  452.   000162 c2 97    CLR   P1.7
  453. &gt; <font color="#118811">res</font>
  454. &gt; <font color="#118811">i r</font>
  455. 000000 00 00 00 00 00 00 00 00 ........
  456. 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
  457. 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  458.   000000 02 01 60 LJMP  0160
  459. &gt; </pre>
  460.    <hr>
  461.    <h3><a name="info">info</a></h3>
  462.    This command prints out information about different things which must be
  463.    specified as parameter to the command. Following subcommands are known:
  464.    <p>info <a href="#info_breakpoints">breakpoints</a> <br>
  465.      info <a href="#info_registers">registers</a> <br>
  466.      info <a href="#info_hardware">hardware</a> <br>
  467.      <!-- info <a href="#info_stack">stack</a> <br>-->
  468.      info <a href="#info_memory">memory</a> <br>
  469.      info <a href="#info_variables">variables</a> </p>
  470.    <blockquote>
  471.      <h4><a name="info_breakpoints">info breakpoints</a></h4>
  472.      This subcommand prints out information about breakpoints:
  473.      <pre>0&gt; <font color="#118811">b 12</font>
  474. Breakpoint 1 at 0x00000c: MOV   R7,A
  475. 0&gt; <font color="#118811">tb 43</font>
  476. Breakpoint 2 at 0x00002b: MOV   R7,A
  477. 0&gt; <font color="#118811">b sfr w 0x80</font>
  478. 0&gt; <font color="#118811">i b</font>
  479. Num Type       Disp Hit   Cnt   Address  What
  480. 1   fetch      keep 1     1     0x00000c MOV   R7,A
  481. 2   fetch      del  1     1     0x00002b MOV   R7,A
  482. 3   event      keep 1     1     0x000080 write
  483. 0&gt;
  484. </pre> As you see above, the command can be shortened to "i b". The list of
  485.      breakpoints contains 7 columns:
  486.      <dl>
  487.        <dt><b>Num</b> </dt>
  488.        <dd>Number of the breakpoint. </dd>
  489.        <dt><b>Type</b> </dt>
  490.        <dd>This column shows type of the breakpoint. It can be <i>fetch</i>
  491.          for normal breakpoints or <i>event</i> for event breakpoints. First
  492.          the normal breakpoints are listed and then the event breakpoints. </dd>
  493.        <dt><b>Disp</b> </dt>
  494.        <dd>This shows if the breakpoint is temporary (<i>del</i>) or not (<i>keep</i>).
  495.          </dd> <dt><b>Hit</b> </dt>
  496.        <dd>How many times the breakpoint must be hit before it really stops the
  497.          program. </dd>
  498.        <dt><b>Cnt</b> </dt>
  499.        <dd>Counter of breakpoint hits. This counter decrements and the
  500.          breakpoint is activated if it reaches zero. </dd>
  501.        <dt><b>Address</b> </dt>
  502.        <dd>Address where the breakpoint is set. </dd>
  503.        <dt><b>What</b> </dt>
  504.        <dd>For normal breakpoints this field contains disassembled instruction
  505.          where the breakpoint is set. For event breakpoints it contains type of
  506.          event. </dd>
  507.      </dl>
  508.      <hr>
  509.      <h4><a name="info_registers">info registers</a></h4>
  510.      This subcommand prints out full register set of the CPU. Output of this
  511.      command depends of type of CPU.
  512.      <h5>Registers of MCS51 family</h5>
  513.      <pre>$ <font color="#118811">s51 remoansi.hex</font>
  514. ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  515. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  516. This is free software, and you are welcome to redistribute it
  517. under certain conditions; type `show c' for details.
  518. 58659 bytes read from remoansi.hex
  519. &gt; <font color="#118811">sopt stopit 1</font>
  520. &gt; <font color="#118811">g</font>
  521. 5
  522. * 000023 02 01 1c LJMP  011c
  523. &gt; <font color="#118811">i r</font>
  524. 000000 18 02 16 ba 00 02 00 0a ........
  525. 000018 4a J  ACC= 0x0a  10 .  B= 0x00   DPTR= 0x16ba @DPTR= 0x00   0 .
  526. 000002 16 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  527. * 000023 02 01 1c LJMP  011c
  528. &gt; </pre>
  529.      In first line the actual register bank is dumped out. Register banks
  530.      reside in internal RAM, address at the beginning of the line shows start
  531.      address of actual register bank selected by RS0 and RS1 bits of PSW
  532.      register.
  533.      <p>Next two lines begin with value of indirectly addressed internal RAM
  534.        cells. Second line shows IRAM cell pointed by R0 while third line shows
  535.        IRAM addressed by R1. </p>
  536.      <p>Second line displays some important registers. First one is the
  537.        accumulator. Its value dumped out in hexadecimal, decimal form and then
  538.        the ASCII character of its value. It is followed by value of the B
  539.        register which is dumped out in hexadecimal form only. Next is DPTR
  540.        register in hexadecimal and then external RAM cell which is addressed by
  541.        DPTR. This is dumped out in hexadecimal, decimal and ASCII too. </p>
  542.      <p>In third line you find program status word in hexadecimal and then some
  543.        flag bits of PSW register. Last line is disassembled instruction at PC.
  544.      </p>
  545.      <h5>Registers of AVR family</h5>
  546.      <pre>$ <font color="#118811">savr test_arith.hex</font>
  547. ucsim 0.2.37, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  548. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  549. This is free software, and you are welcome to redistribute it
  550. under certain conditions; type `show c' for details.
  551. &gt; 83 words read from test_arith.hex
  552. 83 words read from test_arith.hex
  553. &gt; <font color="#118811">run</font>
  554.  
  555. Stop at 0x000047: (105) User stopped
  556. F 0x000047
  557. &gt; <font color="#118811">i r</font>
  558. 000000 00 2c 21 23 20 35 19 14 03 00 00 00 00 00 00 00 .,!# 5..........
  559. 000010 00 01 1e 89 01 00 10 e2 14 00 01 10 00 00 00 00 ................
  560. ITHSVNZC  SREG= 0x03   3 .
  561. 00000011  SP  = 0x000000
  562. X= 0x1001 [X]= 0x00   0 .  Y= 0x0000 [Y]= 0x00   0 .  Z= 0x0000 [Z]= 0x00   0 .
  563. * 000047 940c 0047 jmp   0x000047
  564. &gt;
  565. </pre> First two lines show first 32 bytes of internal RAM which is the register
  566.      set of AVR controllers.
  567.      <p>At the beginning of next two lines bits of status register are printed.
  568.        These lines present hexadecimal, decimal and ASCII values of the status
  569.        register too, and value of the stack pointer. </p>
  570.      <p>Following line shows indirect addressing registers X, Y, and Z as well
  571.        as pointed memory values. </p>
  572.      <p>Last line is disassembled instruction at PC. </p>
  573.      <h5>Registers of Z80 family</h5>
  574.      <pre>$ <font color="#118811">sz80</font>
  575. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  576. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  577. This is free software, and you are welcome to redistribute it
  578. under certain conditions; type `show c' for details.
  579. 0&gt; <font color="#118811">i r</font>
  580. SZ-A--P-C  Flags= 0x00   0 .  A= 0x00   0 .
  581. 00-0--0-0
  582. BC= 0x0000 [BC]= 00   0 .  DE= 0x0000 [DE]= 00   0 .  HL= 0x0000 [HL]= 00   0 .
  583. IX= 0x0000 [IX]= 00   0 .  IY= 0x0000 [IY]= 00   0 .  SP= 0x0000 [SP]= 00   0 .
  584. ? 0x0000 00          NOP
  585. 0&gt;
  586. </pre>
  587.      <h5>Registers of XA family</h5>
  588.      <pre>$ <font color="#118811">sxa</font>
  589. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  590. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  591. This is free software, and you are welcome to redistribute it
  592. under certain conditions; type `show c' for details.
  593. The XA Simulator is in development, UNSTABLE, DEVELOPERS ONLY!
  594. 0&gt; <font color="#118811">i r</font>
  595. CA---VNZ | R0:0100 R1:0302 R2:0504 R3:0706
  596. 00---000 | R4:0908 R5:0b0a R6:0d0c SP:0100 ES:0000  DS:0000
  597. ? 0x0302 02 03             ADD   R0l,[R3]
  598. 0&gt;
  599. </pre>
  600.      <h5>Registers of HC08 family</h5>
  601.      <pre>$ <font color="#118811">shc08</font>
  602. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  603. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  604. This is free software, and you are welcome to redistribute it
  605. under certain conditions; type `show c' for details.
  606. 0&gt; <font color="#118811">i r</font>
  607. V--HINZC  Flags= 0x60  96 `  A= 0x00   0 .
  608. 0--00000      H= 0x00   0 .  X= 0x00   0 .
  609. SP= 0x00ff [SP+1]= 00   0 .
  610. ? 0x0000 00 01 02    brset #0,*0x01,0x0005
  611. 0&gt;
  612. </pre>
  613.      <hr>
  614.      <h4><a name="info_hardware">info hardware|hw <i>identifier</i></a></h4>
  615.      This subcommand prints out information about a unit of the controller. <b>identifier</b>
  616.      specifies hardware element. One form of it is a name. Names of hardware
  617.      elements can be checked by <a href="#conf">conf</a> command. This form is
  618.      accepted only when name is unique. If more than one element exists with
  619.      the same name then name must be followed by id number in square brackets
  620.      in same form as it is listed by <a href="#conf">conf</a> command.
  621.      <p>Output format of this command depends on CPU family and type of the CPU
  622.        too because requested unit can be different in different type of
  623.        controller even in the same CPU family. </p>
  624.      <pre>$ <font color="#118811">s51 -t 51</font>
  625. ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  626. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  627. This is free software, and you are welcome to redistribute it
  628. under certain conditions; type `show c' for details.
  629. 0&gt; <font color="#118811">conf</font>
  630. ucsim version 0.5.0-pre3
  631. Type of microcontroller: 51 CMOS
  632. Controller has 8 hardware element(s).
  633.  timer0[0]
  634.  timer1[1]
  635.  uart[0]
  636.  port[0]
  637.  port[1]
  638.  port[2]
  639.  port[3]
  640.  irq[0]
  641.  _51_dummy[0]
  642. 0&gt; <font color="#118811">i h port[2]</font>
  643. port[2]
  644. P2    11111111 0xff 255 . (Value in SFR register)
  645. Pin2  11111111 0xff 255 . (Output of outside circuits)
  646. Port2 11111111 0xff 255 . (Value on the port pins)
  647. 0&gt; <font color="#118811">i h t[0]</font>
  648. timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0
  649. 0&gt; <font color="#118811">i h u</font>
  650. uart[0] Shift, fixed clock MultiProc=none irq=dis prio=0
  651. Receiver OFF RB8=0 irq=0
  652. Transmitter TB8=0 irq=0
  653. 0&gt;
  654. </pre> Timer #2 differs a little bit from other timers of MCS51:
  655.      <pre>$ <font color="#118811">s51 -t 52</font>
  656. ucsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  657. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  658. This is free software, and you are welcome to redistribute it
  659. under certain conditions; type `show c' for details.
  660. 0&gt; <font color="#118811">i h timer0</font>
  661. timer0[0] 0x0000 13 bit timer OFF irq=0 dis prio=0
  662. 0&gt; <font color="#118811">i h t[2]</font>
  663. timer2[2] 0x0000 reload 0x0000 timer OFF irq=0 dis prio=0
  664. 0&gt;
  665. </pre>
  666. <hr>
  667. <!--
  668.      <h4><a name="info_stack">info stack</a></h4>
  669.      This command prints out information about data stored in the CPU's stack
  670.       and operations which put them there.
  671.       <pre>$ <font color="#118811">s51 ~/remo.hex</font>
  672. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  673. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  674. This is free software, and you are welcome to redistribute it
  675. under certain conditions; type `show c' for details.
  676. 55470 words read from /home/staff/drdani/remo.hex
  677. 0&gt; <font color="#118811">set opt irq_stop true</font>
  678. 0&gt; <font color="#118811">r</font>
  679. Simulation started, PC=0x000000
  680. Stop at 0x000023: (2) Interrupt
  681. F 0x000023
  682. 0&gt; <font color="#118811">i s</font>
  683. OP   SP before-after   L DATA/ADDR   INSTRUCTION
  684. call 0x000022-0x000024 2 0x002976    0x022a 12 29 76 LCALL 2976
  685. call 0x000024-0x000026 2 0x002379    0x2976 12 23 79 LCALL 2379
  686. call 0x000026-0x000028 2 0x003612    0x2517 12 36 12 LCALL 3612
  687. intr 0x000028-0x00002a 2 0x000023    0x366f 20 0c 02 JB    21.4,3674
  688. 0&gt;
  689. </pre> First column shows the operation which can be <b>call</b> or <b>push</b>
  690.       or <b>intr</b> (interrupt call). Next column contains value of the SP
  691.       register before and after the operation. Column "L" shows size of the
  692.       data, and the next column the data itself. Note, that for call operations
  693.       (call, and intr) the <b>called</b> address is printed, not the pushed
  694.       one! Last column is the instruction which has been executed when the
  695.       operation occurred.
  696. <hr>
  697. -->
  698.       <h4><a name="info_memory">info memory</a></h4>
  699.       This command shows information about <a href="memory.html">memory system</a>:
  700.       chips, address spaces and address decoders.
  701.       <pre>$ <font color="#118811">s51</font>
  702. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  703. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  704. This is free software, and you are welcome to redistribute it
  705. under certain conditions; type `show c' for details.
  706. 0&gt; <font color="#118811">i m</font>
  707. Memory chips:
  708.   0x000000-0x010000    65536 rom_chip (8,%02x,0x%04x)
  709.   0x000000-0x000080      128 iram_chip (8,%02x,0x%02x)
  710.   0x000000-0x010000    65536 xram_chip (8,%02x,0x%04x)
  711.   0x000000-0x000080      128 sfr_chip (8,%02x,0x%02x)
  712. Address spaces:
  713.   0x000000-0x010000    65536 rom (8,%02x,0x%04x)
  714.   0x000000-0x000080      128 iram (8,%02x,0x%02x)
  715.   0x000080-0x000080      128 sfr (8,%02x,0x%02x)
  716.   0x000000-0x010000    65536 xram (8,%02x,0x%04x)
  717. Address decoders:
  718.  0 rom 0x0000 0xffff -&gt; rom_chip 0x0000 activated
  719.  0 iram 0x00 0x7f -&gt; iram_chip 0x00 activated
  720.  0 sfr 0x80 0xff -&gt; sfr_chip 0x00 activated
  721.  0 xram 0x0000 0xffff -&gt; xram_chip 0x0000 activated
  722. 0&gt;
  723. </pre> First column shows address ranges, next one is the size followed by the
  724.       name of the memory. This name can be used in other commands (such as <a href="cmd_dump.html#dump">dump</a>,
  725.       <a href="#set_memory">set memory</a>, etc.). Last column shows some
  726.       technical information (width in bits, format specifier to print out
  727.       content and address).
  728.       <p>Address decoders are associated with address spaces. Each address space
  729.         has a list of decoders. First column of the address decoder information
  730.         is the number of the decoder. Next three columns specifies name and area
  731.         of the address space which is handled by the decoder. After "-&gt;" sign
  732.         the name and the address of the memory chip is printed where the decoder
  733.         maps the area of the address space. </p>
  734.       <p>Memory system of other controller family can be different. </p>
  735.       <pre>$ <font color="#118811">savr</font>
  736. uCsim 0.5.0-pre3, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  737. uCsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  738. This is free software, and you are welcome to redistribute it
  739. under certain conditions; type `show c' for details.
  740. 0&gt; <font color="#118811">i m</font>
  741. Memory chips:
  742.   0x000000-0x00ffff    65536 rom_chip (16,%04x,0x%04x)
  743.   0x000000-0x00007f      128 iram_chip (8,%02x,0x%02x)
  744. Address spaces:
  745.   0x000000-0x00ffff    65536 rom (16,%04x,0x%04x)
  746.   0x000000-0x00ffff    65536 iram (8,%02x,0x%04x)
  747. Address decoders:
  748.  0 rom 0x0000 0xffff -&gt; rom_chip 0x0000 activated
  749.  0 iram 0x0000 0x007f -&gt; iram_chip 0x00 activated
  750. 0&gt;
  751. </pre>
  752.       <hr>
  753.       <h4><a name="info_variables">info variables</a></h4>
  754.     </blockquote>
  755.     <hr>
  756.     <h3><a name="timer">timer</a></h3>
  757.     Handling of timers. Don't be confused! This command doesn't handle timer
  758.     element of the controller. It manages "clock counters" which can be used to
  759.     profile applications.
  760.     <p>Known subcommands are: </p>
  761.     <p>timer <a href="#timer_add">add</a> <br>
  762.       timer <a href="#timer_delete">delete</a> <br>
  763.       timer <a href="#timer_get">get</a> <br>
  764.       timer <a href="#timer_start">start</a> <br>
  765.       timer <a href="#timer_stop">stop</a> <br>
  766.       timer <a href="#timer_set">set</a> </p>
  767.     <p>Each subcommand can (some must) be followed by a timer id which can be a
  768.       number or a string. Timers are numbered from 1. You can use any number
  769.       greater than 0 to identify a timer. Or you can use a simbolic name, in
  770.       this case simulator uses the first unused number to allocate a new timer.
  771.     </p>
  772.     <blockquote>
  773.       <h4><a name="timer_add">timer add|create|make <i>id [direction [in_isr]]</i></a></h4>
  774.       To create a new timer. New timers are turned ON by default and initialized
  775.       to value 0. <b>Direction</b> is an integer (can be positive or negative)
  776.       number which is added to the actual value in every step. If <b>in_isr</b>
  777.       is TRUE the timer counts only when execution is in an interrupt handler.
  778.       <hr>
  779.       <h4><a name="timer_delete">timer delete|remove <i>id</i></a></h4>
  780.       To remove a timer if you don't need it any more.
  781.      <hr>
  782.      <h4><a name="timer_get">timer get <i>[id]</i></a></h4>
  783.      To get value of timers. If you don't use timer id in this command
  784.       simulator prints out value of all timers including predefined ones. See
  785.       example below.
  786.       <hr>
  787.       <h4><a name="timer_start">timer start|run <i>id</i></a></h4>
  788.       To turn a timer ON.
  789.       <hr>
  790.       <h4><a name="timer_stop">timer stop <i>id</i></a></h4>
  791.       To turn a timer OFF. It still exist but doesn't count xtal periods.
  792.      <hr>
  793.      <h4><a name="timer_set">timer set|value <i>id value</i></a></h4>
  794.      To set value of the timer (number of xtal periods). <b>value</b> is the
  795.      new value.
  796.      <pre>0&gt; <font color="#118811">tim a 3</font>
  797. 0&gt; <font color="#118811">tim g</font>
  798. timer #0("time") ON: 0.463255 sec (5123232 clks)
  799. timer #0("isr") ON: 0.0051888 sec (57384 clks)
  800. timer #0("idle") ON,ISR: 0 sec (0 clks)
  801. timer #3("unnamed") ON: 0 sec (0 clks)
  802. 0&gt; <font color="#118811">tim a "a"</font>
  803. 0&gt; <font color="#118811">tim g</font>
  804. timer #0("time") ON: 0.463255 sec (5123232 clks)
  805. timer #0("isr") ON: 0.0051888 sec (57384 clks)
  806. timer #0("idle") ON,ISR: 0 sec (0 clks)
  807. timer #1("a") ON: 0 sec (0 clks)
  808. timer #3("unnamed") ON: 0 sec (0 clks)
  809. 0&gt;
  810. </pre> </blockquote>
  811.    <hr>
  812.  </body>
  813. </html>
  814.