version 0.2.39: fix of arith insts and start of re-structure
[fw/sdcc] / sim / ucsim / doc / cmd_exec.html
index 624daa4617dde73961c9b0a93a3993410d56b4dd..8bca134842dfb67e9a8bc7cf18e6965c580c1648 100644 (file)
@@ -5,83 +5,8 @@
 
 <body bgcolor="white">
 
-                                                                 <!-- EXEC -->
-<h2>Execution commands of uCsim</h2>
-
-
-<a name="g"><h3>g [start [stop]]</h3></a>
-
-Go, start execution. Parameters are optional. First parameter
-specifies start address of the execution. By default execution starts
-at address specified by actual value of the PC. This can be overridden
-by first parameter. If second parameter is specified it places a
-dynamic breakpoint at specified address which stops the execution. If
-stop address is not given the simulator stops if it reaches a
-breakpoint, or the CPU accepts an interrupt and <b>stopit</b> option
-is TRUE, or fatal error occures or <a href="#stop">stop</a> command is
-used. Note that first instruction is executed without effect of
-breakpoints. It means that if there is a breakpoint at start address
-then it will not be hit.
-
-<pre>
-$ <font color="#118811">s51 remoansi.hex</font>
-ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
-ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
-This is free software, and you are welcome to redistribute it
-under certain conditions; type `show c' for details.
-55755 bytes read from remoansi.hex
-> <font color="#118811">b 0x187</font>
-> <font color="#118811">sopt stopit y</font>
-> <font color="#118811">g</font>
-Simulation started, PC=0x000000
-Stop at 000187: (4) Breakpoint
-F 000187
-> </pre>
-
-After execution is started the <tt>Simulaton started</tt> message
-appears with value of PC where the execution started and the simulator
-is ready to accept other commands while the simulation is running in
-background.
-
-<!--If execution stops the simulator first writes out a number which is
-the reason of the stop (this is a diagnostic feature, it will be
-improved in future versions). Reason can be:
-
-<dl><dt>0
-
-<dd>There is no reason to stop. This number should never appear.
-
-<dt>1
-
-<dd>Serious error for example unknown instruction code which is
-impossible to execute.
-
-<dt>2
-
-<dd>Invalid address used in an instruction. For example indirect
-address is bigger then 127 in 51 type of controller. Execution can be
-continued but result will be undefined.
-
-<dt>3
-
-<dd>Stack overflow. Execution can be continued but result will be
-undefined.
 
-<dt>4
-
-<dd>Breakpoint has been reached.
-
-<dt>5
-
-<dd>Interrupt accepted. It only stops the execution if <b>stopit</b>
-option is set to TRUE. See <a href="#sopt">sopt</a> command.
-
-</dl>
-
-After this diagnostic message the simulator prints out intruction at
-the PC in disassembled form. See <a href="#dis"><b>dis</b></a>
-commands for description of disassembled form.
--->
+<h2>Execution commands of uCsim</h2>
 
 
 <a name="stop"><h3>stop</h3></a>
@@ -114,12 +39,10 @@ PC is dissassembled, see the <a href="#dis"><b>dis</b></a> command for
 description of disassembled form.
 
 
-<a name="s"><h3><img src="burst.gif" alt="[Repeatable]"> s
-[step]</h3></a>
+<a name="step"><h3>s,step</h3></a>
 
 Step command. It executes one instruction without effect of
-breakpoints. Optional parameter can specify number of requested
-steps.
+breakpoints.
 
 <pre>
 $ <font color="#118811">s51 remoansi.hex</font>
@@ -133,23 +56,13 @@ under certain conditions; type `show c' for details.
 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
 000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
    000160 c2 90    CLR   P1.0
-> <font color="#118811">s 2</font>
-000000 00 00 00 00 00 00 00 00 ........
-000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
-000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
-   000162 c2 97    CLR   P1.7
-000000 00 00 00 00 00 00 00 00 ........
-000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
-000000 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
-   000164 d2 b5    SETB  P3.5
 > </pre>
 
 After execution of actual instruction pointed by PC the <b>step</b>
-command executes <a href="#dr"><b>dr</b></a> command.
+command dumps out the register set.
 
 
-<a name="n"><h3><img src="burst.gif" alt="[Repeatable]"> n
-[step]</h3></a>
+<a name="n"><h3>n,next</h3></a>
 
 Execute until next instruction is reached. This command is similar to
 <a href="#s"><b>step</b></a> command described above but if actual
@@ -167,8 +80,7 @@ ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 This is free software, and you are welcome to redistribute it
 under certain conditions; type `show c' for details.
 58659 bytes read from remoansi.hex
-> <font color="#118811">g 0 0x172</font>
-4
+> <font color="#118811">run 0 0x172</font>
    000172 79 04    MOV   R1,#04
 > <font color="#118811">dis 0x172 0 5</font>
    000170 7f 00    MOV   R7,#00
@@ -177,19 +89,16 @@ under certain conditions; type `show c' for details.
    000177 0f       INC   R7
    000178 d9 fa    DJNZ  R1,0174
    00017a 75 0b 00 MOV   0b,#00
-> <font color="#118811">n 3</font>
+> <font color="#118811">n</font>
 000000 00 04 00 00 00 00 00 00 ........
 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0000 @DPTR= 0x00   0 .
 000004 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
    000174 12 0d b8 LCALL 0db8
+> <font color="#118811">n</font>
 000000 00 04 00 00 00 00 00 00 ........
 000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0167 @DPTR= 0x00   0 .
 000004 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
    000177 0f       INC   R7
-000000 00 04 00 00 00 00 00 01 ........
-000000 00 .  ACC= 0x00   0 .  B= 0x00   DPTR= 0x0167 @DPTR= 0x00   0 .
-000004 00 .  PSW= 0x00 CY=0 AC=0 OV=0 P=0
-   000178 d9 fa    DJNZ  R1,0174
 > </pre>
 
 
@@ -216,10 +125,50 @@ Warning: maybe not instruction at 000020
 > </pre>
 
 
-<a name="run"><h3>run</h3></a>
+<a name="run"><h3>r,run,go [start [stop]]</h3></a>
 
 This command starts the execution of the simulated program.
 
+<p>Parameters are optional. First parameter specifies start address of
+the execution. By default execution starts at address specified by
+actual value of the PC. This can be overridden by first parameter.
+
+<p>If second parameter is specified it places a dynamic breakpoint at
+specified address which stops the execution. If stop address is not
+given the simulator stops if it reaches a breakpoint, or the CPU
+accepts an interrupt and <b>stopit</b> option is TRUE, or fatal error
+occures or <a href="#stop">stop</a> command is used on an other
+console, or ENTER key is pressed on the console where the run command
+was issued.
+
+<p>If program execution is started the console is <i>frozen</i> it is
+not possible to give commands on this console to the simulator while
+execution is running. If it is needed to control the simulator during
+program execution then more consoles can be used. See using <a
+href="mulcons.html">multiple consoles</a> for more information.
+
+<p>Note that first instruction is executed without effect of
+breakpoints and simulation will be started afterwards. It means that
+if there is a breakpoint at start address then it will not be hit. See
+following example:
+
+<pre>
+$ ./s51
+ucsim 0.2.38-pre1, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+> <font color="#118811">b 0x10</font>
+Breakpoint 1 at 0x000010: MOV   R7,A
+> <font color="#118811">b 0x20</font>
+Breakpoint 2 at 0x000020: MOV   R7,A
+> <font color="#118811">run 0x10</font>
+Warning: maybe not instruction at 0x000010
+Simulation started, PC=0x000010
+Stop at 0x000020: (104) Breakpoint
+F 0x000020
+> 
+</pre>
 
 <hr>