3 <title>Execution commands of uCsim</title>
9 <h2>Execution commands of uCsim</h2>
12 <a name="g"><h3>g [start [stop]]</h3></a>
14 Go, start execution. Parameters are optional. First parameter
15 specifies start address of the execution. By default execution starts
16 at address specified by actual value of the PC. This can be overridden
17 by first parameter. If second parameter is specified it places a
18 dynamic breakpoint at specified address which stops the execution. If
19 stop address is not given the simulator stops if it reaches a
20 breakpoint, or the CPU accepts an interrupt and <b>stopit</b> option
21 is TRUE, or fatal error occures or <a href="#stop">stop</a> command is
22 used. Note that first instruction is executed without effect of
23 breakpoints. It means that if there is a breakpoint at start address
24 then it will not be hit.
27 $ <font color="#118811">s51 remoansi.hex</font>
28 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
29 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
30 This is free software, and you are welcome to redistribute it
31 under certain conditions; type `show c' for details.
32 55755 bytes read from remoansi.hex
33 > <font color="#118811">b 0x187</font>
34 > <font color="#118811">sopt stopit y</font>
35 > <font color="#118811">g</font>
36 Simulation started, PC=0x000000
37 Stop at 000187: (4) Breakpoint
41 After execution is started the <tt>Simulaton started</tt> message
42 appears with value of PC where the execution started and the simulator
43 is ready to accept other commands while the simulation is running in
46 <!--If execution stops the simulator first writes out a number which is
47 the reason of the stop (this is a diagnostic feature, it will be
48 improved in future versions). Reason can be:
52 <dd>There is no reason to stop. This number should never appear.
56 <dd>Serious error for example unknown instruction code which is
57 impossible to execute.
61 <dd>Invalid address used in an instruction. For example indirect
62 address is bigger then 127 in 51 type of controller. Execution can be
63 continued but result will be undefined.
67 <dd>Stack overflow. Execution can be continued but result will be
72 <dd>Breakpoint has been reached.
76 <dd>Interrupt accepted. It only stops the execution if <b>stopit</b>
77 option is set to TRUE. See <a href="#sopt">sopt</a> command.
81 After this diagnostic message the simulator prints out intruction at
82 the PC in disassembled form. See <a href="#dis"><b>dis</b></a>
83 commands for description of disassembled form.
87 <a name="stop"><h3>stop</h3></a>
89 This command stops the simulation, it freezes the CPU and all the
93 $ <font color="#118811">s51 remoansi.hex</font>
94 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
95 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
96 This is free software, and you are welcome to redistribute it
97 under certain conditions; type `show c' for details.
98 58659 bytes read from remoansi.hex
99 > <font color="#118811">g</font>
101 > <font color="#118811">dr</font>
102 000000 00 01 00 14 00 00 5a 47 ......ZG
103 000000 00 . ACC= 0x47 71 G B= 0x01 DPTR= 0x001c @DPTR= 0x47 71 G
104 000001 01 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
105 006f02 90 00 1e MOV DPTR,#001e
106 > <font color="#118811">stop</font>
107 006ac5 24 a5 ADD A,#a5
111 Simulated program is executed in background and the simulator accepts
112 commands. If it stopped by the stop command the instruction pointed by
113 PC is dissassembled, see the <a href="#dis"><b>dis</b></a> command for
114 description of disassembled form.
117 <a name="s"><h3><img src="burst.gif" alt="[Repeatable]"> s
120 Step command. It executes one instruction without effect of
121 breakpoints. Optional parameter can specify number of requested
125 $ <font color="#118811">s51 remoansi.hex</font>
126 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
127 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
128 This is free software, and you are welcome to redistribute it
129 under certain conditions; type `show c' for details.
130 58659 bytes read from remoansi.hex
131 > <font color="#118811">s</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 > <font color="#118811">s 2</font>
137 000000 00 00 00 00 00 00 00 00 ........
138 000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 .
139 000000 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
140 000162 c2 97 CLR P1.7
141 000000 00 00 00 00 00 00 00 00 ........
142 000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 .
143 000000 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
144 000164 d2 b5 SETB P3.5
147 After execution of actual instruction pointed by PC the <b>step</b>
148 command executes <a href="#dr"><b>dr</b></a> command.
151 <a name="n"><h3><img src="burst.gif" alt="[Repeatable]"> n
154 Execute until next instruction is reached. This command is similar to
155 <a href="#s"><b>step</b></a> command described above but if actual
156 instruction to execute is a subroutine call the <b>next</b> command
157 places a dynamic breakpoint after the call instruction and starts to
158 execute the subroutine. If the subroutine is infinite the breakpoint
159 set by <b>next</b> will never reached. It can be a dangerous situation
160 because the executeion started by the <b>next</b> command can not be
161 stopped interactively. But it can be stopped by other breakpoints.
164 $ <font color="#118811">s51 remoansi.hex</font>
165 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
166 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
167 This is free software, and you are welcome to redistribute it
168 under certain conditions; type `show c' for details.
169 58659 bytes read from remoansi.hex
170 > <font color="#118811">g 0 0x172</font>
172 000172 79 04 MOV R1,#04
173 > <font color="#118811">dis 0x172 0 5</font>
174 000170 7f 00 MOV R7,#00
175 000172 79 04 MOV R1,#04
176 000174 12 0d b8 LCALL 0db8
178 000178 d9 fa DJNZ R1,0174
179 00017a 75 0b 00 MOV 0b,#00
180 > <font color="#118811">n 3</font>
181 000000 00 04 00 00 00 00 00 00 ........
182 000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 .
183 000004 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
184 000174 12 0d b8 LCALL 0db8
185 000000 00 04 00 00 00 00 00 00 ........
186 000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0167 @DPTR= 0x00 0 .
187 000004 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
189 000000 00 04 00 00 00 00 00 01 ........
190 000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0167 @DPTR= 0x00 0 .
191 000004 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
192 000178 d9 fa DJNZ R1,0174
196 <a name="pc"><h3>pc [address]</h3></a>
198 Using this command without any parameter it simply dumps out
199 instruction pointed by the PC. Specify address if you want to set the
204 S51 0.1.5, Copyright (C) 1997 Daniel Drotos, Talker Bt.
205 S51 comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
206 This is free software, and you are welcome to redistribute it
207 under certain conditions; type `show c' for details.
208 > <font color="#118811">pc</font>
210 > <font color="#118811">pc 123</font>
212 > <font color="#118811">sopt debug t </font>
213 > <font color="#118811">pc 32</font>
214 Warning: maybe not instruction at 000020
219 <a name="run"><h3>run</h3></a>
221 This command starts the execution of the simulated program.