To display the contents of an address, specify the address on the command line, followed by a slash (/). For example,
0x10000/
If you specify the address as a period, Prism displays the contents of the memory address following the one printed most recently.
Specify a symbolic address by preceding the name with an &. For example,
&x/
prints the contents of memory for variable x. The Prism output, for example, might be
0x000237f8: 0x3f800000
The address you specify can be an expression made up of other addresses and the operators +, -, and indirection (unary *). For example,
0x1000+100/
prints the contents of the location 100 addresses above address 0x1000.
After the slash you can specify how memory is to be displayed. Formats that are supported are listed in Table 4-1.
Table 4-1 Memory Address Formats
Format |
Description |
---|---|
d |
Print a short word in decimal |
D |
Print a long word in decimal |
o |
Print a short word in octal |
O |
Print a long word in octal |
x |
Print a short word in hexadecimal |
X |
Print a long word in hexadecimal |
b |
Print a byte in octal |
c |
Print a byte as a character |
s |
Print a string of characters terminated by a null byte |
f |
Print a single-precision real number |
F |
Print a double-precision real number |
i |
Print the machine instruction |
The initial format is X. If you omit the format in your command, you get either X (if you haven't previously specified a format) or the format you specified previously.
You can print the contents of multiple addresses by specifying a number after the slash (and before the format). For example,
0x1000/8X
displays the contents of eight memory locations starting at address 0x1000. Contents are displayed as hexadecimal long words.