Prints the values of one or more variables or expressions.
[where (expression)] print[/radix] expression [, expression ...] [pset set_name | set_definition]
Use the print command to print the values of the specified variable(s) or expression(s).
The optional where expression provides a mask for the elements of the parallel variable or array being printed. 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 printed in the command window, values of inactive elements are not printed. If values are printed 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 printing the value(s). Possible settings of /radix are
Table 1-7 Radix Settings
Symbol |
Radix |
---|---|
/b |
Binary |
/d |
Decimal |
/x |
Hexadecimal |
/o |
Octal |
described in Table 1-7.
The default radix 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 print (and display) 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 print. Thus, the commands
print x on dedicated print y on dedicated
create two dedicated windows, one for each variable; the two windows are updated separately.
Printing to a window other than the command window creates a visualizer for the data.
To print the contents of a register, precede the name of the register with a dollar sign. For example,
print $pc on dedicated
prints the contents of the program counter register.
Supported UltraSPARC registers are listed in the following table.
Table 1-8 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) |
You can use the default alias p for the print command.
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.
print maxval(a)
prints the maximum value of the array a.
where (a > 3) print a on dedicated
prints (in a dedicated window) the values of a that are greater than 3.