Set commands

Set commands can be used to set value of memory cells, bits, or port pins. Those commands that set value of memory interpret their command lines a litle bit different than other commands. First parameter is always the start address of the memory area which is being set. This parameter is followed by a list of data parameters. Data can be specified by a number. Numbers must begin with a digit. Each number specifies one byte of data. If the parameter begins with a non-digit character, it is interpreted as string of characters and this kind of parameter specifies as many bytes as many characters the string has. Strings can contain escape sequencies (see description of wi command where escape sequencies are discussed) but they can not contain spaces because space characters (space, tabulator and vertical tabulator) separates parameters. Spaces can be specified as escape sequences or separated number parameters if needed. Only space characters separate data parameters while normaly comma (,) and semicolon (;) are interpreted as separator characters too.

si addr data...

Write data into internal RAM area. First parameter specifies start address of memory area to set and other parameters are data to set.
$ s51
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.
> si 10 dani\040hej-ho
00000a 64 61 6e 69 20 68 65 6a 2d 68 6f                dani hej-ho
> 
Result of the command is a memory dump of area which has been modified by the command. If there is syntax error in a data parameter then remaining parameters are dropped out.
> si 20 1 2 0xi 3 4
Bad data 0xi
000014 01 02                                           ..
> 

sx addr data...

This command is similar to si command described above but it is used to modify external RAM.

sc addr data...

This command is similar to si command described above but it is used to modify code memory area (ROM).

ss addr data...

This command is similar to si command described above but it is used to modify SFR. Other difference is that first parameter (start address) can be specified by name of SFR not by address only.
$ s51
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.
> ss p1 0
000090 00                                              .
> 

sb addr data...

Modify bit(s). First parameter is address of first bit to modify. See description of db command how bit address can be specified. If first character of data parameter is 0 it means zero otherwise it means one.
$ s51
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.
> sb 0x23.5 1
> db 0x23.5
000023   23.5 1
> sb p3.3 0
> dp
P0    11111111 0xff 255 .    P1    11111111 0xff 255 .
Pin0  11111111 0xff 255 .    Pin1  11111111 0xff 255 .
Port0 11111111 0xff 255 .    Port1 11111111 0xff 255 .

P2    11111111 0xff 255 .    P3    11110111 0xf7 247 .
Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
Port2 11111111 0xff 255 .    Port3 11110111 0xf7 247 .
> sb tr1 0
> db tr1
000088    TR1 0
> sb tr1 1
> db tr1
000088    TR1 1
> 

sp port data

This command can be used to sep up output values of external circuits connected to port pins. If a port bit is used as output to drive external circuits, do not set corresponding pin bit to zero because read back value of the port can be false. First parameter must be number of the port between 0 and 3.
$ s51
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.
> dp
P0    11111111 0xff 255 .    P1    11111111 0xff 255 .
Pin0  11111111 0xff 255 .    Pin1  11111111 0xff 255 .
Port0 11111111 0xff 255 .    Port1 11111111 0xff 255 .

P2    11111111 0xff 255 .    P3    11111111 0xff 255 .
Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
Port2 11111111 0xff 255 .    Port3 11111111 0xff 255 .
> ss p1 0x55
000090 55                                              U
> sp 1 0x0f
> dp
P0    11111111 0xff 255 .    P1    01010101 0x55  85 U
Pin0  11111111 0xff 255 .    Pin1  00001111 0x0f  15 .
Port0 11111111 0xff 255 .    Port1 00000101 0x05   5 .

P2    11111111 0xff 255 .    P3    11111111 0xff 255 .
Pin2  11111111 0xff 255 .    Pin3  11111111 0xff 255 .
Port2 11111111 0xff 255 .    Port3 11111111 0xff 255 .
> 

fi start stop data

Fill command. It can be used to fill up an area of internal RAM with a specified data.
$ s51
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.
> fi 11 0x34 44
> di
000000 00 00 00 00 00 00 00 00 ........
000008 00 00 00 2c 2c 2c 2c 2c ...,,,,,
000010 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
000018 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
000020 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
000028 2c 2c 2c 2c 2c 2c 2c 2c ,,,,,,,,
000030 2c 2c 2c 2c 2c 00 00 00 ,,,,,...
000038 00 00 00 00 00 00 00 00 ........
000040 00 00 00 00 00 00 00 00 ........
000048 00 00 00 00 00 00 00 00 ........
> 

fx start stop data

Fill command. It works similar to fi but it puts data into external RAM instead of internal RAM.

fs start stop data

Fill command. It works similar to fi but it puts data into SFR instead of internal RAM.

fc start stop data

Fill command. It works similar to fi but it puts data into code memory (ROM) instead of internal RAM.