Displays the values of one or more variables or expressions.
[where (expression)] display[/radix] expression [, expression ...] [pset set_name | set_definition]
Use the display command to display the value(s) of the specified variable(s) or expression(s). The display command prints the values immediately and creates a display event, so that the values are updated automatically each time the program stops execution.
The optional where expression provides a mask for the elements of the parallel variable or array being displayed. The mask can be any expression that evaluates to true or false for each element of the variable or array. Elements whose values evaluate to true are considered active; elements whose values evaluate to false are considered inactive. If values are displayed in the command window, values of inactive elements are not printed. If values are displayed graphically, the treatment of inactive elements depends on the type of representation you choose.
The optional /radix syntax specifies the radix to be used in displaying the value(s). Possible settings of /radix are described in Table 1-5.
Table 1-5 Radix Settings
Symbol |
Radix |
---|---|
/b |
Binary |
/d |
Decimal |
/x |
Hexadecimal |
/o |
Octal |
The default radix setting is decimal, unless you have overridden the default via the set $radix command.
Redirection of output to a window via the on window syntax works slightly differently for display (and print) from the way it works for other commands.
If you don't send output to the command window (the default), separate windows are created for each variable or expression that you display.
Thus, the commands
display x on dedicated display y on dedicated
create two dedicated windows, one for each variable; the two windows are updated separately.
Displaying to a window other than the command window creates a visualizer for the data.
To display the contents of a register, precede the name of the register with a dollar sign. For example,
display $pc on dedicated
displays the contents of the program counter register.
Supported UltraSPARC registers are listed below.
Table 1-6 UltraSPARC Registers
Name |
Register |
---|---|
$g0-$g7 |
Global registers (64 bits) |
$o0-$o7 |
Output registers (64 bits) |
$l0-$l7 |
Local registers |
$i0-$i7 |
Input registers |
$psr |
Processor state register |
$pc |
Program counter |
$npc |
Next program counter |
$y |
Y register |
$wim |
Window invalid mask |
$tbr |
Trap base register |
$f0-$f31 |
Floating-point registers, printable only as floats |
$fsr |
Floating status register (64 bits) |
$f0f1-$f62f63 |
Floating-point registers, printable only as doubles |
$xg0-$xg7 |
Upper 32 bits of $g0-$g7 (SPARC V8 plus only, or higher) |
$xo0-$xo7 |
Upper 32 bits of $o0-$o7 (SPARC V8 plus only, or higher) |
$xfsr |
Upper 32 bits of $fsr (SPARC V8 plus only, or higher) |
$fprs |
Floating-point registers state (SPARC V8 plus only, or higher) |
$tstate |
Trap state register (SPARC V8 plus only, or higher) |
$fp |
Frame pointer (synonym for $i6) |
$sp |
Stack pointer (synonym for $o6) |
When issued in MP Prism, this command can take a pset qualifier. If used with a qualifier, it applies to the pset you specify. If used without a qualifier, it applies to the current pset. See " Using Pset Qualifiers" for more information on pset qualifiers.
display sum(foo)
displays the sum of the elements of the array foo.
where (foo .ne. 0) display foo on dedicated
displays (in a dedicated window) the values of foo that are not equal to 0.