1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287
|
<html>
<head>
<meta content="text/html; charset=ISO-8859-2" http-equiv="content-type">
<title>Memory manipulation commands of μCsim</title>
</head>
<body bgcolor="white">
<h2>Memory manipulation commands of μCsim</h2>
Every command which changes content of ROM area such as <b><a href="#dl">dl</a></b>
or <b><a href="cmd_general#set_memory">set
memory</a></b> deletes result of <a href="analyzer.html">code
analyser</a> and causes to re-analyse the code.
<hr>
<a name="file">
<h3>file,load <i>"FILE"</i></h3>
</a>
Loads file named FILE into the simulated code memory. File must
contain data in Intel HEX format.
<pre>> <font color="#118811">file "../../remo.hex"</font>
55470 words read from ../../remo.hex
>
</pre>
Don't forget to enclose file name in quotes to make the parameter to
be a string.
<hr>
<a name="dl">
<h3>download,dl</h3>
</a>
Download command. It is same as <a href="#l">load</a> above but it
reads information from command console which is standard input by
default. This command stops read records when it detects an "END"
record which is normally the last record. This command has two
equivalent forms <b>download</b> and <b>dl</b>.
<pre>$ <font color="#118811">s51 -V</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.
> <font color="#118811">do
:03000000020003F8
:1000030075812078207600D8FC900000AE83AF8203
:100013009000001200416005E4F0A380F690009F79
:1000230012004A9000A312004A9000A712006890A1
:1000330000AD12006875D0001200B50200B3EF6581
:10004300827003EE658322E493F8740193F97402DA
:1000530093FE740393F5828E83E869700122E4931F
:10006300F6A30880F4E493FC740193FD740293FEF9
:10007300740393FF740493F8740593F582888312D1
:100083000041700122E493A3A883A9828C838D820B
:10009300F0A3AC83AD828883898280E3212100B5FC
:1000A300212100B5000000B500B5000000B500B582
:0200B30080FECD
:1000B5007520117501AA850120750102850120228F
:00000001FF</font>
197 bytes loaded
> </pre>
<hr>
<a name="fill">
<h3>fill <i>memory_type start end data</i></h3>
</a>
Fill memory region with specified data. First parameter specifies
memory. Name of the memory must be used, it can be checked using <a href="cmd_general.html#info_memory">info
memory</a> command which
lists size and name of all available memories.
<p><b>start</b> and <b>end</b> parameters specify first and last
address of the memory region to be filled.
</p>
<p><b>data</b> parameter specifies the data which is used to fill the
memory region.
</p>
<pre>$ <font color="#118811">s51</font>
ucsim 0.2.38-pre2, 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">fill xram 12 0x12 0x56</font>
> <font color="#118811">dump xram 0 0x20</font>
0x0000 00 00 00 00 00 00 00 00 ........
0x0008 00 00 00 00 56 56 56 56 ....VVVV
0x0010 56 56 56 00 00 00 00 00 VVV.....
0x0018 00 00 00 00 00 00 00 00 ........
0x0020 00 .
> </pre>
<hr>
<a name="where">
<h3>where,Where <i>memory_type data...</i></h3>
</a>
Searching for some data in memory. First parameter specifies
memory. Name of the memory must be used, it can be checked using <a href="cmd_general.html#info_memory">info
memory</a> command which
lists size and name of all available memories.
<p>Other parameters can be mixed list of strings (characters between "
and ") and numbers. Strings can contain escape sequencies. μCsim
merges all parameters together and will search for merged list of
values in specified memory.
</p>
<p><b>where</b> command do case unsensitive search while <b>Where</b>
command is for case sensitive search.
</p>
<p>Search is done in whole memory and all matches are dumped out.
</p>
<pre>$ <font color="#118811">s51</font>
ucsim 0.2.38-pre2, 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">set mem xram 20 "Dani d ani D ani dani Dani"</font>
0x0014 44 61 6e 69 20 64 20 61 Dani d a
0x001c 6e 69 20 44 20 61 6e 69 ni D ani
0x0024 20 64 61 6e 69 20 44 61 dani Da
0x002c 6e 69 ni
> <font color="#118811">where xram "dani"</font>
0x0014 44 61 6e 69 Dani
0x0025 64 61 6e 69 dani
0x002a 44 61 6e 69 Dani
> <font color="#118811">Where xram "d ani"</font>
0x0019 64 20 61 6e 69 d ani
> </pre>
<hr>
<a name="hole">
<h3>hole <i>[memory [length [value]]]</i></h3>
</a>
<p>Searching for a memory area where all locations are filled with
value. By default this command searches rom but any memory can be
specified. Areas shorter than specified length (default is 100)
will not be listed. Searched value is 0 (zero) by default but
other can be sepcified as the last patrameter.
</p>
<pre>$ <font color="#118811">s51</font>
uCsim 0.6-pre55, Copyright (C) 1997 Daniel Drotos.
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.
0> hole
0x0000 65535
0> <font color="#118811">hole xram</font>
0> <font color="#118811">fill xram 0x100 0x1ff 11</font>
0> <font color="#118811">hole xram 50 11</font>
0x0100 255
0> <font color="#118811">fill xram 0x500 0x600 11</font>
0&ht; <font color="#118811">hole xram 50 11</font>
0x0100 255
0x0500 256
0> <font color="#118811">rom[0x200]=1</font>
1
0> <font color="#118811">hole</font>
0x0000 511
0x0201 65022
0> </pre>
<p>
Data of found areas are listed in two columns. First column is
the start address of the area in hexadecimal and the second
column is area lenght (in decimal).
</p>
<hr>
<a name="memory">
<h3>memory</h3>
</a>
This set of commands can be used to manipulate <a href="memory.html">memory
system</a> including <a href="memory.html#chip">chips</a>, <a href="memory.html#address_space">address
spaces</a> and <a href="memory.html#address_decoder">address decoders</a>.
<p>Subcommands are:
</p>
<p>memory <a href="#memory_createchip">createchip</a>
<br>
memory <a href="#memory_createaddressspace">createaddressspace</a>
<br>
memory <a href="#memory_createaddressdecoder">createaddressdecoder</a>
<br>
memory <a href="#memory_info">info</a>
</p>
<blockquote>
<a name="memory_createchip">
<h4>memory createchip|cchip <i>id size
cellsize</i></h4>
</a>
This command creates a chip (array of storage elements). <b>id</b>
must be a unique name which will be used to identify the chip in other
commands. <b>size</b> is number of storage elements, <b>cellsize</b>
is number of bits stored in one element.
<hr>
<a name="memory_createaddressspace">
<h4>memory
createaddressspace|caddressspace|caddrspace|caspace|createaddrspace|createaspace
<i>id startaddr size</i></h4>
</a>
This command should never be used. It defines an address space, names
it as <b>id</b> sets its starting address and size. Simulator programs
(<b>s51</b>, <b>savr</b>, etc.) define necessary address spaces for
themself, so this command is not needed.
<hr>
<a name="memory_createaddressdecoder">
<h4>memory
createaddressdecoder|caddrdecoder|caddressdecoder|cadecoder|createaddrdecoder|createadecoder
<i>addressspace begin end chip begin</i></h4>
</a>
Address decoder maps a part of the address space to a chip
area. <b>addressspace</b> parameter is name of the address space,
<b>begin</b> and <b>end</b> specify address range of the address space
to be mapped. <b>chip</b> parameter is name of the memory chip and
the second <b>begin</b> parameter is the (start of the) chip address
where the area is mapped to.
<p>Address space will be split if a "middle" are is mapped:
</p>
<pre>$ <font color="#118811">s51</font>
uCsim 0.5.0-pre3, 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.
0> <font color="#118811">i m</font>
Memory chips:
0x000000-0x00ffff 65536 rom_chip (8,%02x,0x%04x)
0x000000-0x00007f 128 iram_chip (8,%02x,0x%02x)
0x000000-0x00ffff 65536 xram_chip (8,%02x,0x%04x)
0x000000-0x00007f 128 sfr_chip (8,%02x,0x%02x)
Address spaces:
0x000000-0x00ffff 65536 rom (8,%02x,0x%04x)
0x000000-0x00007f 128 iram (8,%02x,0x%02x)
0x000080-0x0000ff 128 sfr (8,%02x,0x%02x)
0x000000-0x00ffff 65536 xram (8,%02x,0x%04x)
Address decoders:
0 rom 0x0000 0xffff -> rom_chip 0x0000 activated
0 iram 0x00 0x7f -> iram_chip 0x00 activated
0 sfr 0x80 0xff -> sfr_chip 0x00 activated
0 xram 0x0000 0xffff -> xram_chip 0x0000 activated
0> <font color="#118811">mem cchip myram 0x1000 8</font>
0> <font color="#118811">mem createaddressdecoder xram 1234 2000 myram 15</font>
0> <font color="#118811">i m</font>
Memory chips:
0x000000-0x00ffff 65536 rom_chip (8,%02x,0x%04x)
0x000000-0x00007f 128 iram_chip (8,%02x,0x%02x)
0x000000-0x00ffff 65536 xram_chip (8,%02x,0x%04x)
0x000000-0x00007f 128 sfr_chip (8,%02x,0x%02x)
0x000000-0x000fff 4096 myram (8,%02x,0x%03x)
Address spaces:
0x000000-0x00ffff 65536 rom (8,%02x,0x%04x)
0x000000-0x00007f 128 iram (8,%02x,0x%02x)
0x000080-0x0000ff 128 sfr (8,%02x,0x%02x)
0x000000-0x00ffff 65536 xram (8,%02x,0x%04x)
Address decoders:
0 rom 0x0000 0xffff -> rom_chip 0x0000 activated
0 iram 0x00 0x7f -> iram_chip 0x00 activated
0 sfr 0x80 0xff -> sfr_chip 0x00 activated
0 xram 0x0000 0x04d1 -> xram_chip 0x0000 activated
1 xram 0x04d2 0x07d0 -> myram 0x00f activated
2 xram 0x07d1 0xffff -> xram_chip 0x07d1 activated
0>
</pre>
It is easy to share chip area between address spaces:
<pre>$ <font color="#118811">s51</font>
uCsim 0.5.0-pre3, 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.
0> <font color="#118811">mem createaddressdecoder rom 0 0xfff xram_chip 0xf000</font>
0> <font color="#118811">i m</font>
Memory chips:
0x000000-0x00ffff 65536 rom_chip (8,%02x,0x%04x)
0x000000-0x00007f 128 iram_chip (8,%02x,0x%02x)
0x000000-0x00ffff 65536 xram_chip (8,%02x,0x%04x)
0x000000-0x00007f 128 sfr_chip (8,%02x,0x%02x)
Address spaces:
0x000000-0x00ffff 65536 rom (8,%02x,0x%04x)
0x000000-0x00007f 128 iram (8,%02x,0x%02x)
0x000080-0x0000ff 128 sfr (8,%02x,0x%02x)
0x000000-0x00ffff 65536 xram (8,%02x,0x%04x)
Address decoders:
0 rom 0x0000 0x0fff -> xram_chip 0xf000 activated
1 rom 0x1000 0xffff -> rom_chip 0x1000 activated
0 iram 0x00 0x7f -> iram_chip 0x00 activated
0 sfr 0x80 0xff -> sfr_chip 0x00 activated
0 xram 0x0000 0xffff -> xram_chip 0x0000 activated
0> <font color="#118811">rom[0]=0xab</font>
171
0> <font color="#118811">xram[0xf000]</font>
171
0>
</pre>
<hr>
</blockquote>
<a name="memory_info">
<h4>memory info</h4>
</a>
This command is same as <a href="cmd_general.html#info_memory">info
memory</a>.
<hr>
</body>
</html>
|