Dump commands of µCsim

dump [/format] memory_type [start [end [bytes_per_line]]]
dump bit...

The first form can be used to get the contents of memory while the second form can be used to check the value of one or more bits.

dump [/format] memory_name [start [end [bytes_per_line]]]

Dump a memory region.

The optional /format specifies how memory is dumped.

/b - binary
Dumps raw binary data. The output must be redirected to a file.
/h, /x - hexadecimal
Dumps data in a tabular hexadecimal format with an accompanying table of equivalent characters to the right.
/i - ihex
Dumps data in ihex format.
/s - string
Dumps a single, null terminated string starting at start.
If no format is given dump uses a "smart" mode. It is similar to the hexadecimal format except that where labels (vars that name an address) are found they are shown between the address and data and where HW registers (vars that name an address AND specify the full bit range) are found that address is shown on a line of its own and the data is given as binary, character, hex, unsigned decimal and, if the high bit is set, signed decimal. Note that smart mode only applies if memory_name is an address space since vars can only be set for cells within an address space. If memory_name is a chip the output is the same as hexadecimal (/h) output.

memory_name specifies memory. It can be the name of an address space or a chip, and can be checked using info memory command which lists size and name of all available memories.

start and end parameters can be used to specify the first and last address of the dumped region. If end is omitted then 64 memory locations are dumped. If both start and end are omitted then the next 64 memory locations will be dumped out. Every time when dump command is used the address of the last dumped memory location is stored and next dump command automatically continues at the next address.

bytes_per_line can be used to specify how many memory locations should be dumped out in one line. It is 8 by default.

$ ucsim_51
uCsim 0.9.9, 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> dump regs
0x0 R0:                  0b01000001 0x41 'A'  65
0x1 R1:                  0b01011000 0x58 'X'  88
0x2 R2:                  0b11111100 0xfc '.' 252 ( -4)
0x3 R3:                  0b11001001 0xc9 '.' 201 (-55)
0x4 R4:                  0b10001011 0x8b '.' 139 (-117)
0x5 R5:                  0b10111100 0xbc '.' 188 (-68)
0x6 R6:                  0b10010101 0x95 '.' 149 (-107)
0x7 R7:                  0b01101011 0x6b 'k' 107
0> dump /x rom 0 0x1f
0x0000 ff ff ff ff ff ff ff ff ........
0x0008 ff ff ff ff ff ff ff ff ........
0x0010 ff ff ff ff ff ff ff ff ........
0x0018 ff ff ff ff ff ff ff ff ........
0> dump rom 0 5
0x0000    ff       MOV    R7,A
0x0001    ff       MOV    R7,A
0x0002    ff       MOV    R7,A
0x0003    ff       MOV    R7,A
0x0004    ff       MOV    R7,A
0x0005    ff       MOV    R7,A
0> var label1 rom 0x0016
0> var reg1 rom[0x0020][7:0]
0> var reg2 rom[0x0021][7:0]
0> dump rom 0x15 0x24
0x0015    ff       MOV    R7,A

0x0016    <label1>:
0x0016    ff       MOV    R7,A
0x0017    ff       MOV    R7,A
0x0018    ff       MOV    R7,A
0x0019    ff       MOV    R7,A
0x001a    ff       MOV    R7,A
0x001b    ff       MOV    R7,A
0x001c    ff       MOV    R7,A
0x001d    ff       MOV    R7,A
0x001e    ff       MOV    R7,A
0x001f    ff       MOV    R7,A

0x0020    <reg1>:
0x0020    ff       MOV    R7,A

0x0021    <reg2>:
0x0021    ff       MOV    R7,A
0x0022    ff       MOV    R7,A
0x0023    ff       MOV    R7,A
0x0024    ff       MOV    R7,A
0> dump /x rom 0x15 0x24
0x0015 ff ff ff ff ff ff ff ff ........
0x001d ff ff ff ff ff ff ff ff ........
0> 
$ ucsim_51
uCsim 0.9.9, 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> load "remo.hex"
Loading from remo.hex
55755 words read from remo.hex
0> step 1 sec

Stop at 0x004364: (104) Breakpoint
     R0 R1 R2 R3 R4 R5 R6 R7
     0c 01 0b 8f 00 86 0c 00
@R0 00 .  ACC= 0x00   0 .  B= 0x00
@R1 01 .  PSW= 0xc0 CY=1 AC=1 OV=0 P=0
SP 0x26 -> 2a ae 02 2d 3e 37 bc 00
   DPTR= 0x000e @DPTR= 0x00   0 .
0x4364    70 51    JNZ    0x43b7
F 0x004364
Simulated 11059212 ticks (1.000e+00 sec)
Host usage: 0.135016 sec, rate=7.406540
0> du /x rom 20
0x0014 00 ac ff ff ff ff ff ff ........
0x001c ff ff ff ff ff ff ff 02 ........
0x0024 01 1c ff ff ff ff ff 32 .......2
0x002c ff ff ff ff 02 0f a7 02 ........
0x0034 0e 9c 02 0d d2 02 08 41 .......A
0x003c c0 82 c0 83 c0 d0 c0 e0 ........
0x0044 c0 00 a2 90 c0 d0 c2 90 ........
0x004c 78 18 06 30 03 4b 20 92 x..0.K .
0x0054 48                      H
0> du xram 10 20 10
0x000a                      02 00 08 00 00 01 40 01 01 44 ......@..D
0x0014                      01                            .
0> du xram
0x0015                      00 00 00 00 00 00 00 00 ........
0x001d                      00 10 01 00 ae 01 00 ae ........
0x0025                      02 12 e1 00 5a 85 00 01 ....Z...
0x002d                      00 3b 00 00 5a 85 00 ab .;..Z...
0x0035                      1f 80 00 00 01 00 01 00 ........
0x003d                      fa 0c 02 01 00 fa 00 08 ........
0x0045                      00 01 00 ab 00 00 00 00 ........
0x004d                      00 00 5a 85 ff 00 01 00 ..Z.....
0x0055                      00 00 00 94 a7 01 0c a6 ........
0x005d                      00 6f ff 78 85 7f 08 b9 .o.x....
0> 

dump bit_name...

This command can be used to print out values of bit(s). Any form of bit address can be used as parameter:
0> dump AC P1.2 0x21
0xd6      AC:                       0b0 0x00 '.'   0
0x90.2                              0b-----1-- 0x01 '.'   1
0x24.1                              0b------1- 0x01 '.'   1
0> 

dch [start [stop]]

Hexadecimal dump of code memory area from address start to address stop. Default value of start address is address of following memory cell which was dumped by previous dch command. If stop parameter is not given dch command lists 10 lines 8 bytes per line.
$ ucsim_51
uCsim 0.9.9, 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> load "remo.hex"
Loading from remo.hex
55755 words read from remo.hex
0> where rom "remo"
0x13da 52 65 6d 6f Remo
0> dch 0x13da
0x13da 52 65 6d 6f 20 00 56 65 Remo .Ve
0x13e2 72 73 69 6f 6e 20 31 2e rsion 1.
0x13ea 30 20 00 43 6f 70 79 72 0 .Copyr
0x13f2 69 67 68 74 20 28 63 29 ight (c)
0x13fa 20 00 31 39 39 34 2c 39  .1994,9
0x1402 35 20 00 54 61 6c 6b 65 5 .Talke
0x140a 72 20 42 74 2e 00 53 75 r Bt..Su
0x1412 6e 64 61 79 2e 00 4d 6f nday..Mo
0x141a 6e                      n
0> 
First element in every lines is address of first byte dumped out in the line. Next elements are hexadecimal values of bytes followed by ASCII characters of bytes dumped out in the line. If value of the memory cell is not printable than a dot is dumped out.

dc [start [stop]]

Disassembled dump of code memory area. This command simply produces disassembled list of memory area specified by the parameters. Default value of start parameter is last address listed by previous dc command. If stop parameter is not given 20 lines are listed.
$ ucsim_51
uCsim 0.9.9, 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> load "remo.hex"
Loading from remo.hex
55755 words read from remo.hex
0> dc
0x0000    02 01 60 LJMP   0x0160
0x0003    02 00 3c LJMP   0x003c
0x0006    ff       MOV    R7,A
0x0007    ff       MOV    R7,A
0x0008    ff       MOV    R7,A
0x0009    ff       MOV    R7,A
0x000a    ff       MOV    R7,A
0x000b    02 2f 74 LJMP   0x2f74
0x000e    ff       MOV    R7,A
0x000f    ff       MOV    R7,A
0x0010    ff       MOV    R7,A
0x0011    ff       MOV    R7,A
0x0012    ff       MOV    R7,A
0x0013    02 00 ac LJMP   0x00ac
0> 

di [start [stop]]

Hexadecimal dump of iram named address space area from address start to address stop. Default value of start address is address of following memory cell which was dumped by previous di command. If stop parameter is not given di command lists 10 lines 8 bytes per line.
$ ucsim_51
uCsim 0.9.9, 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> load "remo.hex"
Loading from remo.hex
55755 words read from remo.hex
0> set opt irq_stop 1
0> step 1 sec

Stop at 0x000023: (2) Interrupt
F 0x000023
Simulated 3056952 ticks (2.764e-01 sec)
Host usage: 0.031058 sec, rate=8.900008
0> di
0x00 18 02 13 1e 00 02 00 0a ........
0x08 00 00 00 00 00 00 00 00 ........
0x10 00 00 00 00 00 00 00 00 ........
0x18 4a 00 00 00 00 00 00 00 J.......
0x20 bc 27 06 2d 02 81 29 22 .'.-..)"
0x28 25 80 36 01 0a 01 08 00 %.6.....
0x30 2d 08 73 2e 73 c7 72 04 -.s.s.r.
0x38 bf 03 09 00 00 00 f0 04 ........
0x40 f0 04 3b 35 ae 9f 35 7c ..;5..5|
0x48 28 75 4f b8 c9 4f 96 42 (uO..O.B
0> 
This command is MCS51 specific and is not available in other simulators.
$ ucsim_p1516
uCsim 0.9.9, 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> di
Parser error: syntax error
0
0> 

dx [start [stop]]

MCS51 specific command to produce hexadecimal dump of xram named address space area from address start to address stop. Default value of start address is address of following memory cell which was dumped by previous dx command. If stop parameter is not given dx command lists 10 lines 8 bytes per line.
$ ucsim_51
uCsim 0.9.9, 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> load "remo.hex"
Loading from remo.hex
55755 words read from remo.hex
0> step 1 sec

Stop at 0x004364: (104) Breakpoint
     R0 R1 R2 R3 R4 R5 R6 R7
     0c 01 0b 8f 00 86 0c 00
@R0 00 .  ACC= 0x00   0 .  B= 0x00
@R1 01 .  PSW= 0xc0 CY=1 AC=1 OV=0 P=0
SP 0x26 -> 2a ae 02 2d 3e 37 bc 00
   DPTR= 0x000e @DPTR= 0x00   0 .
0x4364    70 51    JNZ    0x43b7
F 0x004364
Simulated 11059212 ticks (1.000e+00 sec)
Host usage: 0.136359 sec, rate=7.333592
0> dx
0x0000 83 44 01 00 c0 7e 13 9d .D...~..
0x0008 e6 ff 02 00 08 00 00 01 ........
0x0010 40 01 01 44 01 00 00 00 @..D....
0x0018 00 00 00 00 00 00 10 01 ........
0x0020 00 ae 01 00 ae 02 12 e1 ........
0x0028 00 5a 85 00 01 00 3b 00 .Z....;.
0x0030 00 5a 85 00 ab 1f 80 00 .Z......
0x0038 00 01 00 01 00 fa 0c 02 ........
0x0040 01 00 fa 00 08 00 01 00 ........
0x0048 ab 00 00 00 00 00 00 5a .......Z
0> 

ds [start [stop]]

Hexadecimal dump of sfr named address space area from address start to address stop. Default value of start address is address of following memory cell which was dumped by previous ds command. If stop parameter is not given ds command lists 10 lines 8 bytes per line.

This command is available in MCS51 simulator only.

$ ucsim_51
uCsim 0.9.9, 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> load "remo.hex"
Loading from remo.hex
55755 words read from remo.hex
0> set opt irq_stop 1
0> run
Simulation started, PC=0x000000

Stop at 0x000023: (2) Interrupt
F 0x000023
Simulated 3056952 ticks (2.764e-01 sec)
Host usage: 0.030704 sec, rate=9.002635
0> ds
0x80 ff 2a 1e 13 00 00 00 80 .*......
0x88 d5 21 f7 fd 50 fd 00 00 .!..P...
0x90 fe 00 00 00 00 00 00 00 ........
0x98 7e 00 00 00 00 00 00 00 ~.......
0xa0 ff 00 00 00 00 00 00 00 ........
0xa8 97 00 00 00 00 00 00 00 ........
0xb0 ff 00 00 00 00 00 00 00 ........
0xb8 15 00 00 00 00 00 00 00 ........
0xc0 00 00 00 00 00 00 00 00 ........
0xc8 00 00 00 00 00 00 00 00 ........
0>