?login_element?

Subversion Repositories NedoOS

Rev

Blame | Last modification | View Log | Download | RSS feed

  1. <html>
  2.   <head>
  3.     <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
  4.     <title>Execution commands of &mu;Csim</title>
  5.   </head>
  6.   <body bgcolor="white">
  7.     <h2>Execution commands of <i>&mu;Csim</i></h2>
  8.     <a name="run">
  9.       <h3>r,run,go [start [stop]]</h3>
  10.     </a>
  11.     This command starts the execution of the simulated program.
  12.     <p>Parameters are optional. First parameter specifies start address of
  13.       the execution. By default execution starts at address specified by
  14.       actual value of the PC. This can be overridden by first parameter.
  15.     </p>
  16.     <p>If second parameter is specified it places a dynamic breakpoint at
  17.       specified address which stops the execution. If stop address is not
  18.       given the simulator stops if it reaches a breakpoint, or the CPU
  19.       accepts an interrupt and <b>stopit</b> option is TRUE, or fatal error
  20.       occurs or <a href="#stop">stop</a> command is used on an other
  21.       console, or ENTER key is pressed on the console where the run command
  22.       was issued.
  23.     </p>
  24.     <p>If program execution is started the console is <i>frozen</i> it is
  25.       not possible to give commands on this console to the simulator while
  26.       execution is running. If it is needed to control the simulator during
  27.       program execution then more consoles can be used. See using <a href="mulcons.html">multiple
  28.         consoles</a> for more information.
  29.     </p>
  30.     <p>Note that first instruction is executed without effect of
  31.       breakpoints and simulation will be started afterwards. It means that
  32.       if there is a breakpoint at start address then it will not be hit. See
  33.       following example:
  34.     </p>
  35.     <pre>$ <font color="#118811">./s51</font>
  36. ucsim 0.2.38-pre1, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  37. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  38. This is free software, and you are welcome to redistribute it
  39. under certain conditions; type `show c' for details.
  40. &gt; <font color="#118811">b 0x10</font>
  41. Breakpoint 1 at 0x000010: MOV   R7,A
  42. &gt; <font color="#118811">b 0x20</font>
  43. Breakpoint 2 at 0x000020: MOV   R7,A
  44. &gt; <font color="#118811">run 0x10</font>
  45. Warning: maybe not instruction at 0x000010
  46. Simulation started, PC=0x000010
  47. Stop at 0x000020: (104) Breakpoint
  48. F 0x000020
  49. &gt;
  50. </pre>
  51.     <hr>
  52.     <a name="stop">
  53.       <h3>stop</h3>
  54.     </a>
  55.     This command stops the simulation, it freezes the CPU and all the
  56.     peripherals.
  57.     <pre>$ <font color="#118811">s51 remoansi.hex</font>
  58. ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  59. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  60. This is free software, and you are welcome to redistribute it
  61. under certain conditions; type `show c' for details.
  62. 58659 bytes read from remoansi.hex
  63. &gt; <font color="#118811">g</font>
  64. Simulation started
  65. &gt; <font color="#118811">dr</font>
  66. 000000 00 01 00 14 00 00 5a 47 ......ZG
  67. 000000 00 .  ACC= 0x47  71 G  B= 0x01   DPTR= 0x001c @DPTR= 0x47  71 G
  68. 000001 01 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  69.    006f02 90 00 1e MOV   DPTR,#001e
  70. &gt; <font color="#118811">stop</font>
  71.    006ac5 24 a5    ADD   A,#a5
  72. &gt;
  73. </pre>
  74.     Simulated program is executed in background and the simulator accepts
  75.     commands. If it stopped by the stop command the instruction pointed by
  76.     PC is disassembled, see the <a href="#dis"><b>dis</b></a> command for
  77.     description of disassembled form.
  78.     <hr>
  79.     <a name="step">
  80.       <h3>s,step [steps]</h3>
  81.     </a>
  82.     Step command. It executes one instruction without effect of
  83.     breakpoints.
  84.     <p>The optional parameter can be used to specify number of instructions
  85.       to execute. Note that breakpoints will stop the execution after the
  86.       first instruction.
  87.     </p>
  88.     <pre>$ <font color="#118811">s51 remoansi.hex</font>
  89. ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  90. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  91. This is free software, and you are welcome to redistribute it
  92. under certain conditions; type `show c' for details.
  93. 58659 bytes read from remoansi.hex
  94. &gt; <font color="#118811">s</font>
  95. 000000 00 00 00 00 00 00 00 00 ........
  96. 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
  97. 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  98.    000160 c2 90    CLR   P1.0
  99. &gt; </pre>
  100.     After execution of actual instruction pointed by PC (or all
  101.     instructions specified by the optional parameter) the <b>step</b>
  102.     command dumps out the register set.
  103.     <hr>
  104.     <a name="n">
  105.       <h3>n,next</h3>
  106.     </a>
  107.     Execute until next instruction is reached. This command is similar to
  108.     <a href="#s"><b>step</b></a> command described above but if actual
  109.     instruction to execute is a subroutine call the <b>next</b> command
  110.     places a dynamic breakpoint after the call instruction and starts to
  111.     execute the subroutine. If the subroutine is infinite the breakpoint
  112.     set by <b>next</b> will never reached. It can be a dangerous situation
  113.     because the execution started by the <b>next</b> command can not be
  114.     stopped interactively. But it can be stopped by other breakpoints.
  115.     <pre>$ <font color="#118811">s51 remoansi.hex</font>
  116. ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  117. ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  118. This is free software, and you are welcome to redistribute it
  119. under certain conditions; type `show c' for details.
  120. 58659 bytes read from remoansi.hex
  121. &gt; <font color="#118811">run 0 0x172</font>
  122.    000172 79 04    MOV   R1,#04
  123. &gt; <font color="#118811">dis 0x172 0 5</font>
  124.    000170 7f 00    MOV   R7,#00
  125.    000172 79 04    MOV   R1,#04
  126.    000174 12 0d b8 LCALL 0db8
  127.    000177 0f       INC   R7
  128.    000178 d9 fa    DJNZ  R1,0174
  129.    00017a 75 0b 00 MOV   0b,#00
  130. &gt; <font color="#118811">n</font>
  131. 000000 00 04 00 00 00 00 00 00 ........
  132. 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
  133. 000004 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  134.    000174 12 0d b8 LCALL 0db8
  135. &gt; <font color="#118811">n</font>
  136. 000000 00 04 00 00 00 00 00 00 ........
  137. 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0167 @DPTR= 0x00   0 .
  138. 000004 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
  139.    000177 0f       INC   R7
  140. &gt; </pre>
  141.     <hr>
  142.     <a name="pc">
  143.       <h3>pc [address]</h3>
  144.     </a>
  145.     Using this command without any parameter it simply dumps out
  146.     instruction pointed by the PC. Specify address if you want to set the
  147.     PC.
  148.     <pre>$ s51
  149. S51 0.1.5, Copyright (C) 1997 Daniel Drotos, Talker Bt.
  150. S51 comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
  151. This is free software, and you are welcome to redistribute it
  152. under certain conditions; type `show c' for details.
  153. &gt; <font color="#118811">pc</font>
  154.  * 000000 ff       MOV   R7,A
  155. &gt; <font color="#118811">pc 123</font>
  156.  * 00007b ff       MOV   R7,A
  157. &gt; <font color="#118811">sopt debug t </font>
  158. &gt; <font color="#118811">pc 32</font>
  159. Warning: maybe not instruction at 000020
  160.  * 000020 ff       MOV   R7,A
  161. &gt; </pre>
  162.     <hr>
  163.     <!--OK-->
  164.   </body>
  165. </html>
  166.