A P P E N D I X  D

Forth Word Reference

This appendix contains the Forth commands supported by OpenBoot.

The commands are usually listed in the order in which they were introduced in the chapters. Some of the tables in this appendix show commands that are not listed elsewhere in this manual. These additional commands (such as memory mapping or output display primitives, or machine-specific register commands) are also part of the set of words in the OpenBoot implementation of Forth; they are included with relevant groups of commands.

The chapter topics include:


Stack Item Notation
TABLE D-1 Stack Item Notation

Notation

Description

|

Alternate stack results shown with space,
e.g. ( input -- addr len false | result true )

|

Alternate stack items shown without space,
e.g. ( input -- addr len | 0 result ).

???

Unknown stack item(s).

...

Unknown stack item(s). If used on both sides of a stack comment, means the same stack items are present on both sides.

< > <space>

Space delimiter. Leading spaces are ignored.

a-addr

Variable-aligned address.

addr

Memory address (generally a virtual address).

addr len

Address and length for memory region

byte b xxx

8-bit value (low order byte in a 32-bit word).

char

7-bit value (low order byte), high bit unspecified.

cnt len size

Count or length.

dxxx

Double (extended-precision) numbers. 2 stack items, most significant cell on top of stack.

<eol>

End-of-line delimiter.

false

0 (false flag).

n n1 n2 n3

Normal signed values (32-bit).

nu nu1

Signed or unsigned values (32-bit).

<nothing>

Zero stack items.

phys

Physical address (actual hardware address).

phys.lo phys.hi

Lower/upper cell of physical address

pstr

Packed string.

quad qxxx

Quadlet (32-bit value).

qaddr

Quadlet (32-bit) aligned address

{text}

Optional text. Causes default behavior if omitted.

"text<delim>"

Input buffer text, parsed when command is executed. Text delimiter is enclosed in <>.

[text<delim>]

Text immediately following on the same line as the command, parsed immediately. Text delimiter is enclosed in <>.

true

-1 (true flag).

uxxx

Unsigned value, positive values (32-bit).

virt

Virtual address (address used by software).

waddr

Doublet (16-bit) aligned address

word wxxx

Doublet (16-bit value, low order two bytes in a 32-bit word).

x x1

Arbitrary stack item.

x.lo x.hi

Low/high significant bits of a data item

xt

Execution token.

xxx?

Flag. Name indicates usage (e.g. done? ok? error? ).

xyz-str xyz-len

Address and length for unpacked string.

xyz-sys

Control-flow stack items, implementation-dependent.

( C: -- )

Compilation stack diagram.

( -- ) ( E: -- )

Execution stack diagram.

( R: -- )

Return stack diagram.



Commands for Browsing the Device Tree
TABLE D-2 Commands for Browsing the Device Tree

Command

Description

.properties

Displays the names and values of the current node's properties.

dev device-path

Chooses the specified device node, making it the current node.

dev node-name

Searches for a node with the specified name in the subtree below the current node, and chooses the first such node found.

dev ..

Choose the device node that is the parent of the current node.

dev /

Chooses the root machine node.

device-end

Leaves the device tree.

" device-path" find-device

Chooses the specified device node, similar to dev .

ls

Displays the names of the current node's children.

pwd

Displays the device path name that names the current node.

see wordname

Decompiles the specified word.

show-devs [device-path]

Displays all the devices known to the system directly beneath a given device in the device hierarchy. show-devs used by itself shows the entire device tree.

words

Displays the names of the current node's methods.

" device-path" select-dev

Selects the specified device and makes it the active node.



Common Options for the boot Command
TABLE D-3 Common Options for the boot Command

Parameter

Description

boot [ device-specifier ] [ filename ] [ options ]

[ device-specifier ]

The name (full path name or alias) of the boot device. Typical values include:

cdrom (CD-ROM drive)

disk (hard disk)

floppy (3-1/2" diskette drive)

net (Ethernet)

tape (SCSI tape)

[ filename ]

The name of the program to be booted (for example, stand/diag ). filename is relative to the root of the selected device and partition (if specified). If filename is not specified, the boot program uses the value of the boot-file NVRAM parameter (see Chapter 3).

[ options ]

(These options are specific to the operating system, and may differ from system to system.)



System Information Display Commands
TABLE D-4 System Information Display Commands

Command

Description

banner

Displays power-on banner.

.enet-addr

Displays current Ethernet address.

.idprom

Displays ID PROM contents, formatted.

.traps

Displays a list of SPARC trap types.

.version

Displays version and date of the boot PROM.

show-devs

Displays all installed and probed devices.



Configuration Variables
TABLE D-5 Configuration Variables

Command

Description

printenv

Displays all current parameters and current default values.

(Numbers are usually shown as decimal values.)

printenv parameter shows the current value of the named parameter.

setenv parameter value

Sets parameter to the specified decimal or text value.

(Changes are permanent, but usually only take effect after a reset.)

set-default parameter

Resets the value of the named parameter to the factory default.

set-defaults

Resets parameter values to the factory defaults.

password

Sets security-password.



nvramrc Editor Commands
TABLE D-6 nvramrc Editor Commands

Command

Description

nvalias alias device-path

Stores the command " devalias alias device-path " in nvramrc . The alias persists until the nvunalias or set-defaults commands are executed.

nvedit

Enters the nvramrc editor. If data remains in the temporary buffer from a previous nvedit session, resumes editing those previous contents. If not, reads the contents of nvramrc into the temporary buffer and begins editing it.

nvquit

Discards the contents of the temporary buffer, without writing it to nvramrc . Prompts for confirmation.

nvrecover

Recovers the contents of nvramrc if they have been lost as a result of the execution of set-defaults ; then enters the editor as with nvedit . nvrecover fails if nvedit is executed between the time that the nvramrc contents were lost and the time that nvrecover is executed.

nvrun

Executes the contents of the temporary buffer.

nvstore

Copies the contents of the temporary buffer to nvramrc ; discards the contents of the temporary buffer.

nvunalias alias

Deletes the corresponding alias from nvramrc .



NVRAM Script Editor Keystroke Commands
TABLE D-7 NVRAM Script Editor Keystroke Commands

Keystroke

Description

Control-B

Moves backward one character.

Escape B

Moves backward one word.

Control-F

Moves forward one character.

Escape F

Moves forward one word.

Control-A

Moves backward to beginning of the line.

Control-E

Moves forward to end of the line.

Control-N

Moves to the next line of the script editing buffer.

Control-P

Moves to the previous line of the script editing buffer.

Return (Enter)

Inserts a new line at the cursor position and advances to the next line.

Control-O

Inserts a new line at the cursor position and stays on the current line.

Control-K

Erases from the cursor position to the end of the line, storing the erased characters in a save buffer. If at the end of a line, joins the next line to the current line (i.e. deletes the new line).

Delete

Erases the previous character.

Backspace

Erases the previous character.

Control-H

Erases the previous character.

Escape H

Erases from beginning of word to just before the cursor, storing erased characters in a save buffer.

Control-W

Erases from beginning of word to just before the cursor, storing erased characters in a save buffer.

Control-D

Erases the next character.

Escape D

Erases from the cursor to the end of the word, storing the erased characters in a save buffer.

Control-U

Erases the entire line, storing the erased characters in a save buffer.

Control-Y

Inserts the contents of the save buffer before the cursor.

Control-Q

Quotes the next character (i.e. allows you to insert control characters).

Control-R

Retypes the line.

Control-L

Displays the entire contents of the editing buffer.

Control-C

Exits the script editor, returning to the OpenBoot command interpreter. The temporary buffer is preserved, but is not written back to the script. (Use nvstore afterwards to write it back.)



Stack Manipulation Commands
TABLE D-8 Stack Manipulation Commands

Command

Stack Diagram

Description

clear

( ??? -- )

Empties the stack.

depth

( -- u )

Returns the number of items on the stack.

drop

( x -- )

Removes top item from the stack.

2drop

( x1 x2 -- )

Removes 2 items from the stack.

3drop

( x1 x2 x3 -- )

Removes 3 items from the stack.

dup

( x -- x x )

Duplicates the top stack item.

2dup

( x1 x2 -- x1 x2 x1 x2 )

Duplicates 2 stack items.

3dup

( x1 x2 x3 -- x1 x2 x3 x1 x2 x3 )

Duplicates 3 stack items.

?dup

( x -- x x | 0 )

Duplicates the top stack item if it is non-zero.

nip

( x1 x2 -- x2 )

Discards the second stack item.

over

( x1 x2 -- x1 x2 x1 )

Copies second stack item to top of stack.

2over

( x1 x2 x3 x4 -- x1 x2 x3 x4 x1 x2 )

Copies second 2 stack items.

pick

( xu ... x1 x0 u -- xu ... x1 x0 xu )

Copies u -th stack item ( 1 pick = over ).

>r

( x -- ) (R: -- x )

Moves a stack item to the return stack.

r>

( -- x ) ( R: x -- )

Moves a return stack item to the stack.

r@

( -- x ) ( R: x -- x )

Copies the top of the return stack to the stack.

roll

( xu ... x1 x0 u -- xu-1 ... x1 x0 xu )

Rotates u stack items ( 2 roll = rot ).

rot

( x1 x2 x3 -- x2 x3 x1 )

Rotates 3 stack items.

-rot

( x1 x2 x3 -- x3 x1 x2 )

Inversely rotates 3 stack items.

2rot

( x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2 )

Rotates 3 pairs of stack items.

swap

( x1 x2 -- x2 x1 )

Exchanges the top 2 stack items.

2swap

( x1 x2 x3 x4 -- x3 x4 x1 x2 )

Exchanges 2 pairs of stack items.

tuck

( x1 x2 -- x2 x1 x2 )

Copies top stack item below second item.



Single-Precision Arithmetic Functions
TABLE D-9 Single-Precision Arithmetic Functions

Command

Stack Diagram

Description

+

( nu1 nu2 -- sum )

Adds nu1 + nu2 .

-

( nu1 nu2 -- diff )

Subtracts nu1 - nu2 .

*

( nu1 nu2 -- prod )

Multiplies nu1 * nu2 .

*/

( nu1 nu2 nu3 -- quot )

Calculates nu1 * nu2 / n3 .

/

( n1 n2 -- quot )

Divides n1 by n2 ; remainder is discarded.

1+

( nu1 -- nu2 )

Add 1.

1-

( nu1 -- nu2 )

Subtracts 1.

2+

( nu1 -- nu2 )

Adds 2.

2-

( nu1 -- nu2 )

Subtracts 2.

abs

( n -- u )

Absolute value.

bounds

( n count -- n+count n )

Prepares arguments for do or ?do loop.

even

( n -- n | n+1 )

Rounds to nearest even integer >= n .

max

( n1 n2 -- n1|n2 )

Returns the maximum of n1 and n2 .

min

( n1 n2 -- n1|n2 )

Returns the minimum of n1 and n2 .

mod

( n1 n2 -- rem )

Remainder of n1 / n2 .

*/mod

( n1 n2 n3 -- rem quot )

Remainder, quotient of n1 * n2 / n3 .

/mod

( n1 n2 -- rem quot )

Remainder, quotient of n1 / n2 .

negate

( n1 -- n2 )

Changes the sign of n1 .

u*

( u1 u2 -- uprod )

Multiplies 2 unsigned numbers, yielding an unsigned product.

u/mod

( u1 u2 -- urem uquot )

Divides unsigned number by an unsigned number, yielding remainder and quotient.



Bit-wise Logical Operators
TABLE D-10 Bit-wise Logical Operators

Command

Stack Diagram

Description

2*

( x1 -- x2 )

Multiplies by 2.

2/

( x1 -- x2 )

Divides by 2.

>>a

( x1 u -- x2 )

Arithmetic right-shift x1 by u bits.

and

( x1 x2 -- x3 )

Bitwise logical AND.

invert

( x1 -- x2 )

Inverts all bits of x1 .

lshift

( x1 u -- x2 )

Left-shifts x1 by u bits. Zero-fill low bits.

or

( x1 x2 -- x3 )

Bitwise logical OR.

rshift

( x1 u -- x2 )

Right-shifts x1 by u bits. Zero-fill high bits.

u2/

( x1 -- x2 )

Logical right shift 1 bit; zero shifted into high bit.

xor

( x1 x2 -- x3 )

Bitwise exclusive OR.



Double Number Arithmetic Functions
TABLE D-11 Double Number Arithmetic Functions

Command

Stack Diagram

Description

d+

(d1 d2 -- d.sum )

Adds d1 to d2 , yielding double number d.sum .

d-

(d1 d2 -- d.diff )

Subtracts d2 from d1 , yielding double number d.diff .

fm/mod

( d n -- rem quot )

Divides d by n .

m*

( n1 n2 -- d )

Signed multiply with double-number product.

s>d

( n1 -- d1 )

Converts a number to a double number.

sm/rem

( d n -- rem quot )

Divides d by n , symmetric division.

um*

( u1 u2 -- ud )

Unsigned multiply yielding unsigned double number product.

um/mod

( ud u -- urem uprod )

Divides ud by u .



32-Bit Data Type Conversion Functions
TABLE D-12 32-Bit Data Type Conversion Functions

Command

Stack Diagram

Description

bljoin

( b.low b2 b3 b.hi -- quad )

Joins four bytes to form a quadlet

bwjoin

( b.low b.hi -- word )

Joins two bytes to form a doublet.

lbflip

( quad1 -- quad2 )

Reverses the bytes within a quadlet

lbsplit

( quad -- b.low b2 b3 b.hi )

Splits a quadlet into four bytes.

lwflip

( quad1 -- quad2 )

Swaps the doublets within a quadlet.

lwsplit

( quad -- w.low w.hi )

Splits a quadlet into two doublets.

wbflip

( word1 -- word2 )

Swaps the bytes within a doublet.

wbsplit

( word -- b.low b.hi )

Splits a doublet into two bytes.

wljoin

( w.low w.hi -- quad )

Joins two doublets to form a quadlet.



64-Bit Data Type Conversion Functions
TABLE D-13 64-Bit Data Type Conversion Functions

Command

Stack Diagram

Description

bxjoin

( b.lo b.2 b.3 b.4 b.5 b.6 b.7 b.hi -- o )

Joins 8 bytes to form an octlet.

lxjoin

( quad.lo quad.hi -- o )

Joins 2 quadlets to form an octlet.

wxjoin

( w.lo w.2 w.3 w.hi -- o )

Joins four doublets to form an octlet.

xbflip

( oct1 -- oct2 )

Reverses the bytes within an octlet.

xbflips

( oaddr len -- )

Reverses the bytes within each octlet in the given region.The behavior is undefined if len is not a multiple of /x .

xbsplit

( o -- b.lo b.2 b.3 b.4 b.5 b.6 b.7 b.hi )

Splits an octlet into 8 bytes.

xlflip

( oct1 -- oct2 )

Reverses the quadlets within an octlet. The bytes within each quadlet are not reversed.

xlflips

( oaddr len -- )

Reverses the quadlets within each octlet in the given region. The bytes within each quadlet are not reversed. The behavior is undefined if len is not a multiple of /x .

xlsplit

( o -- quad.lo quad.hi )

Splits one octlet into 2 quadlets.

xwflip

( oct1 -- oct2 )

Reverses the doublets within an octlet. The bytes within each doublet are not reversed.

xwflips

( oaddr len -- )

Reverses the doublets within each octlet in the given region. The bytes within each doublet are not reversed. The behavior is undefined if len is not a multiple of /x .

xwsplit

( o -- w.lo w.2 w.3 w.hi )

Splits an octlet into 4 doublets.



Address Arithmetic Functions
TABLE D-14 Address Arithmetic Functions

Command

Stack Diagram

Description

aligned

( n1 -- n1 | a-addr)

Increases n1 if necessary to yield a variable aligned address.

/c

( -- n )

The number of address units to a byte: 1.

/c*

( nu1 -- nu2 )

Synonym for chars .

ca+

( addr1 index -- addr2 )

Increments addr1 by index times the value of /c .

ca1+

( addr1 -- addr2 )

Synonym for char+ .

char+

( addr1 -- addr2 )

Increments addr1 by the value of /c .

cell+

( addr1 -- addr2 )

Increments addr1 by the value of /n .

chars

( nu1 -- nu2 )

Multiplies nu1 by the value of /c .

cells

( nu1 -- nu2 )

Multiplies nu1 by the value of /n .

/l

( -- n )

Number of address units to a quadlet; typically 4.

/l*

( nu1 -- nu2 )

Multiplies nu1 by the value of /l .

la+

( addr1 index -- addr2 )

Increments addr1 by index times the value of /l .

la1+

( addr1 -- addr2 )

Increments addr1 by the value of /l .

/n

( -- n )

Number of address units in a cell.

/n*

( nu1 -- nu2 )

Synonym for cells .

na+

( addr1 index -- addr2 )

Increments addr1 by index times the value of /n .

na1+

( addr1 -- addr2 )

Synonym for cell+ .

/w

( -- n )

Number of address units to a doublet; typically 2.

/w*

( nu1 -- nu2 )

Multiplies nu1 by the value of /w .

wa+

( addr1 index -- addr2 )

Increments addr1 by index times the value of /w .

wa1+

( addr1 -- addr2 )

Increments addr1 by the value of /w .



64-Bit Address Arithmetic Functions
TABLE D-15 64-Bit Address Arithmetic Functions

Command

Stack Diagram

Description

/x

( -- n )

Number of address units in an octlet, typically 8.

/x*

( nu1 -- nu2 )

Multiplies nu1 by the value of /x .

xa+

( addr1 index -- addr2 )

Increments addr1 by index times the value of /x .

xa1+

( addr1 -- addr2 )

Increments addr1 by the value of /x .



Memory Access Commands
TABLE D-16 Memory Access Commands

Command

Stack Diagram

Description

!

( x a-addr -- )

Stores a number at a-addr .

+!

( nu a-addr -- )

Adds nu to the number stored at a-addr .

@

( a-addr -- x )

Fetches a number from a-addr .

2!

( x1 x2 a-addr -- )

Stores 2 numbers at a-addr , x2 at lower address.

2@

( a-addr -- x1 x2 )

Fetches 2 numbers from a-addr , x2 from lower address.

blank

( addr len -- )

Sets len bytes of memory beginning at addr to the space character (decimal 32).

c!

( byte addr -- )

Stores byte at addr .

c@

( addr -- byte )

Fetches a byte from addr .

cpeek

( addr -- false | byte true )

Attempts to fetch the byte at addr . Returns the data and true if the access was successful. Returns false if a read access error occurred.

cpoke

( byte addr -- okay? )

Attempts to store the byte to addr . Returns true if the access was successful. Returns false if a write access error occurred.

comp

( addr1 addr2 len -- diff? )

Compares two byte arrays. diff? is 0 if the arrays are identical,
diff? is -1 if the first byte that is different is lesser in the string at addr1 , diff? is 1 otherwise.

dump

( addr len -- )

Displays len bytes of memory starting at addr .

erase

( addr len -- )

Sets len bytes of memory beginning at addr to 0 .

fill

( addr len byte -- )

Sets len bytes of memory beginning at addr to the value byte .

l!

( q qaddr -- )

Stores a quadlet q at qaddr .

l@

( qaddr -- q )

Fetches a quadlet q from qaddr .

lbflips

( qaddr len -- )

Reverses the bytes within each quadlet in the specified region.

lwflips

( qaddr len -- )

Swaps the doublets within each quadlet in specified region.

lpeek

( qaddr -- false | quad true )

Attempts to fetch the 32-bit quantity at qaddr . Returns the data and true if the access was successful. Returns false if a read access error occurred.

lpoke

( quad qaddr -- okay? )

Attempts to store the 32-bit quantity at qaddr . Returns true if the access was successful. Returns false if a a write access error occurred.

move

( src-addr dest-addr len -- )

Copies len bytes from src-addr to dest-addr .

off

( a-addr -- )

Stores false at a-addr .

on

( a-addr -- )

Stores true at a-addr .

unaligned-l!

( q addr -- )

Stores a quadlet q , any alignment

unaligned-l@

( addr -- q )

Fetches a quadlet q , any alignment.

unaligned-w!

( w addr -- )

Stores a doublet w , any alignment.

unaligned-w@

( addr -- w )

Fetches a doublet w , any alignment.

w!

( w waddr -- )

Stores a doublet w at waddr .

w@

( waddr -- w)

Fetches a doublet w from waddr .

<w@

( waddr -- n )

Fetches a doublet w from waddr , sign-extended.

wbflips

( waddr len -- )

Swaps the bytes within each doublet in the specified region.

wpeek

( waddr -- false | w true )

Attempts to fetch the 16-bit quantity at waddr . Returns the data and true if the access was successful. Returns false if a read access error occurred.

wpoke

( w waddr -- okay? )

Attempts to store the 16-bit quantity to waddr . Returns true if the access was successful. Returns false if a write access error occurred.



64-Bit Memory Access Functions
TABLE D-17 64-Bit Memory Access Functions

Command

Stack Diagram

Description

<l@

( qaddr -- n )

Fetches a quadlet from qaddr, sign-extended.

x,

( o -- )

Compiles an octlet into the dictionary
(doublet-aligned).

x@

( oaddr -- o )

Fetches an octlet from an octlet aligned address.

x!

( o oaddr -- )

Stores an octlet to an octlet aligned address.

xbflips

( oaddr len -- )

Reverses the bytes within each octlet in the given region.The behavior is undefined if len is not a multiple of /x .

xlflips

( oaddr len -- )

Reverses the quadlets within each octlet in the given region. The bytes within each quadlet are not reversed. The behavior is undefined if len is not a multiple of /x .

xwflips

( oaddr len -- )

Reverses the doublets within each octlet in the given region. The bytes within each doublet are not reversed. The behavior is undefined if len is not a multiple of /x .



Memory Mapping Commands
TABLE D-18 Memory Mapping Commands

Command

Stack Diagram

Description

alloc-mem

( size -- virt )

Allocates and maps size bytes of available memory; returns the virtual address. Unmap with free-mem .

free-mem

( virt size -- )

Frees memory allocated by alloc-mem .

map?

( virt -- )

Displays memory map information for the virtual address.



Defining Words
TABLE D-19 Defining Words

Command

Stack Diagram

Description

: new-name

( -- ) (E: ... -- ??? )

Starts a new colon definition of the word new-name .

;

( -- )

Ends a colon definition.

alias new-name old-name

( -- ) (E: ... -- ??? )

Creates new-name with the same behavior as old-name .

buffer: name

( size -- ) (E: -- a-addr )

Creates a named array in temporary storage.

constant name

( n -- ) (E: -- n )

Defines a constant (for example, 3 constant bar ).

2constant name

( n1 n2 -- ) (E: -- n1 n2 )

Defines a 2-number constant.

create name

( -- ) (E: -- a-addr )

Generic defining word.

defer name

( -- ) (E: ... -- ??? )

Defines a word for forward references or execution vectors using execution token.

does>

( ... -- ... a-addr ) (E: ... -- ??? )

Starts the run-time clause for defining words.

field name

( offset size -- offset+size ) (E: addr -- addr+offset )

Creates a named offset pointer.

struct

( -- 0 )

Initializes for field creation.

value name

( n -- ) (E: -- n )

Creates a changeable, named quantity.

variable name

( -- ) (E: -- a-addr )

Defines a variable.



Dictionary Searching Commands
TABLE D-20 Dictionary Searching Commands

Command

Stack Diagram

Description

' name

( -- xt )

Finds the named word in the dictionary.
Returns the execution token. Uses outside definitions.

['] name

( -- xt )

Similar to ' but is used either inside or outside definitions.

.calls

( xt -- )

Displays a list of all words that call the word whose execution token is xt .

$find

( str len -- str len false | xt true )

Searches for word named by str,len . If found, leaves xt and true on stack. If not found, leaves name string and false on stack.

find

( pstr -- pstr false | xt n )

Searches for word named by pstr . If found, leaves xt and true on stack. If not found, leaves name string and false on stack.

(Recommend using $find to avoid use of packed string.)

see thisword

( -- )

Decompiles the named command.

(see)

( xt -- )

Decompiles the word indicated by the execution token.

sift

( pstr -- )

Displays names of all dictionary entries containing the string pointed to by pstr .

sifting ccc

( -- )

Displays names of all dictionary entries containing the sequence of characters. ccc contains no spaces.

words

( -- )

Displays all visible words in the dictionary.



Dictionary Compilation Commands
TABLE D-21 Dictionary Compilation Commands

Command

Stack Diagram

Description

,

( n -- )

Places a number in the dictionary.

c,

( byte -- )

Places a byte in the dictionary.

w,

( word -- )

Places a 16-bit number in the dictionary.

l,

( quad -- )

Places a 32-bit number in the dictionary.

[

( -- )

Enters interpretation state.

]

( -- )

Ends interpreting, enters compilation state.

allot

( n -- )

Allocates n bytes in the dictionary.

>body

( xt -- a-addr )

Finds the data field address from the execution token.

body>

( a-addr -- xt )

Finds the execution token from the data field address.

compile

( -- )

Compiles the next word at run time. (Recommend using postpone instead.)

[compile] name

( -- )

Compiles the next (immediate) word. (Recommend using postpone instead.)

forget name

( -- )

Removes word from dictionary and all subsequent words.

here

( -- addr )

Address of top of dictionary.

immediate

( -- )

Marks the last definition as immediate.

to name

( n -- )

Installs a new action in a defer word or value .

literal

( n -- )

Compiles a number.

origin

( -- addr )

Returns the address of the start of the Forth system.

patch new-word old-word word-to-patch

( -- )

Replaces old-word with new-word in word-to-patch .

(patch)

( new-n old-n xt -- )

Replaces old-n with new-n in word indicated by xt .

postpone name

( -- )

Delays the execution of the word name.

recursive

( -- )

Makes the name of the colon definition being compiled visible in the dictionary, and thus allows the name of the word to be used recursively in its own definition.

state

( -- addr )

Variable that is non-zero in compile state.



Assembly Language Programming
TABLE D-22 Assembly Language Programming

Command

Stack Diagram

Description

code name

( -- code-sys ) (E: ... -- ??? )

Begins the creation of an assembly language routine called name . Commands that follow are interpreted as assembler mnemonics. Note that if the assembler is not installed, code is still present, except that machine code must be entered numerically (for example, in hex) with ",".

c;

( code-sys -- )

Ends the creation of an assembly language routine. Automatically assembles the Forth interpreter "next" function so that the created assembly-code word, when executed, returns control to the calling routine as usual.

label name

( -- code-sys ) (E: -- a-addr )

Begins the creation of an assembly language routine called name . Words created with label leave the address of the code on the stack when executed. The commands that follow are interpreted as assembler mnemonics. As with code , label is present even if the assembler is not installed.

end-code

( code-sys -- )

Ends the assembly language patch started with label .



Basic Number Display
TABLE D-23 Basic Number Display

Command

Stack Diagram

Description

.

( n -- )

Displays a number in the current base.

.r

( n size -- )

Displays a number in a fixed width field.

.s

( -- )

Displays contents of data stack.

showstack

( -- )

Executes .s automatically before each ok prompt.

noshowstack

( -- )

Turns off automatic display of the stack before each ok prompt.

u.

( u -- )

Displays an unsigned number.

u.r

( u size -- )

Displays an unsigned number in a fixed width field.



Changing the Number Base
TABLE D-24 Changing the Number Base

Command

Stack Diagram

Description

.d

( n -- )

Displays n in decimal without changing base.

.h

( n -- )

Displays n in hex without changing base.

base

( -- addr )

Variable containing number base.

decimal

( -- )

Sets the number base to 10.

d# number

( -- n )

Interprets number in decimal; base is unchanged.

hex

( -- )

Sets the number base to 16.

h# number

( -- n )

Interprets number in hex; base is unchanged.



Numeric Output Word Primitives
TABLE D-25 Numeric Output Word Primitives

Command

Stack Diagram

Description

#

( +l1 -- +l2 )

Converts a digit in pictured numeric output.

#>

( l -- addr +n )

Ends pictured numeric output.

<#

( -- )

Initializes pictured numeric output.

(.)

( n -- addr len )

Converts a number to a string.

(u.)

( u -- addr len )

Converts unsigned to string.

digit

( char base -- digit true | char false )

Converts a character to a digit.

hold

( char -- )

Inserts the char in the pictured numeric output string.

$number

( addr len -- true | n false )

Converts a string to a number.

#s

( l -- 0 )

Converts the rest of the digits in pictured numeric output.

sign

( n -- )

Sets sign of pictured output.



Controlling Text Input
TABLE D-26 Controlling Text Input

Command

Stack Diagram

Description

( ccc )

( -- )

Begins a comment.

\ rest-of-line

( -- )

Skips the rest of the line.

ascii ccc

( -- char )

Gets numerical value of first ASCII character of next word.

accept

( addr len1 -- len2 )

Gets a line of edited input from the console input device; stores at addr . len1 is the maximum allowed length. len2 is the actual length received.

expect

( addr len -- )

Gets and displays a line of input from the console; stores at addr . (Recommend using accept instead.)

key

( -- char )

Reads a character from the console input device.

key?

( -- flag )

True if a key has been typed on the console input device.

parse

( char -- str len )

Parses text from the input buffer delimited by char .

parse-word

( -- str len )

Skips leading spaces and parses text from the input buffer delimited by white space.

safe-parse-word

( -- str len )

Similar to parse-word but intended for use in cases where the null string as input is indicative of an error.

word

( char -- pstr )

Collects a string delimited by char from the input buffer and places it as a packed string in memory at pstr . (Recommend using parse instead.)



Displaying Text Output
TABLE D-27 Displaying Text Output

Command

Stack Diagram

Description

." ccc "

( -- )

Compiles a string for later display.

(cr

( -- )

Moves the output cursor back to the beginning of the current line.

cr

( -- )

Terminates a line on the display and goes to the next line.

emit

( char -- )

Displays the character.

exit?

( -- flag )

Enables the scrolling control prompt:
More [<space>,<cr>,q] ?

The return flag is true if the user wants the output to be terminated.

space

( -- )

Displays a space character.

spaces

( +n -- )

Displays +n spaces.

type

( addr +n -- )

Displays n characters.



Formatted Output
TABLE D-28 Formatted Output

Command

Stack Diagram

Description

#lines

( -- rows )

Value holding the number of lines on the output device.

#out

( -- a-addr )

Variable holding the column number on the output device.



Manipulating Text Strings
TABLE D-29 Manipulating Text Strings

Command

Stack Diagram

Description

",

( addr len -- )

Compiles an array of bytes from addr of length len , at the top of the dictionary as a packed string.

" ccc "

( -- addr len )

Collects an input stream string, either interpreted or compiled. Within the string, "(00,ff...) can be used to include arbitrary byte values.

.( ccc )

( -- )

Displays a string immediately.

-trailing

( addr +n1 -- addr +n2 )

Removes trailing spaces.

bl

( -- char )

ASCII code for the space character; decimal 32.

count

( pstr -- addr +n )

Unpacks a packed string.

lcc

( char -- lowercase-char )

Converts a character to lowercase.

left-parse-string

( addr len char -- addrR lenR addrL lenL )

Splits a string at char (which is discarded).

pack

( addr len pstr -- pstr )

Makes a packed string from addr len ; places it at pstr .

p" ccc "

( -- pstr )

Collects a string from the input stream; stores as a packed string.

upc

( char -- uppercase-char )

Converts a character to uppercase.



I/O Redirection Commands
TABLE D-30 I/O Redirection Commands

Command

Stack Diagram

Description

input

( device -- )

Selects device ( keyboard , or device-specifier ) for subsequent input.

io

( device -- )

Selects device for subsequent input and output.

output

( device -- )

Selects device ( screen , or device-specifier ) for subsequent output.



ASCII Constants
TABLE D-31 ASCII Constants

Command

Stack Diagram

Description

bell

( -- n )

ASCII code for the bell character; decimal 7.

bs

( -- n )

ASCII code for the backspace character; decimal 8.



Command Line Editor Keystroke Commands
TABLE D-32 Command Line Editor Keystroke Commands

Keystroke

Description

Control-B

Moves backward one character.

Escape B

Moves backward one word.

Control-F

Moves forward one character.

Escape F

Moves forward one word.

Control-A

Moves backward to beginning of line.

Control-E

Moves forward to end of line.

Delete

Erases previous character.

Backspace

Erases previous character.

Control-H

Erases previous character.

Escape H

Erases from beginning of word to just before the cursor, storing erased characters in a save buffer.

Control-W

Erases from beginning of word to just before the cursor, storing erased characters in a save buffer.

Control-D

Erases next character.

Escape D

Erases from cursor to end of the word, storing erased characters in a save buffer.

Control-K

Erases from cursor to end of line, storing erased characters in a save buffer.

Control-U

Erases entire line, storing erased characters in a save buffer.

Control-R

Retypes the line.

Control-Q

Quotes next character (allows you to insert control characters).

Control-Y

Inserts the contents of the save buffer before the cursor.

Control-P

Selects and displays the previous line for subsequent editing.

Control-N

Selects and displays the next line for subsequent editing.

Control-L

Displays the entire contents of the editing buffer.



Command Completion Keystroke Commands
TABLE D-33 Command Completion Keystroke Commands

Keystroke

Description

Control-Space

Completes the name of the current word.

Control-/

Displays all possible matches for the current word.



Comparison Commands
TABLE D-34 Comparison Commands

Command

Stack Diagram

Description

<

( n1 n2 -- flag )

True if n1 < n2 .

<=

( n1 n2 -- flag )

True if n1 <= n2 .

<>

( n1 n2 -- flag )

True if n1 is not equal to n2 .

=

( n1 n2 -- flag )

True if n1 = n2 .

>

( n1 n2 -- flag )

True if n1 > n2 .

>=

( n1 n2 -- flag )

True if n1 >= n2 .

0<

( n -- flag )

True if n < 0.

0<=

( n -- flag )

True if n <= 0.

0<>

( n -- flag )

True if n <> 0.

0=

( n -- flag )

True if n = 0 (also inverts any flag).

0>

( n -- flag )

True if n > 0.

0>=

( n -- flag )

True if n >= 0.

between

( n min max -- flag )

True if min <= n <= max .

false

( -- 0 )

The value FALSE , which is 0.

true

( -- -1 )

The value TRUE , which is -1.

u<

( u1 u2 -- flag )

True if u1 < u2 , unsigned.

u<=

( u1 u2 -- flag )

True if u1 <= u2 , unsigned.

u>

( u1 u2 -- flag )

True if u1 > u2 , unsigned.

u>=

( u1 u2 -- flag )

True if u1 >= u2 , unsigned.

within

( n min max -- flag )

True if min <= n < max .



if-else-then Commands
TABLE D-35 if-else-then Commands

Command

Stack Diagram

Description

if

( flag -- )

Executes the following code when flag is true .

else

( -- )

Executes the following code when flag is false .

then

( -- )

Terminates if...then...else .



case Statement Commands
TABLE D-36 case Statement Commands

Command

Stack Diagram

Description

case

( selector -- selector )

Begins a case...endcase conditional.

endcase

( selector | {empty} -- )

Terminates a case...endcase conditional.

endof

( -- )

Terminates an of...endof clause within a case...endcase.

of

( selector test-value -- selector | {empty} )

Begins an of...endof clause within a case conditional.



begin (Conditional) Loop Commands
TABLE D-37 begin (Conditional) Loop Commands

Command

Stack Diagram

Description

again

( -- )

Ends a begin...again infinite loop.

begin

( -- )

Begins a begin...while...repeat , begin...until, or begin...again loop.

repeat

( -- )

Ends a begin...while...repeat loop.

until

( flag -- )

Continues executing a begin...until loop until flag is true.

while

( flag -- )

Continues executing a begin...while...repeat loop while flag is true.



do (Counted) Loop Commands
TABLE D-38 do (Counted) Loop Commands

Command

Stack Diagram

Description

+loop

( n -- )

Ends a do...+loop construct; adds n to loop index and returns to do (if n < 0, index goes from start to end , inclusive).

?do

( end start -- )

Begins ?do...loop to be executed 0 or more times. Index goes from start to end -1, inclusive. If end = start , loop is not executed.

?leave

( flag -- )

Exits from a do...loop if flag is non-zero.

do

( end start -- )

Begins a do...loop . Index goes from start to end -1, inclusive.

Example: 10 0 do i . loop (prints 0 1 2...d e f).

i

( -- n )

Leaves the loop index on the stack.

j

( -- n )

Leaves the loop index for next outer enclosing loop.

leave

( -- )

Exits from do...loop .

loop

( -- )

End of do...loop .



Program Execution Control Commands
TABLE D-39 Program Execution Control Commands

Command

Stack Diagram

Description

abort

( -- )

Aborts current execution and interprets keyboard commands.

abort " ccc "

( abort? -- )

If abort? is true, aborts and displays message.

eval

( ... str len -- ??? )

Synonym for evaluate .

evaluate

( ... str len -- ??? )

Interprets Forth source text from the specified string.

execute

( xt -- )

Executes the word whose execution token is on the stack.

exit

( -- )

Returns from the current word. (Cannot be used in counted loops.)

quit

( -- )

Same as abort , but leaves stack intact.



File Loading Commands
TABLE D-40 File Loading Commands

Command

Stack Diagram

Description

?go

( -- )

Executes Forth, FCode, or binary programs.

boot [specifiers] -h

( -- )

Loads file from specified source.

byte-load

( addr span -- )

Interprets loaded FCode binary file. span is usually 1.

dl

( -- )

Loads a Forth file over a serial line with tip and interpret. Type:
~C cat filename
^-D

dlbin

( -- )

Loads a binary file over a serial line with tip .

Type: ~C cat filename

dload filename

( addr -- )

Loads the specified file over Ethernet at the given address.

eval

( addr len -- )

Interprets loaded Forth text file.

go

( -- )

Begins executing a previously-loaded binary program, or resumes executing an interrupted program.

init-program

( -- )

Initializes to execute a binary file.

load device-specifier argument

( -- )

Loads data from specified device into memory at the address given by load-base .

load-base

( -- addr )

Address at which load places the data it reads from a device.



Disassembler Commands
TABLE D-41 Disassembler Commands

Command

Stack Diagram

Description

+dis

( -- )

Continues disassembling where the last disassembly left off.

dis

( addr -- )

Begins disassembling at the specified address.



Breakpoint Commands
TABLE D-42 Breakpoint Commands

Command

Stack Diagram

Description

+bp

( addr -- )

Adds a breakpoint at the given address.

-bp

( addr -- )

Removes the breakpoint at the given address.

--bp

( -- )

Removes the most-recently-set breakpoint.

.bp

( -- )

Displays all currently set breakpoints.

.breakpoint

( -- )

Performs a specified action when a breakpoint occurs. This word can be altered to perform any desired action. For example, to display registers at every breakpoint, type: ['] .registers is .breakpoint . The default behavior is .instruction . To perform multiple behaviors, create a single definition which calls all desired behaviors, then load that word into .breakpoint .

.instruction

( -- )

Displays the address, opcode for the last-encountered breakpoint.

.step

( -- )

Performs a specified action when a single step occurs. (See .breakpoint ).

bpoff

( -- )

Removes all breakpoints.

finish-loop

( -- )

Executes until the end of this loop.

go

( -- )

Continues from a breakpoint. This can be used to go to an arbitrary address by setting up the processor's program counter before issuing go .

gos

( n -- )

Executes go n times.

hop

( -- )

(Like the step command.) Treats a subroutine call as a single instruction.

hops

( n -- )

Executes hop n times.

return

( -- )

Executes until the end of this subroutine.

returnl

( -- )

Executes until the end of this leaf subroutine.

skip

( -- )

Skips (does not execute) the current instruction.

step

( -- )

Single-steps one instruction.

steps

( n -- )

Executes step n times.

till

( addr -- )

Executes until the given address is encountered. Equivalent to +bp go .



Forth Source-level Debugger Commands
TABLE D-43 Forth Source-level Debugger Commands

Command

Description

c

"Continue". Switches from stepping to tracing, thus tracing the remainder of the execution of the word being debugged.

d

"Down a level". Marks for debugging the word whose name was just displayed, then executes it.

u

"Up a level". Un-marks the word being debugged, marks its caller for debugging, and finishes executing the word that was previously being debugged.

f

Starts a subordinate Forth interpreter. When that interpreter exits (with resume ), control returns to the debugger at the place where the f command was executed.

g

"Go." Turns off the debugger and continues execution.

q

"Quit". Aborts the execution of the word being debugged and all its callers and returns to the command interpreter.

s

"see". Decompiles the word being debugged.

$

Displays the address,len on top of the stack as a text string.

h

"Help". Displays symbolic debugger documentation.

?

"Short Help". Displays brief symbolic debugger documentation.

debug name

Marks the specified Forth word for debugging. Enters the Forth Source-level Debugger on all subsequent attempts to execute name . After executing debug , the execution speed of the system may decrease until debugging is turned off with debug-off. (Do not debug basic Forth words such as " dup " .)

(debug

Like debug , except that (debug takes an execution token from the stack instead of a name from the input stream.

debug-off

Turns off the Forth Source-level Debugger so that no word is being debugged.

resume

Exits from a subordinate interpreter, and goes back to the stepper. (See the f command in this table.)

stepping

Sets step mode for the Forth Source-level Debugger, allowing the interactive, step-by-step execution of the word being debugged. Step mode is the default.

tracing

Sets trace mode for the Forth Source-level Debugger. Tracing enables the execution of the word being debugged, while showing the name and stack contents for each word called by that word.

<space-bar>

Executes the word just displayed and proceeds to the next word.



Time Utilities
TABLE D-44 Time Utilities

Command

Stack Diagram

Description

get-msecs

( -- ms )

Returns the approximate current time in milliseconds.

ms

( n -- )

Delays for n milliseconds. Resolution is 1 millisecond.



Miscellaneous Operations
TABLE D-45 Miscellaneous Operations

Command

Stack Diagram

Description

callback string

( value -- )

Calls Solaris with the given value and string.

catch

( ... xt -- ??? error-code | ??? false )

Executes xt ; returns throw error code or 0 if throw is not called.

eject floppy

( -- )

Ejects the diskette from the floppy drive.

firmware-version

(-- n )

Returns major/minor CPU firmware version (that is, 0x00030001 = firmware version 3.1).

forth

( -- )

Restores main Forth vocabulary to top of search order.

ftrace

( -- )

Shows calling sequence when exception occurred.

noop

( -- )

Does nothing.

reset-all

( -- )

Resets the entire system (similar to a power-cycle).

sync

( -- )

Calls the operating system to write any pending information to the hard disk. Also boots after syncing file systems.

throw

( error-code -- )

Returns given error code to catch.



Multiprocessor Commands
TABLE D-46 Multiprocessor Commands

Command

Stack Diagram

Description

switch-cpu

( cpu# -- )

Switches to indicated CPU.



Memory Mapping Commands
TABLE D-47 Memory Mapping Commands

Command

Stack Diagram

Description

map?

( virt -- )

Displays memory map information for the virtual address.

memmap

( phys space size -- virt )

Maps a region of physical addresses; returns the allocated virtual address. Unmaps with free-virtual .

obio

( -- space )

Specifies the device address space for mapping.

obmem

( -- space )

Specifies the onboard memory address space for mapping.

sbus

( -- space )

Specifies the SBus address space for mapping.



Memory Mapping Primitives
TABLE D-48 Memory Mapping Primitives

Command

Stack Diagram

Description

iomap?

( virt -- )

Displays IOMMU page map entry for the virtual address.

iomap-page

( phys space virt -- )

Maps physical page given by phys and space to the virtual address.

iomap-pages

( phys space virt size -- )

Performs consecutive iomap- page s to map a region of memory given by size .

iopgmap@

( virt -- pte | 0 )

Returns IOMMU page map entry for the virtual address.

iopgmap!

( pte virt -- )

Stores a new page map entry for the virtual address.

map-page

( phys space virt -- )

Maps one page of memory starting at address phys on to virtual address virt in the specified address space . All addresses are truncated to lie on a page boundary.

map-pages

( phys space virt size -- )

Performs consecutive map-page s to map a region of memory to the specified size .

map-region

( region# virt -- )

Maps a region.

map-segments

( smentry virt len -- )

Performs consecutive smap! operations to map a region of memory.

pgmap!

( pmentry virt -- )

Stores a new page map entry for the virtual address.

pgmap?

( virt -- )

Displays the page map entry (decoded and in English) corresponding to the virtual address.

pgmap@

( virt -- pmentry )

Returns the page map entry for the virtual address.

pagesize

( -- size )

Returns the size of a page.

rmap!

( rmentry virt -- )

Stores a new region map entry for the virtual address.

rmap@

( virt -- rmentry )

Returns the region map entry for the virtual address.

segmentsize

( -- size )

Returns the size of a segment.

smap!

( smentry virt -- )

Stores a new segment map entry for the virtual address.

smap?

( virt -- )

Formatted display of the segment map entry for the virtual address.

smap@

( virt -- smentry )

Returns the segment map entry for the virtual address.



Cache Manipulation Commands
TABLE D-49 Cache Manipulation Commands

Command

Stack Diagram

Description

clear-cache

( -- )

Invalidates all cache entries.

cache-off

( -- )

Disables the cache.

cache-on

( -- )

Enables the cache.

ecdata!

( data offset -- )

Stores the data at the cache offset .

ecdata@

( offset -- data )

Fetches (returns) data from the cache offset .

ectag!

( value offset -- )

Stores the tag value at the cache offset .

ectag@

( offset -- value )

Return the tag value at the cache offset .

flush-cache

( -- )

Writes back any pending data from the cache.



Reading/Writing Machine Registers in Sun-4u Machines
TABLE D-50 Reading/Writing Machine Registers in Sun-4u Machines

Command

Stack Diagram

Description

aux!

( data -- )

Writes auxiliary register.

aux@

( -- data )

Reads auxiliary register.



Alternate Address Space Access Commands
TABLE D-51 Alternate Address Space Access Commands

Command

Stack Diagram

Description

spacec!

( byte addr asi -- )

Stores the byte in asi at addr .

spacec?

( addr asi -- )

Displays the byte in asi at addr .

spacec@

( addr asi -- byte )

Fetches the byte from asi at addr .

spaced!

( quad1 quad2 addr asi -- )

Stores the two quadlets in asi at addr . Order is implementation-dependent.

spaced?

( addr asi -- )

Displays the two quadlets in asi at addr . Order is implementation-dependent.

spaced@

( addr asi -- quad1 quad2 )

Fetches the two quadlets from asi at addr . Order is implementation-dependent.

spacel!

( quad addr asi -- )

Stores the quadlet in asi at addr .

spacel?

( addr asi -- )

Displays the quadlet in asi at addr .

spacel@

( addr asi -- quad )

Fetches the quadlet from asi at addr .

spacew!

( w addr asi -- )

Stores the doublet in asi at addr .

spacew?

( addr asi -- )

Displays the doublet in asi at addr .

spacew@

( addr asi -- w )

Fetches the doublet from asi at addr .

spacex!

( x addr asi -- )

Stores the number in asi at addr .

spacex?

( addr asi -- )

Displays the word in asi at addr .

spacex@

( addr asi -- x )

Fetches the word from asi at addr.



SPARC Register Commands
TABLE D-52 SPARC Register Commands

Command

Stack Diagram

Description

%g0 through %g7

( -- value )

Returns the value in the specified global register.

%i0 through %i7

( -- value )

Returns the value in the specified input register.

%l0 through %l7

( -- value )

Returns the value in the specified local register.

%o0 through %o7

( -- value )

Returns the value in the specified output register.

%pc %npc %y

( -- value )

Returns the value in the specified register.

%f0 through %f31

( -- value )

Returns the value in the specified floating point register.

.fregisters

( -- )

Displays the values in %f0 through %f31 .

.locals

( -- )

Displays the values in the i , l and o registers.

.registers

( -- )

Displays values in processor registers.

.window

( window# -- )

Same as w .locals ; displays the desired window.

ctrace

( -- )

Displays the return stack showing C subroutines.

set-pc

( new-value -- )

Sets %pc to new-value , and sets %npc to
( new-value +4).

to regname

( new-value -- )

Changes the value stored in any of the above registers.
Use in the form: new-value to regname .

w

( window# -- )

Sets the current window for displaying %i x, %l x, or %o x.



SPARC V9 Register Commands
TABLE D-53 SPARC V9 Register Commands

Command

Stack Diagram

Description

%fprs

%asi

%pstate

%tl-c

%pil

%tstate

%tt

%tba

%cwp

%cansave

%canrestore

%otherwin

%wstate

%cleanwin

( -- value )

Returns the value in the specified register.

.pstate

( -- )

Formatted display of the processor state register.

.ver

( -- )

Formatted display of the version register.

.ccr

( -- )

Formatted display of the ccr register.

.trap-registers

( -- )

Displays trap-related registers.



Emergency Keyboard Commands
TABLE D-54 Emergency Keyboard Commands

Command

Description

Stop

Bypasses POST. This command does not depend on security-mode. (Note: some systems bypass POST as a default; in such cases, use Stop-D to start POST.)

Stop-A

Aborts.

Stop-D

Enters diagnostic mode (sets diag-switch? to true ).

Stop-F

Enters Forth on TTYA instead of probing. Uses fexit to continue with the initialization sequence. Useful if hardware is broken.

Stop-N

Resets NVRAM contents to default values.



Diagnostic Test Commands
TABLE D-55 Diagnostic Test Commands

Command

Description

probe-scsi

Identifies devices attached to a SCSI bus.

test device-specifier

Executes the specified device's selftest method. For example:

test net - test the network connection

watch-clock

Tests a clock function.

watch-net

Monitors a network connection.

test-all device specifier

Executes the selftest method for all devices at or below device-specifier . If no device specifier is provided, executes the selftest methods for all devices in the device tree.

obdiag

Invokes an optional interactive menu tool which lists all selftest methods available on a system; provides commands to run selftests.