summaryrefslogtreecommitdiff
path: root/sim/ucsim/doc/cmd_exec.html
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2019-10-18 00:31:54 +0200
committerXavier ASUS <xavi92psx@gmail.com>2019-10-18 00:31:54 +0200
commit268a53de823a6750d6256ee1fb1e7707b4b45740 (patch)
tree42c1799a9a82b2f7d9790ee9fe181d72a7274751 /sim/ucsim/doc/cmd_exec.html
downloadsdcc-gas-268a53de823a6750d6256ee1fb1e7707b4b45740.tar.gz
sdcc-3.9.0 fork implementing GNU assembler syntax
This fork aims to provide better support for stm8-binutils
Diffstat (limited to 'sim/ucsim/doc/cmd_exec.html')
-rw-r--r--sim/ucsim/doc/cmd_exec.html165
1 files changed, 165 insertions, 0 deletions
diff --git a/sim/ucsim/doc/cmd_exec.html b/sim/ucsim/doc/cmd_exec.html
new file mode 100644
index 0000000..fe5b70a
--- /dev/null
+++ b/sim/ucsim/doc/cmd_exec.html
@@ -0,0 +1,165 @@
+<html>
+ <head>
+ <meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
+ <title>Execution commands of &mu;Csim</title>
+ </head>
+ <body bgcolor="white">
+ <h2>Execution commands of <i>&mu;Csim</i></h2>
+ <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>
+ <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
+ occurs 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>
+ <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>
+ <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:
+ </p>
+ <pre>$ <font color="#118811">./s51</font>
+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.
+&gt; <font color="#118811">b 0x10</font>
+Breakpoint 1 at 0x000010: MOV R7,A
+&gt; <font color="#118811">b 0x20</font>
+Breakpoint 2 at 0x000020: MOV R7,A
+&gt; <font color="#118811">run 0x10</font>
+Warning: maybe not instruction at 0x000010
+Simulation started, PC=0x000010
+Stop at 0x000020: (104) Breakpoint
+F 0x000020
+&gt;
+</pre>
+ <hr>
+ <a name="stop">
+ <h3>stop</h3>
+ </a>
+ This command stops the simulation, it freezes the CPU and all the
+ peripherals.
+ <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.
+58659 bytes read from remoansi.hex
+&gt; <font color="#118811">g</font>
+Simulation started
+&gt; <font color="#118811">dr</font>
+000000 00 01 00 14 00 00 5a 47 ......ZG
+000000 00 . ACC= 0x47 71 G B= 0x01 DPTR= 0x001c @DPTR= 0x47 71 G
+000001 01 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
+ 006f02 90 00 1e MOV DPTR,#001e
+&gt; <font color="#118811">stop</font>
+ 006ac5 24 a5 ADD A,#a5
+&gt;
+</pre>
+ Simulated program is executed in background and the simulator accepts
+ commands. If it stopped by the stop command the instruction pointed by
+ PC is disassembled, see the <a href="#dis"><b>dis</b></a> command for
+ description of disassembled form.
+ <hr>
+ <a name="step">
+ <h3>s,step [steps]</h3>
+ </a>
+ Step command. It executes one instruction without effect of
+ breakpoints.
+ <p>The optional parameter can be used to specify number of instructions
+ to execute. Note that breakpoints will stop the execution after the
+ first instruction.
+ </p>
+ <pre>$ <font color="#118811">s51 remoansi.hex</font>
+ucsim 0.2.12, 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.
+58659 bytes read from remoansi.hex
+&gt; <font color="#118811">s</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
+ 000160 c2 90 CLR P1.0
+&gt; </pre>
+ After execution of actual instruction pointed by PC (or all
+ instructions specified by the optional parameter) the <b>step</b>
+ command dumps out the register set.
+ <hr>
+ <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
+ instruction to execute is a subroutine call the <b>next</b> command
+ places a dynamic breakpoint after the call instruction and starts to
+ execute the subroutine. If the subroutine is infinite the breakpoint
+ set by <b>next</b> will never reached. It can be a dangerous situation
+ because the execution started by the <b>next</b> command can not be
+ stopped interactively. But it can be stopped by other breakpoints.
+ <pre>$ <font color="#118811">s51 remoansi.hex</font>
+ucsim 0.2.12, 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.
+58659 bytes read from remoansi.hex
+&gt; <font color="#118811">run 0 0x172</font>
+ 000172 79 04 MOV R1,#04
+&gt; <font color="#118811">dis 0x172 0 5</font>
+ 000170 7f 00 MOV R7,#00
+ 000172 79 04 MOV R1,#04
+ 000174 12 0d b8 LCALL 0db8
+ 000177 0f INC R7
+ 000178 d9 fa DJNZ R1,0174
+ 00017a 75 0b 00 MOV 0b,#00
+&gt; <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
+&gt; <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
+&gt; </pre>
+ <hr>
+ <a name="pc">
+ <h3>pc [address]</h3>
+ </a>
+ Using this command without any parameter it simply dumps out
+ instruction pointed by the PC. Specify address if you want to set the
+ PC.
+ <pre>$ s51
+S51 0.1.5, Copyright (C) 1997 Daniel Drotos, Talker Bt.
+S51 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.
+&gt; <font color="#118811">pc</font>
+ * 000000 ff MOV R7,A
+&gt; <font color="#118811">pc 123</font>
+ * 00007b ff MOV R7,A
+&gt; <font color="#118811">sopt debug t </font>
+&gt; <font color="#118811">pc 32</font>
+Warning: maybe not instruction at 000020
+ * 000020 ff MOV R7,A
+&gt; </pre>
+ <hr>
+ <!--OK-->
+ </body>
+</html>