3 <title>Execution commands of µCsim</title>
9 <h2>Execution commands of µCsim</h2>
12 <a name="run"><h3>r,run,go [start [stop]]</h3></a>
14 This command starts the execution of the simulated program.
16 <p>Parameters are optional. First parameter specifies start address of
17 the execution. By default execution starts at address specified by
18 actual value of the PC. This can be overridden by first parameter.
20 <p>If second parameter is specified it places a dynamic breakpoint at
21 specified address which stops the execution. If stop address is not
22 given the simulator stops if it reaches a breakpoint, or the CPU
23 accepts an interrupt and <b>stopit</b> option is TRUE, or fatal error
24 occures or <a href="#stop">stop</a> command is used on an other
25 console, or ENTER key is pressed on the console where the run command
28 <p>If program execution is started the console is <i>frozen</i> it is
29 not possible to give commands on this console to the simulator while
30 execution is running. If it is needed to control the simulator during
31 program execution then more consoles can be used. See using <a
32 href="mulcons.html">multiple consoles</a> for more information.
34 <p>Note that first instruction is executed without effect of
35 breakpoints and simulation will be started afterwards. It means that
36 if there is a breakpoint at start address then it will not be hit. See
40 $ <font color="#118811">./s51</font>
41 ucsim 0.2.38-pre1, Copyright (C) 1997 Daniel Drotos, Talker Bt.
42 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
43 This is free software, and you are welcome to redistribute it
44 under certain conditions; type `show c' for details.
45 > <font color="#118811">b 0x10</font>
46 Breakpoint 1 at 0x000010: MOV R7,A
47 > <font color="#118811">b 0x20</font>
48 Breakpoint 2 at 0x000020: MOV R7,A
49 > <font color="#118811">run 0x10</font>
50 Warning: maybe not instruction at 0x000010
51 Simulation started, PC=0x000010
52 Stop at 0x000020: (104) Breakpoint
60 <a name="stop"><h3>stop</h3></a>
62 This command stops the simulation, it freezes the CPU and all the
66 $ <font color="#118811">s51 remoansi.hex</font>
67 ucsim 0.2.24, Copyright (C) 1997 Daniel Drotos, Talker Bt.
68 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
69 This is free software, and you are welcome to redistribute it
70 under certain conditions; type `show c' for details.
71 58659 bytes read from remoansi.hex
72 > <font color="#118811">g</font>
74 > <font color="#118811">dr</font>
75 000000 00 01 00 14 00 00 5a 47 ......ZG
76 000000 00 . ACC= 0x47 71 G B= 0x01 DPTR= 0x001c @DPTR= 0x47 71 G
77 000001 01 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
78 006f02 90 00 1e MOV DPTR,#001e
79 > <font color="#118811">stop</font>
80 006ac5 24 a5 ADD A,#a5
84 Simulated program is executed in background and the simulator accepts
85 commands. If it stopped by the stop command the instruction pointed by
86 PC is dissassembled, see the <a href="#dis"><b>dis</b></a> command for
87 description of disassembled form.
92 <a name="step"><h3>s,step</h3></a>
94 Step command. It executes one instruction without effect of
98 $ <font color="#118811">s51 remoansi.hex</font>
99 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
100 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
101 This is free software, and you are welcome to redistribute it
102 under certain conditions; type `show c' for details.
103 58659 bytes read from remoansi.hex
104 > <font color="#118811">s</font>
105 000000 00 00 00 00 00 00 00 00 ........
106 000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 .
107 000000 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
108 000160 c2 90 CLR P1.0
111 After execution of actual instruction pointed by PC the <b>step</b>
112 command dumps out the register set.
117 <a name="n"><h3>n,next</h3></a>
119 Execute until next instruction is reached. This command is similar to
120 <a href="#s"><b>step</b></a> command described above but if actual
121 instruction to execute is a subroutine call the <b>next</b> command
122 places a dynamic breakpoint after the call instruction and starts to
123 execute the subroutine. If the subroutine is infinite the breakpoint
124 set by <b>next</b> will never reached. It can be a dangerous situation
125 because the executeion started by the <b>next</b> command can not be
126 stopped interactively. But it can be stopped by other breakpoints.
129 $ <font color="#118811">s51 remoansi.hex</font>
130 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
131 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
132 This is free software, and you are welcome to redistribute it
133 under certain conditions; type `show c' for details.
134 58659 bytes read from remoansi.hex
135 > <font color="#118811">run 0 0x172</font>
136 000172 79 04 MOV R1,#04
137 > <font color="#118811">dis 0x172 0 5</font>
138 000170 7f 00 MOV R7,#00
139 000172 79 04 MOV R1,#04
140 000174 12 0d b8 LCALL 0db8
142 000178 d9 fa DJNZ R1,0174
143 00017a 75 0b 00 MOV 0b,#00
144 > <font color="#118811">n</font>
145 000000 00 04 00 00 00 00 00 00 ........
146 000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0000 @DPTR= 0x00 0 .
147 000004 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
148 000174 12 0d b8 LCALL 0db8
149 > <font color="#118811">n</font>
150 000000 00 04 00 00 00 00 00 00 ........
151 000000 00 . ACC= 0x00 0 . B= 0x00 DPTR= 0x0167 @DPTR= 0x00 0 .
152 000004 00 . PSW= 0x00 CY=0 AC=0 OV=0 P=0
159 <a name="pc"><h3>pc [address]</h3></a>
161 Using this command without any parameter it simply dumps out
162 instruction pointed by the PC. Specify address if you want to set the
167 S51 0.1.5, Copyright (C) 1997 Daniel Drotos, Talker Bt.
168 S51 comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
169 This is free software, and you are welcome to redistribute it
170 under certain conditions; type `show c' for details.
171 > <font color="#118811">pc</font>
173 > <font color="#118811">pc 123</font>
175 > <font color="#118811">sopt debug t </font>
176 > <font color="#118811">pc 32</font>
177 Warning: maybe not instruction at 000020