]> git.gag.com Git - fw/sdcc/blob - sim/ucsim/doc/cmd_set.html
ucsim-0.2.37-pre3 into cvs
[fw/sdcc] / sim / ucsim / doc / cmd_set.html
1 <html>
2 <head>
3 <title>Set commands of uCsim</title>
4 </head>
5
6 <body bgcolor="white">
7
8                                                                   <!-- SET -->
9
10 <h2>Set commands</h2>
11
12 Set commands can be used to set value of memory cells, bits, or port
13 pins. Those commands that set value of memory interpret their command
14 lines a litle bit different than other commands. First parameter is
15 always the start address of the memory area which is being set. This
16 parameter is followed by a list of data parameters. Data can be
17 specified by a number. Numbers must begin with a digit. Each number
18 specifies one byte of data. If the parameter begins with a non-digit
19 character, it is interpreted as string of characters and this kind of
20 parameter specifies as many bytes as many characters the string
21 has. Strings can contain escape sequencies (see description of <a
22 href="cmd_general.html#wi"><b>wi</b></a> command where escape
23 sequencies are discussed) but they can not contain spaces because
24 space characters (space, tabulator and vertical tabulator) separates
25 parameters. Spaces can be specified as escape sequences or separated
26 number parameters if needed. Only space characters separate data
27 parameters while normaly comma (<tt>,</tt>) and semicolon (<tt>;</tt>)
28 are interpreted as separator characters too.
29
30 <a name="si"><h3>si addr data...</h3></a>
31
32 Write data into internal RAM area. First parameter specifies start
33 address of memory area to set and other parameters are data to set.
34
35 <pre>
36 $ <font color="#118811">s51</font>
37 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
38 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
39 This is free software, and you are welcome to redistribute it
40 under certain conditions; type `show c' for details.
41 > <font color="#118811">si 10 dani\040hej-ho</font>
42 00000a 64 61 6e 69 20 68 65 6a 2d 68 6f                dani hej-ho
43 > </pre>
44
45 Result of the command is a memory dump of area which has been modified
46 by the command. If there is syntax error in a data parameter then
47 remaining parameters are dropped out.
48
49 <pre>
50 > <font color="#118811">si 20 1 2 0xi 3 4</font>
51 Bad data 0xi
52 000014 01 02                                           ..
53 > </pre>
54
55
56 <a name="sx"><h3>sx addr data...</h3></a>
57
58 This command is similar to <a href="#si"><b>si</b></a> command
59 described above but it is used to modify external RAM.
60
61
62 <a name="sc"><h3>sc addr data...</h3></a>
63
64 This command is similar to <a href="#si"><b>si</b></a> command
65 described above but it is used to modify code memory area (ROM).
66
67
68 <a name="ss"><h3>ss addr data...</h3></a>
69
70 This command is similar to <a href="#si"><b>si</b></a> command
71 described above but it is used to modify SFR. Other difference is that
72 first parameter (<b>start</b> address) can be specified by name of SFR
73 not by address only.
74
75 <pre>
76 $ <font color="#118811">s51</font>
77 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
78 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
79 This is free software, and you are welcome to redistribute it
80 under certain conditions; type `show c' for details.
81 > <font color="#118811">ss p1 0</font>
82 000090 00                                              .
83 > </pre>
84
85
86 <a name="sb"><h3>sb addr data...</h3></a>
87
88 Modify bit(s). First parameter is address of first bit to modify. See
89 description of <a href="#db"><b>db</b></a> command how bit address can
90 be specified. If first character of data parameter is <tt>0</tt> it
91 means <i>zero</i> otherwise it means <i>one</i>.
92
93 <pre>
94 $ <font color="#118811">s51</font>
95 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
96 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
97 This is free software, and you are welcome to redistribute it
98 under certain conditions; type `show c' for details.
99 > <font color="#118811">sb 0x23.5 1</font>
100 > <font color="#118811">db 0x23.5</font>
101 000023   23.5 1
102 > <font color="#118811">sb p3.3 0</font>
103 > <font color="#118811">dp</font>
104 P0    11111111 0xff 255 .    P1    11111111 0xff 255 .
105 Pin0  11111111 0xff 255 .    Pin1  11111111 0xff 255 .
106 Port0 11111111 0xff 255 .    Port1 11111111 0xff 255 .
107
108 P2    11111111 0xff 255 .    P3    11110111 0xf7 247 .
109 Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
110 Port2 11111111 0xff 255 .    Port3 11110111 0xf7 247 .
111 > <font color="#118811">sb tr1 0</font>
112 > <font color="#118811">db tr1</font>
113 000088    TR1 0
114 > <font color="#118811">sb tr1 1</font>
115 > <font color="#118811">db tr1</font>
116 000088    TR1 1
117 > </pre>
118
119
120 <a name="sp"><h3>sp port data</h3></a>
121
122 This command can be used to sep up output values of external circuits
123 connected to port pins. If a port bit is used as output to drive
124 external circuits, do not set corresponding pin bit to zero because
125 read back value of the port can be false. First parameter must be
126 number of the port between 0 and 3.
127
128 <pre>
129 $ <font color="#118811">s51</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 > <font color="#118811">dp</font>
135 P0    11111111 0xff 255 .    P1    11111111 0xff 255 .
136 Pin0  11111111 0xff 255 .    Pin1  11111111 0xff 255 .
137 Port0 11111111 0xff 255 .    Port1 11111111 0xff 255 .
138
139 P2    11111111 0xff 255 .    P3    11111111 0xff 255 .
140 Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
141 Port2 11111111 0xff 255 .    Port3 11111111 0xff 255 .
142 > <font color="#118811">ss p1 0x55</font>
143 000090 55                                              U
144 > <font color="#118811">sp 1 0x0f</font>
145 > <font color="#118811">dp</font>
146 P0    11111111 0xff 255 .    P1    01010101 0x55  85 U
147 Pin0  11111111 0xff 255 .    Pin1  00001111 0x0f  15 .
148 Port0 11111111 0xff 255 .    Port1 00000101 0x05   5 .
149
150 P2    11111111 0xff 255 .    P3    11111111 0xff 255 .
151 Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
152 Port2 11111111 0xff 255 .    Port3 11111111 0xff 255 .
153 > </pre>
154
155
156 <a name="fi"><h3>fi start stop data</h3></a>
157
158 Fill command. It can be used to fill up an area of internal RAM with a
159 specified data.
160
161 <pre>
162 $ <font color="#118811">s51</font>
163 ucsim 0.2.12, Copyright (C) 1997 Daniel Drotos, Talker Bt.
164 ucsim comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
165 This is free software, and you are welcome to redistribute it
166 under certain conditions; type `show c' for details.
167 > <font color="#118811">fi 11 0x34 44</font>
168 > <font color="#118811">di</font>
169 000000 00 00 00 00 00 00 00 00 ........
170 000008 00 00 00 2c 2c 2c 2c 2c ...,,,,,
171 000010 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
172 000018 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
173 000020 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
174 000028 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
175 000030 2c 2c 2c 2c 2c 00 00 00 ,,,,,...
176 000038 00 00 00 00 00 00 00 00 ........
177 000040 00 00 00 00 00 00 00 00 ........
178 000048 00 00 00 00 00 00 00 00 ........
179 > </pre>
180
181
182 <a name="fx"><h3>fx start stop data</h3></a>
183
184 Fill command. It works similar to <a href="#fi"><b>fi</b></a> but it
185 puts data into external RAM instead of internal RAM.
186
187
188 <a name="fs"><h3>fs start stop data</h3></a>
189
190 Fill command. It works similar to <a href="#fi"><b>fi</b></a> but it
191 puts data into SFR instead of internal RAM.
192
193
194 <a name="fc"><h3>fc start stop data</h3></a>
195
196 Fill command. It works similar to <a href="#fi"><b>fi</b></a> but it
197 puts data into code memory (ROM) instead of internal RAM.
198
199
200 <hr>
201
202 </body>
203 </html>