This appendix contains the Forth commands supported by the OpenBoot firmware.
For the most part, the commands are listed in the order in which they were introduced in the chapters. Some of the tables in this appendix show commands 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.
Table E-1 Stack Item Notation
Notation |
Description |
---|---|
| |
Alternate stack results, for example: ( input -- adr len false | result true ). |
? |
Unknown stack items (changed from ???). |
??? |
Unknown stack items. |
acf |
Code field address. |
adr |
Memory address (generally a virtual address). |
adr16 |
Memory address, must be 16-bit aligned. |
adr32 |
Memory address, must be 32-bit aligned. |
adr64 |
Memory address, must be 64-bit aligned. |
byte bxxx |
8-bit value (smallest byte in a 32-bit word). |
char |
7-bit value (smallest byte), high bit unspecified. |
cnt len size |
Count or length. |
flag xxx? |
0 = false; any other value = true (usually -1). |
long Lxxx |
32-bit value. |
n n1 n2 n3 |
Normal signed values (32-bit). |
+n u |
Unsigned, positive values (32-bit). |
n[64] (n.low n.hi) |
Extended-precision (64-bit) numbers (2 stack items). |
phys |
Physical address (actual hardware address). |
pstr |
Packed string (adr len means unpacked string). |
virt |
Virtual address (address used by software). |
word wxxx |
16-bit value (smallest two bytes in a 32-bit word). |
Table E-2 Restricted Monitor Commands
Command |
Description |
---|---|
b [specifiers] |
Boot the operating system (same as boot at the ok prompt). |
c |
Resume the execution of a halted program (same as go at ok prompt). |
n |
Enter the Forth Monitor. |
Table E-3 Examining and Creating Device Aliases
Command |
Description |
---|---|
devalias |
Display all current device aliases. |
devalias alias |
Display the device path name corresponding to alias. |
devalias alias device-path |
Define an alias representing device-path. If an alias with the same name exists, the new value supercedes the old. |
Table E-4 Commands for Browsing the Device Tree
Command |
Description |
---|---|
.attributes |
Display the names and values of the current node's properties. |
cd device-path |
Select the indicated device node, making it the current node. |
cd node-name |
Search for a node with the given name in the subtree below the current node, and select the first such node found. |
cd .. |
Select the device node that is the parent of the current node. |
cd / |
Select the root machine node. |
device-end |
De-select the current device node, leaving no node selected. |
ls |
Display the names of the current node's children. |
pwd |
Display the device path name that names the current node. |
show-devs [device-path] |
Display all the devices known to the system directly beneath a given level in the device hierarchy. show-devs used by itself shows the entire device tree. |
words |
Display the names of the current node's methods. |
Table E-5 Help Commands
Command |
Description |
---|---|
help |
List main help categories. |
help category |
Show help for all commands in the category. Use only the first word of the category description. |
help command |
Show help for individual command (where available). |
Table E-6 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] |
-a - Prompt interactively for the device and name of the boot file. -h - Halt after loading the program. (These options are specific to the operating system, and may differ from system to system.) |
Table E-7 Diagnostic Test Commands
Command |
Description |
---|---|
probe-scsi |
Identify devices attached to the built-in SCSI bus. |
probe-scsi-all [device-path] |
Perform probe-scsi on all SCSI buses installed in the system below the specified device tree node. (If device-path is absent, the root node is used.) |
test device-specifier |
Execute the specified device's self-test method. For example: test floppy - test the floppy drive, if installed test /memory - test number of megabytes specified in the selftest-#megs NVRAM parameter; or test all of memory if diag-switch? is true test net - test the network connection |
test-all [device-specifier] |
Test all devices (that have a built-in self-test method) below the specified device tree node. (If device-specifier is absent, the root node is used.) |
watch-clock |
Test the clock function. |
watch-net |
Monitor the network connection. |
Table E-8 System Information Display Commands
Command |
Description |
---|---|
banner |
Display power-on banner. |
show-sbus |
Display list of installed and probed SBus devices. |
.enet-addr |
Display current Ethernet address. |
.idprom |
Display ID PROM contents, formatted. |
.traps |
Display a list of SPARC trap types. |
.version |
Display version and date of the boot PROM. |
Table E-9 NVRAM Configuration Parameters
Parameter |
Typical Default |
Description |
---|---|---|
auto-boot? |
true |
If true, boot automatically after power-on or reset. |
boot-device |
disk |
Device from which to boot. |
boot-file |
empty string |
File to boot (an empty string lets secondary booter choose default). |
boot-from |
vmunix |
Boot device and file (1.x only). |
boot-from-diag |
le()vmunix |
Diagnostic boot device and file (1.x only). |
diag-device |
net |
Diagnostic boot source device. |
diag-file |
empty string |
File from which to boot in diagnostic mode. |
diag-switch? |
false |
If true, run in diagnostic mode. |
fcode-debug? |
false |
If true, include name fields for plug-in device FCodes. |
hardware-revision |
no default |
System version information. |
input-device |
keyboard |
Power-on input device (usually keyboard, ttya, or ttyb). |
keyboard-click? |
false |
If true, enable keyboard click. |
keymap |
no default |
Keymap for custom keyboard. |
last-hardware-update |
no default |
System update information. |
local-mac-address? |
false |
If true, network drivers use their own MAC address, not system's. |
mfg-switch? |
false |
If true, repeat system self-tests until interrupted with Stop-A. |
nvramrc |
empty |
Contents of NVRAMRC. |
oem-banner |
empty string |
Custom OEM banner (enabled by oem-banner? true). |
oem-banner? |
false |
If true, use custom OEM banner. |
oem-logo |
no default |
Byte array custom OEM logo (enabled by oem-logo? true). Displayed in hexadecimal. |
oem-logo? |
false |
If true, use custom OEM logo (else, use Sun logo). |
output-device |
screen |
Power-on output device (usually screen, ttya, or ttyb). |
sbus-probe-list |
0123 |
Which SBus slots are probed and in what order. |
screen-#columns |
80 |
Number of on-screen columns (characters/line). |
screen-#rows |
34 |
Number of on-screen rows (lines). |
scsi-initiator-id |
7 |
SCSI bus address of host adapter, range 0-7. |
sd-targets |
31204567 |
Map SCSI disk units (1.x only). |
security-#badlogins |
no default |
Number of incorrect security password attempts. |
security-mode |
none |
Firmware security level (options: none, command, or full). |
security-password |
no default |
Firmware security password (never displayed). Do not set this directly. |
selftest-#megs |
1 |
Megabytes of RAM to test. Ignored if diag-switch? is true. |
skip-vme-loopback? |
false |
If true, POST does not do VMEbus loopback tests. |
st-targets |
45670123 |
Map SCSI tape units (1.x only). |
sunmon-compat? |
false |
If true, display Restricted Monitor prompt (>). |
testarea |
0 |
One-byte scratch field, available for read/write test. |
tpe-link-test? |
true |
Enable 10baseT link test for built-in twisted pair Ethernet. |
ttya-mode |
9600,8,n,1,- |
TTYA (baud rate, #bits, parity, #stop, handshake). |
ttyb-mode |
9600,8,n,1,- |
TTYB (baud rate, #bits, parity, #stop, handshake). |
ttya-ignore-cd |
true |
If true, operating system ignores carrier-detect on TTYA. |
ttyb-ignore-cd |
true |
If true, operating system ignores carrier-detect on TTYB. |
ttya-rts-dtr-off |
false |
If true, operating system does not assert DTR and RTS on TTYA. |
ttyb-rts-dtr-off |
false |
If true, operating system does not assert DTR and RTS on TTYB. |
use-nvramrc? |
false |
If true, execute commands in NVRAMRC during system start-up. |
version2? |
true |
If true, hybrid (1.x/2.x) PROM comes up in version 2.x. |
watchdog-reboot? |
false |
If true, reboot after watchdog reset. |
Table E-10 Viewing/Changing Configuration Parameters
Command |
Description |
---|---|
printenv |
Display 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 |
Set parameter to the given decimal or text value. (Changes are permanent, but usually only take effect after a reset.) |
set-default parameter |
Reset the value of the named parameter to the factory default. |
set-defaults |
Reset parameter values to the factory defaults. |
Table E-11 Configuration Parameter Command Primitives
Command |
Stack Diagram |
Description |
---|---|---|
nodefault-bytes parameter |
( len -- ) Usage: ( -- adr len ) |
Create custom NVRAM parameter. Use this command in NVRAMRC to make the parameter permanent. |
parameter |
( -- ??? ) |
Return the (current) field value (data type is parameter-dependent). |
show parameter |
( -- ) |
Display the (current) field value (numbers shown in decimal). |
Table E-12 NVRAMRC Editor Commands
Command |
Description |
---|---|
nvalias alias device-path |
Store the command "devalias alias device-path" in NVRAMRC. The alias persists until the nvunalias or set-defaults commands are executed. |
nvedit |
Enter the NVRAMRC editor. If data remains in the temporary buffer from a previous nvedit session, resume editing those previous contents. If not, read the contents of NVRAMRC into the temporary buffer and begin editing it. |
nvquit |
Discard the contents of the temporary buffer, without writing it to NVRAMRC. Prompt for confirmation. |
nvrecover |
Recover the contents of NVRAMRC if they have been lost as a result of the execution of set-defaults; then enter 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 |
Execute the contents of the temporary buffer. |
nvstore |
Copy the contents of the temporary buffer to NVRAMRC; discard the contents of the temporary buffer. |
nvunalias alias |
Delete the corresponding alias from NVRAMRC. |
Table E-13 nvedit Keystroke Commands
Keystroke |
Description |
---|---|
Control-B |
Move backward one character. |
Control-C |
Exit the NVRAMRC editor and return to the OpenBoot command interpreter. The temporary buffer is preserved but is not written back to NVRAMRC. (Use nvstore afterwards to write back the temporary buffer.) |
Control-F |
Move forward one character. |
Control-K |
If at the end of a line, join the next line to the current line (that is, delete the new line). |
Control-L |
List all lines. |
Control-N |
Move to the next line of the NVRAMRC editing buffer. |
Control-O |
Insert a new line at the cursor position and stay on the current line. |
Control-P |
Move to the previous line of the NVRAMRC editing buffer. |
Delete |
Delete the previous character. |
Return |
Insert a new line at the cursor position and advance to the next line. |
Table E-14 Stack Manipulation Commands
Command |
Stack Diagram |
Description |
---|---|---|
-rot |
( n1 n2 n3 -- n3 n1 n2 ) |
Inversely rotate 3 stack items. |
>r |
( n -- ) |
Move a stack item to the return stack. (Use with caution.) |
?dup |
( n -- n n | 0 ) |
Duplicate the top stack item if it is non-zero. |
2drop |
( n1 n2 -- ) |
Remove 2 items from the stack. |
2dup |
( n1 n2 -- n1 n2 n1 n2 ) |
Duplicate 2 stack items. |
2over |
( n1 n2 n3 n4 -- n1 n2 n3 n4 n1 n2 ) |
Copy second 2 stack items. |
2rot |
( n1 n2 n3 n4 n5 n6 -- n3 n4 n5 n6 n1 n2 ) |
Rotate 3 pairs of stack items. |
2swap |
( n1 n2 n3 n4 -- n3 n4 n1 n2 ) |
Exchange 2 pairs of stack items. |
3drop |
( n1 n2 n3 -- ) |
Remove 3 items from the stack. |
3dup |
( n1 n2 n3 -- n1 n2 n3 n1 n2 n3 ) |
Duplicate 3 stack items. |
clear |
( ??? -- ) |
Empty the stack. |
depth |
( ??? -- ??? +n ) |
Return the number of items on the stack. |
drop |
( n -- ) |
Remove top item from the stack. |
dup |
( n -- n n ) |
Duplicate the top stack item. |
nip |
( n1 n2 -- n2 ) |
Discard the second stack item. |
over |
( n1 n2 -- n1 n2 n1 ) |
Copy second stack item to top of stack. |
pick |
( ??? +n -- ??? n2 ) |
Copy +n-th stack item (1 pick = over). |
r> |
( -- n ) |
Move a return stack item to the stack. (Use with caution.) |
r@ |
( -- n ) |
Copy the top of the return stack to the stack. |
roll |
( ??? +n -- ? ) |
Rotate +n stack items (2 roll = rot). |
rot |
( n1 n2 n3 -- n2 n3 n1 ) |
Rotate 3 stack items. |
swap |
( n1 n2 -- n2 n1 ) |
Exchange the top 2 stack items. |
tuck |
( n1 n2 -- n2 n1 n2 ) |
Copy top stack item below second item. |
Table E-15 Colon Definition Words
Command |
Stack Diagram |
Description |
---|---|---|
: name |
( -- ) |
Start creating a new definition. |
; |
( -- ) |
Finish creating a new definition. |
Table E-16 Arithmetic Functions
Command |
Stack Diagram |
Description |
---|---|---|
* |
( n1 n2 -- n3 ) |
Multiply n1 * n2. |
+ |
( n1 n2 -- n3 ) |
Add n1 + n2. |
- |
( n1 n2 -- n3 ) |
Subtract n1 - n2. |
/ |
( n1 n2 -- quot ) |
Divide n1 / n2; remainder is discarded. |
/mod |
( n1 n2 -- rem quot ) |
Remainder, quotient of n1 / n2. |
<< |
( n1 +n -- n2 ) |
Left-shift n1 by +n bits. |
>> |
( n1 +n -- n2 ) |
Right-shift n1 by +n bits. |
>>a |
( n1 +n -- n2 ) |
Arithmetic right-shift n1 by +n bits. |
*/ |
( n1 n2 n3 -- n4 ) |
n1 * n2 / n3. |
*/mod |
( n1 n2 n3 -- rem quot ) |
Remainder, quotient of n1 * n2 / n3. |
1+ |
( n1 -- n2 ) |
Add 1. |
1- |
( n1 -- n2 ) |
Subtract 1. |
2* |
( n1 -- n2 ) |
Multiply by 2. |
2+ |
( n1 -- n2 ) |
Add 2. |
2- |
( n1 -- n2 ) |
Subtract 2. |
2/ |
( n1 -- n2 ) |
Divide by 2. |
abs |
( n -- u ) |
Absolute value. |
aligned |
( n1 -- n2 ) |
Round n1 up to the next multiple of 4. |
and |
( n1 n2 -- n3 ) |
Bitwise logical AND. |
bounds |
( startadr len -- endadr startadr ) |
Convert startadr len to endadr startadr for do loop. |
bljoin |
( b.low b2 b3 b.hi -- long ) |
Join four bytes to form a 32-bit longword. |
bwjoin |
( b.low b.hi -- word ) |
Join two bytes to form a 16-bit word. |
flip |
( word1 -- word2 ) |
Swap the bytes within a 16-bit word. |
lbsplit |
( long -- b.low b2 b3 b.hi ) |
Split a 32-bit longword into four bytes. |
lwsplit |
( long -- w.low w.hi ) |
Split a 32-bit longword into two 16-bit words. |
max |
( n1 n2 -- n3 ) |
n3 is maximum of n1 and n2. |
min |
( n1 n2 -- n3 ) |
n3 is minimum of n1 and n2. |
mod |
( n1 n2 -- rem ) |
Remainder of n1 / n2. |
negate |
( n1 -- n2 ) |
Change the sign of n1. |
not |
( n1 -- n2 ) |
Bitwise ones complement. |
or |
( n1 n2 -- n3 ) |
Bitwise logical OR. |
u*x |
( u1 u2 -- product[64] ) |
Multiply 2 unsigned 32-bit numbers; yield unsigned 64-bit product. |
u/mod |
( u1 u2 -- un.rem un.quot ) |
Divide unsigned 32-bit number by an unsigned 32-bit number; yield 32-bit remainder and quotient. |
u2/ |
( u1 -- u2 ) |
Logical right shift 1 bit; zero shifted into vacated sign bit. |
wbsplit |
( word -- b.low b.hi ) |
Split 16-bit word into two bytes. |
wflip |
( long1 -- long2 ) |
Swap halves of 32-bit longword. |
wljoin |
( w.low w.hi -- long ) |
Join two words to form a longword. |
x+ |
( n1[64] n2[64] -- n3[64] ) |
Add two 64-bit numbers. |
x- |
( n1[64] n2[64] -- n3[64] ) |
Subtract two 64-bit numbers. |
xor |
( n1 n2 -- n3 ) |
Bitwise exclusive OR. |
xu/mod |
( u1[64] u2 -- rem quot ) |
Divide unsigned 64-bit number by unsigned 32-bit number; yield 32-bit remainder and quotient. |
Table E-17 Conversion Operators
Command |
Stack Diagram |
Description |
---|---|---|
/c |
( -- n ) |
The number of bytes in a byte: 1. |
/c* |
( n1 -- n2 ) |
Multiply n1 by /c. |
ca+ |
( adr1 index -- adr2 ) |
Increment adr1 by index times /c. |
ca1+ |
( adr1 -- adr2 ) |
Increment adr1 by /c. |
/L |
( -- n ) |
Number of bytes in a longword; 4. |
/L* |
( n1 -- n2 ) |
Multiply n1 by /L. |
La+ |
( adr1 index -- adr2 ) |
Increment adr1 by index times /L. |
La1+ |
( adr1 -- adr2 ) |
Increment adr1 by /L. |
/n |
( -- n ) |
Number of bytes in a normal; 4. |
/n* |
( n1 -- n2 ) |
Multiply n1 by /n. |
na+ |
( adr1 index -- adr2 ) |
Increment adr1 by index times /n. |
na1+ |
( adr1 -- adr2 ) |
Increment adr1 by /n. |
/w |
( -- n ) |
Number of bytes in a 16-bit word; 2. |
/w* |
( n1 -- n2 ) |
Multiply n1 by /w. |
wa+ |
( adr1 index -- adr2 ) |
Increment adr1 by index times /w. |
wa1+ |
( adr1 -- adr2 ) |
Increment adr1 by /w. |
Table E-18 Memory Access Commands
Command |
Stack Diagram |
Description |
---|---|---|
! |
( n adr16 -- ) |
Store a 32-bit number at adr16, must be 16-bit aligned. |
+! |
( n adr16 -- ) |
Add n to the 32-bit number stored at adr16, must be 16-bit aligned. |
<w@ |
( adr16 -- n ) |
Fetch signed 16-bit word at adr16, must be 16-bit aligned. |
? |
( adr16 -- ) |
Display the 32-bit number at adr16, must be 16-bit aligned. |
@ |
( adr16 -- n ) |
Fetch a 32-bit number from adr16, must be 16-bit aligned. |
2! |
( n1 n2 adr16 -- ) |
Store 2 numbers at adr16, n2 at lower address, must be 16-bit aligned. |
2@ |
( adr16 -- n1 n2 ) |
Fetch 2 numbers from adr16, n2 from lower address, must be 16-bit aligned. |
blank |
( adr u -- ) |
Set u bytes of memory to space (decimal 32). |
c! |
( n adr -- ) |
Store low byte of n at adr. |
c? |
( adr -- ) |
Display the byte at adr. |
c@ |
( adr -- byte ) |
Fetch a byte from adr. |
cmove |
( adr1 adr2 u -- ) |
Copy u bytes from adr1 to adr2, starting at low byte. |
cmove> |
( adr1 adr2 u -- ) |
Copy u bytes from adr1 to adr2, starting at high byte. |
cpeek |
( adr -- false | byte true ) |
Fetch the byte at adr. Return the data and true if the access was successful. Return false if a read access error occurred. |
cpoke |
( byte adr -- okay? ) |
Store the byte to adr. Return true if the access was successful. Return false if a write access error occurred. |
comp |
( adr1 adr2 len -- n ) |
Compare two byte arrays, n = 0 if arrays are identical, n = 1 if first byte that is different is greater in array#1, n = -1 otherwise. |
d! |
( n1 n2 adr64 -- ) |
Store two 32-bit numbers at adr64, must be 64-bit aligned. Order is implementation-dependent. |
d? |
( adr64 -- ) |
Display the two 32-bit numbers at adr64, must be 64-bit aligned. Order is implementation-dependent. |
d@ |
( adr64-- n1 n2 ) |
Fetch two 32-bit numbers from adr64, must be 64-bit aligned. Order is implementation-dependent. |
dump |
( adr len -- ) |
Display len bytes of memory starting at adr. |
erase |
( adr u -- ) |
Set u bytes of memory to 0. |
fill |
( adr size byte -- ) |
Set size bytes of memory to byte. |
L! |
( n adr32 -- ) |
Store a 32-bit number at adr32, must be 32-bit aligned. |
L? |
( adr32 -- ) |
Display the 32-bit number at adr32, must be 32-bit aligned. |
L@ |
( adr32 -- long ) |
Fetch a 32-bit number from adr32, must be 32-bit aligned. |
lflips |
( adr len -- ) |
Exchange 16-bit words within 32-bit longwords in specified region. |
lpeek |
( adr32 -- false | long true ) |
Fetch the 32-bit quantity at adr32. Return the data and true if the access was successful. Return false if a read access error occurred. |
lpoke |
( long adr32 -- okay? ) |
Store the 32-bit quantity at adr32. Return true if the access was successful. Return false if a a write access error occurred. |
move |
( adr1 adr2 u -- ) |
Copy u bytes from adr1 to adr2, handle overlap properly. |
off |
( adr16 -- ) |
Store false (32-bit 0) at adr16. |
on |
( adr16 -- ) |
Store true (32-bit -1) at adr16. |
unaligned-L! |
( long adr -- ) |
Store a 32-bit number, any alignment |
unaligned-L@ |
( adr -- long ) |
Fetch a 32-bit number, any alignment. |
unaligned-w! |
( word adr -- ) |
Store a 16-bit number, any alignment. |
unaligned-w@ |
( adr -- word ) |
Fetch a 16-bit number, any alignment. |
w! |
( n adr16 -- ) |
Store a 16-bit number at adr16, must be 16-bit aligned. |
w? |
( adr16 -- ) |
Display the 16-bit number at adr16, must be 16-bit aligned. |
w@ |
( adr16 -- word ) |
Fetch a 16-bit number from adr16, must be 16-bit aligned. |
wflips |
( adr len -- ) |
Exchange bytes within 16-bit words in specified region. |
wpeek |
( adr16 -- false | word true ) |
Fetch the 16-bit quantity at adr16. Return the data and true if the access was successful. Return false if a read access error occurred. |
wpoke |
( word adr16 -- okay? ) |
Store the 16-bit quantity to adr16. Return true if the access was successful. Return false if a write access error occurred. |
Table E-19 Memory Mapping Commands
Command |
Stack Diagram |
Description |
---|---|---|
alloc-mem |
( size -- virt ) |
Allocate and map size bytes of available memory; return the virtual address. Unmap with free-mem. |
free-mem |
( virt size -- ) |
Free memory allocated by alloc-mem. |
free-virtual |
( virt size -- ) |
Undo mappings created with memmap. |
map? |
( virt -- ) |
Display memory map information for the virtual address. |
memmap |
( phys space size -- virt ) |
Map a region of physical addresses; return the allocated virtual address. Unmap with free-virtual. |
obio |
( -- space ) |
Specify the device address space for mapping. |
obmem |
( -- space ) |
Specify the onboard memory address space for mapping. |
sbus |
( -- space ) |
Specify the SBus address space for mapping. |
Table E-20 Memory Mapping Primitives
Command |
Stack Diagram |
Description |
---|---|---|
cacheable |
( space -- cache-space ) |
Modify the address space so that the subsequent address mapping is made cacheable. |
iomap? |
( virt -- ) |
Display IOMMU page map entry for the virtual address. The stack diagram shown applies to Sun-4m machines. |
iomap-page |
( phys space virt -- ) |
Map physical page given by phys and space to the virtual address. The stack diagram shown applies to Sun-4m machines. |
iomap-pages |
( phys space virt size -- ) |
Perform consecutive iomap-pages to map a region of memory given by size. The stack diagram shown applies to Sun-4m machines. |
iopgmap@ |
( virt -- pte | 0 ) |
Return IOMMU page map entry for the virtual address. The stack diagram shown applies to Sun-4m machines. |
iopgmap! |
( pte virt -- ) |
Store a new page map entry for the virtual address. The stack diagram shown applies to Sun-4m machines. |
map-page |
( phys space virt -- ) |
Map one page of memory starting at address phys on to virtual address virt in the given address space. All addresses are truncated to lie on a page boundary. |
map-pages |
( phys space virt size -- ) |
Perform consecutive map-pages to map a region of memory to the given size. |
map-region |
( region# virt -- ) |
Map a region. |
map-regions |
( region# virt size -- ) |
Map successive regions. |
map-segments |
( smentry virt len -- ) |
Perform consecutive smap!s to map a region of memory. |
pgmap! |
( pmentry virt -- ) |
Store a new page map entry for the virtual address. |
pgmap? |
( virt -- ) |
Display the page map entry (decoded and in English) corresponding to the virtual address. |
pgmap@ |
( virt -- pmentry ) |
Return the page map entry for the virtual address. |
pagesize |
( -- size ) |
Return the size of a page, often 4K (hex 1000). |
rmap! |
( rmentry virt -- ) |
Store a new region map entry for the virtual address. |
rmap@ |
( virt -- rmentry ) |
Return the region map entry for the virtual address. |
segmentsize |
( -- size ) |
Return the size of a segment, often 256K (hex 40000). |
smap! |
( smentry virt -- ) |
Store 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 ) |
Return the segment map entry for the virtual address. |
Table E-21 Cache Manipulation Commands
Command |
Stack Diagram |
Description |
---|---|---|
clear-cache |
( -- ) |
Invalidate all cache entries. |
cache-off |
( -- ) |
Disable the cache. |
cache-on |
( -- ) |
Enable the cache. |
cdata! |
( data offset -- ) |
Store the 32-bit data at the cache offset. |
cdata@ |
( offset -- data ) |
Fetch (return) data from the cache offset. |
ctag! |
( value offset -- ) |
Store the tag value at the cache offset. |
ctag@ |
( offset -- value ) |
Return the tag value at the cache offset. |
flush-cache |
( -- ) |
Write back any pending data from the cache. |
Table E-22 Reading/Writing Machine Registers in Sun-4D Machines
Command |
Stack Diagram |
Description |
---|---|---|
SuperSPARC(TM) Module Register Access |
||
cxr! |
( data -- ) |
Write MMU context register. |
mcr! |
( data -- ) |
Write module control register. |
cxr@ |
( -- data ) |
Read MMU context register. |
mcr@ |
( -- data ) |
Read MMU control register. |
sfsr@ |
( -- data ) |
Read synchronous fault status register. |
sfar@ |
( -- data ) |
Read synchronous fault address register. |
afsr@ |
( -- data ) |
Read asynchronous fault status register. |
afar@ |
( -- data ) |
Read asynchronous fault address register. |
.mcr |
( -- ) |
Display module control register. |
.sfsr |
( -- ) |
Display synchronous fault status register. |
MXCC Interrupt Register Access |
||
interrupt-enable! |
( data -- ) |
Write interrupt mask register. |
interrupt-enable@ |
( -- data ) |
Read interrupt mask register. |
interrupt-pending@ |
( -- data ) |
Read interrupt pending register. |
interrupt-clear! |
( data -- ) |
Write interrupt clear register. |
BootBus Register Access |
||
control! |
( datat -- ) |
Write BootBus control register. |
control@ |
( -- datat ) |
Read BootBus control register. |
status1@ |
( -- datat ) |
Read BootBus status1 register. |
status2@ |
( -- datat ) |
Read BootBus status2 register. |
Table E-23 Reading/Writing Machine Registers in Sun-4M Machines
Command |
Stack Diagram |
Description |
---|---|---|
.mcr |
( -- ) |
Display module control register. |
.mfsr |
( -- ) |
Display memory controller fault status register. |
.sfsr |
( -- ) |
Display synchronous fault status register. |
.sipr |
( -- ) |
Display system interrupt pending register. |
aux! |
( data -- ) |
Write auxiliary register. |
aux@ |
( -- data ) |
Read auxiliary register. |
cxr! |
( data -- ) |
Write MMU context register. |
cxr@ |
( -- data ) |
Read MMU context register. |
interrupt-enable! |
( data -- ) |
Write system interrupt target mask register. |
interrupt-enable@ |
( -- data ) |
Read system interrupt target mask register. |
iommu-ctl! |
( data -- ) |
Write IOMMU control register. |
iommu-ctl@ |
( -- data) |
Read IOMMU control register. |
mcr! |
( data -- ) |
Write module control register. |
mcr@ |
( -- data ) |
Read module control register. |
mfsr! |
( data -- ) |
Write memory controller fault status register. |
mfsr@ |
( -- data ) |
Read memory controller fault status register. |
msafar@ |
( -- data ) |
Read MBus-to-SBus asynchronous fault address register. |
msafsr! |
( data -- ) |
Write MBus-to-SBus asynchronous fault status register. |
msafsr@ |
( -- data ) |
Read MBus-to-SBus asynchronous fault status register. |
sfsr! |
( data -- ) |
Write synchronous fault status register. |
sfsr@ |
( -- data ) |
Read synchronous fault status register. |
sfar! |
( data -- ) |
Write synchronous fault address register. |
sfar@ |
( -- data ) |
Read synchronous fault address register. |
Table E-24 Reading/Writing Machine Registers in Sun-4C Machines
Command |
Stack Diagram |
Description |
---|---|---|
aerr! |
( data -- ) |
Write asynchronous error register. |
aerr@ |
( -- data ) |
Read asynchronous error register. |
averr! |
( data -- ) |
Write asynchronous error virtual address register. |
averr@ |
( -- data ) |
Read asynchronous error virtual address register. |
aux! |
( data -- ) |
Write auxiliary register. |
aux@ |
( -- data ) |
Read auxiliary register. |
context! |
( data -- ) |
Write context register. |
context@ |
( -- data ) |
Read context register (MMU context). |
dcontext@ |
( -- data ) |
Read context register (cache context). |
enable! |
( data -- ) |
Write system enable register. |
enable@ |
( -- data ) |
Read system enable register. |
interrupt-enable! |
( data -- ) |
Write interrupt enable register. |
interrupt-enable@ |
( -- data ) |
Read interrupt enable register. |
serr! |
( data -- ) |
Write synchronous error register. |
serr@ |
( -- data ) |
Read synchronous error register. |
sverr! |
( data -- ) |
Write synchronous error virtual address register. |
sverr@ |
( -- data ) |
Read synchronous error virtual address register. |
Table E-25 Alternate Address Space Access Commands
Command |
Stack Diagram |
Description |
---|---|---|
spacec! |
( byte adr asi -- ) |
Store the byte at asi and address. |
spacec? |
( adr asi -- ) |
Display the byte at asi and address. |
spacec@ |
( adr asi -- byte ) |
Fetch the byte from asi and address. |
spaced! |
( n1 n2 adr asi -- ) |
Store the two 32-bit words at asi and address. Order is implementation-dependent. |
spaced? |
( adr asi -- ) |
Display the two 32-bit words at asi and address. Order is implementation-dependent. |
spaced@ |
( adr asi -- n1 n2 ) |
Fetch the two 32-bit words from asi and address. Order is implementation-dependent. |
spaceL! |
( long adr asi -- ) |
Store the 32-bit word at asi and address. |
spaceL? |
( adr asi -- ) |
Display the 32-bit word at asi and address. |
spaceL@ |
( adr asi -- long ) |
Fetch the 32-bit word from asi and address. |
spacew! |
( word adr asi -- ) |
Store the 16-bit word at asi and address. |
spacew? |
( adr asi -- ) |
Display the 16-bit word at asi and address. |
spacew@ |
( adr asi -- word ) |
Fetch the 16-bit word from asi and address. |
Table E-26 Defining Words
Command |
Stack Diagram |
Description |
---|---|---|
: name |
( -- ) Usage: ( ??? -- ? ) |
Start creating a new colon definition. |
; |
( -- ) |
Finish creating a new colon definition. |
alias new-name old-name |
( -- ) Usage: ( ??? -- ? ) |
Create new-name with the same responses as old-name. |
buffer: name |
( size -- ) Usage: ( -- adr64 ) |
Create a named array in temporary storage. |
constant name |
( n -- ) Usage: ( -- n ) |
Define a constant (for example, 3 constant bar). |
2constant name |
( n1 n2 -- ) Usage: ( -- n1 n2 ) |
Define a 2-number constant. |
create name |
( -- ) Usage: ( -- adr16 ) |
Generic defining word. |
defer name |
( -- ) Usage: ( ??? -- ? ) |
Define a word for forward references or execution vectors using code field address. |
does> |
( -- adr16 ) |
Start the run-time clause for defining words. |
field name |
( offset size -- offset+size ) Usage: ( adr -- adr+offset ) |
Create a named offset pointer. |
struct |
( -- 0 ) |
Initialize for field creation. |
value name |
( n -- ) Usage: ( -- n ) |
Create a changeable, named 32-bit quantity. |
variable name |
( -- ) Usage: ( -- adr16 ) |
Define a variable. |
Table E-27 Dictionary Searching Commands
Command |
Stack Diagram |
Description |
---|---|---|
' name |
( -- acf ) |
Find the named word in the dictionary. Returns the code field address. Use outside definitions. |
['] name |
( -- acf ) |
Similar to ' but is used either inside or outside definitions. |
.calls |
( acf -- ) |
Display a list of all words that call the word whose compilation address is acf. |
$find |
( adr len -- adr len false | acf n ) |
Find a word. n = 0 if not found, n = 1 if immediate, n = -1 otherwise. |
find |
( pstr -- pstr false | acf n ) |
Search for a word in the dictionary. The word to be found is indicated by pstr. n = 0 if not found, n = 1 if immediate, n = -1 otherwise. |
see thisword |
( -- ) |
Decompile the named command. |
(see) |
( acf -- ) |
Decompile the word indicated by the code field address. |
sift |
( pstr -- ) |
Display names of all dictionary entries containing the string pointed to by pstr. |
sifting ccc |
( -- ) |
Display names of all dictionary entries containing the sequence of characters. ccc contains no spaces. |
words |
( -- ) |
Display all visible words in the dictionary. |
Table E-28 Dictionary Compilation Commands
Command |
Stack Diagram |
Description |
---|---|---|
, |
( n -- ) |
Place a number in the dictionary. |
c, |
( byte -- ) |
Place a byte in the dictionary. |
w, |
( word -- ) |
Place a 16-bit number in the dictionary. |
L, |
( long -- ) |
Place a 32-bit number in the dictionary. |
[ |
( -- ) |
Begin interpreting. |
] |
( -- ) |
End interpreting, resume compilation. |
allot |
( n -- ) |
Allocate n bytes in the dictionary. |
>body |
( acf -- apf ) |
Find parameter field address from compilation address. |
body> |
( apf -- acf ) |
Find compilation address from parameter field address. |
compile |
( -- ) |
Compile next word at run time. |
[compile] name |
( -- ) |
Compile the next (immediate) word. |
forget name |
( -- ) |
Remove word from dictionary and all subsequent words. |
here |
( -- adr ) |
Address of top of dictionary. |
immediate |
( -- ) |
Mark the last definition as immediate. |
is name |
( n -- ) |
Install a new action in a defer word or value. |
literal |
( n -- ) |
Compile a number. |
origin |
( -- adr ) |
Return the address of the start of the Forth system. |
patch new-word old-word word-to-patch |
( -- ) |
Replace old-word with new-word in word-to-patch. |
(patch |
( new-n old-n acf -- ) |
Replace old-n with new-n in word indicated by acf. |
recursive |
( -- ) |
Make the name of the colon definition being compiled visible in the dictionary, and thus allow the name of the word to be used recursively in its own definition. |
state |
( -- adr ) |
Variable that is non-zero in compile state. |
Table E-29 Assembly Language Programming
Command |
Stack Diagram |
Description |
---|---|---|
code name |
( -- ) Usage: ( ??? -- ? ) |
Begin 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; |
( -- ) |
End the creation of an assembly language routine. Automatically assemble the Forth interpreter next function so that the created assembly-code word, when executed, returns control to the calling routine as usual. |
label name |
( -- ) Usage: ( -- adr16 ) |
Begin 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 |
( -- ) |
End the assembly language patch started with label. |
Table E-30 Basic Number Display
Command |
Stack Diagram |
Description |
---|---|---|
. |
( n -- ) |
Display a number in the current base. |
.r |
( n size -- ) |
Display a number in a fixed width field. |
.s |
( -- ) |
Display contents of data stack. |
showstack |
( -- ) |
Execute .s automatically before each ok prompt. |
u. |
( u -- ) |
Display an unsigned number. |
u.r |
( u size -- ) |
Display an unsigned number in a fixed width field. |
Table E-31 Changing the Number Base
Command |
Stack Diagram |
Description |
---|---|---|
base |
( -- adr ) |
Variable containing number base. |
binary |
( -- ) |
Set the number base to 2. |
decimal |
( -- ) |
Set the number base to 10. |
d# number |
( -- n ) |
Interpret the next number in decimal; base is unchanged. |
hex |
( -- ) |
Set the number base to 16. |
h# number |
( -- n ) |
Interpret the next number in hex; base is unchanged. |
.d |
( n -- ) |
Display n in decimal without changing base. |
.h |
( n -- ) |
Display n in hex without changing base. |
Table E-32 Numeric Output Word Primitives
Command |
Stack Diagram |
Description |
---|---|---|
# |
( +L1 -- +L2 ) |
Convert a digit in pictured numeric output. |
#> |
( L -- adr +n ) |
End pictured numeric output. |
<# |
( -- ) |
Initialize pictured numeric output. |
(.) |
( n -- ) |
Convert a number to a string. |
(u.) |
( -- adr len ) |
Convert unsigned to string. |
digit |
( char base -- digit true | char false ) |
Convert a character to a digit. |
hold |
( char -- ) |
Insert the char in the pictured numeric output string. |
$number |
( adr len -- true | n false ) |
Convert a string to a number. |
#s |
( L -- 0 ) |
Convert the rest of the digits in pictured numeric output. |
sign |
( n -- ) |
Set sign of pictured output. |
Table E-33 Controlling Text Input
Command |
Stack Diagram |
Description |
---|---|---|
( ccc ) |
( -- ) |
Begin a comment. |
\ rest-of-line |
( -- ) |
Skip the rest of the line. |
ascii ccc |
( -- char ) |
Get numerical value of first ASCII character of next word. |
expect |
( adr +n -- ) |
Get a line of edited input from the assigned input device's keyboard; store at adr. |
key |
( -- char ) |
Read a character from the assigned input device's keyboard. |
key? |
( -- flag ) |
True if a key has been typed on the input device's keyboard. |
span |
( -- adr16 ) |
Variable containing the number of characters read by expect. |
word |
( char -- pstr ) |
Collect a string delimited by char from input string and place in memory at pstr. |
Table E-34 Displaying Text Output
Command |
Stack Diagram |
Description |
---|---|---|
." ccc" |
( -- ) |
Compile a string for later display. |
(cr |
( -- ) |
Move the output cursor back to the beginning of the current line. |
cr |
( -- ) |
Terminate a line on the display and go to the next line. |
emit |
( char -- ) |
Display the character. |
exit? |
( -- flag ) |
Enable the scrolling control prompt: More [<space>,<cr>,q] ? The return flag is true if the user wants the output to be terminated. |
space |
( -- ) |
Display a space character. |
spaces |
( +n -- ) |
Display +n spaces. |
type |
( adr +n -- ) |
Display n characters. |
Table E-35 Formatted Output
Command |
Stack Diagram |
Description |
---|---|---|
#line |
( -- adr16 ) |
Variable holding the line number on the output device. |
#out |
( -- adr16 ) |
Variable holding the column number on the output device. |
Table E-36 Manipulating Text Strings
Command |
Stack Diagram |
Description |
---|---|---|
", |
( adr len -- ) |
Compile an array of bytes from adr of length len, at the top of the dictionary as a packed string. |
" ccc" |
( -- adr len ) |
Collect an input stream string, either interpreted or compiled. Within the string, "(00,ff...) can be used to include arbitrary byte values. |
.( ccc) |
( -- ) |
Display a string immediately. |
-trailing |
( adr +n1 -- adr +n2 ) |
Remove trailing spaces. |
bl |
( -- char ) |
ASCII code for the space character; decimal 32. |
count |
( pstr -- adr +n ) |
Unpack a packed string. |
lcc |
( char -- lowercase-char ) |
Convert a character to lowercase. |
left-parse-string |
( adr len char -- adrR lenR adrL lenL ) |
Split a string at the given delimiter (which is discarded). |
pack |
( adr len pstr -- pstr ) |
Make a packed string from adr len; place it at pstr. |
p" ccc" |
( -- pstr ) |
Collect a string from the input stream; store as a packed string. |
upc |
( char -- uppercase-char ) |
Convert a character to uppercase. |
Table E-37 I/O Redirection Commands
Command |
Stack Diagram |
Description |
---|---|---|
input |
( device -- ) |
Select device (ttya, ttyb, keyboard, or " device-specifier") for subsequent input. |
io |
( device -- ) |
Select device for subsequent input and output. |
output |
( device -- ) |
Select device (ttya, ttyb, screen, or " device-specifier") for subsequent output. |
Table E-38 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. |
Table E-39 Line Editor Commands
Command |
Function |
---|---|
Control-A |
Go to start of line. |
Control-B |
Go backward one character. |
Control-D |
Erase this character. |
Control-E |
Go to end of line. |
Control-F |
Go forward one character. |
Control-H |
Erase previous character (also Delete or Back Space keys). |
Control-K |
Erase forward, from here to end of line. |
Control-L |
Show command history list, then re-type line. |
Control-N |
Recall subsequent command line. |
Control-P |
Recall previous command line. |
Control-Q |
Quote next character (to type a control character). |
Control-R |
Re-type line. |
Control-U |
Erase entire line. |
Control-W |
Erase previous word. |
Control-Y |
Insert save buffer contents before the cursor. |
Control-space |
Complete the current command. |
Control-/ |
Show all possible matches/completions. |
Control-? |
Show all possible matches/completions. |
Control-} |
Show all possible matches/completions. |
Esc-B |
Go backward one word. |
Esc-D |
Erase this portion of word, from here to end of word. |
Esc-F |
Go forward one word. |
Esc-H |
Erase previous portion of word (also Control-W). |
Table E-40 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 <> 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. |
Table E-41 if-then-else Commands
Command |
Stack Diagram |
Description |
---|---|---|
else |
( -- ) |
Execute the following code if if failed. |
if |
( flag -- ) |
Execute following code if flag is true. |
then |
( -- ) |
Terminate if...then...else. |
Table E-42 case Statement Commands
Command |
Stack Diagram |
Description |
---|---|---|
case |
( selector -- selector ) |
Begin a case...endcase conditional. |
endcase |
( selector | {empty} -- ) |
Terminate a case...endcase conditional. |
endof |
( -- ) |
Terminate an of...endof clause within a case...endcase |
of |
( selector test-value -- selector | {empty} ) |
Begin an of...endof clause within a case conditional. |
Table E-43 begin (Conditional) Loop Commands
Command |
Stack Diagram |
Description |
---|---|---|
again |
( -- ) |
End a begin...again infinite loop. |
begin |
( -- ) |
Begin a begin...while...repeat, begin...until, or begin...again loop. |
repeat |
( -- ) |
End a begin...while...repeat loop. |
until |
( flag -- ) |
Continue executing a begin...until loop until flag is true. |
while |
( flag -- ) |
Continue executing a begin...while...repeat loop while flag is true. |
Table E-44 do (Counted) Loop Commands
Command |
Stack Diagram |
Description |
---|---|---|
+loop |
( n -- ) |
End a do...+loop construct; add n to loop index and return to do (if n < 0, index goes from start to end inclusive). |
?do |
( end start -- ) |
Begin ?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 -- ) |
Exit from a do...loop if flag is non-zero. |
do |
( end start -- ) |
Begin 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 ) |
Loop index. |
j |
( -- n ) |
Loop index for next enclosing loop. |
leave |
( -- ) |
Exit from do...loop. |
loop |
( -- ) |
End of do...loop. |
Table E-45 Program Execution Control Commands
Command |
Stack Diagram |
Description |
---|---|---|
abort |
( -- ) |
Abort current execution and interpret keyboard commands. |
abort" ccc" |
( abort? -- ) |
If flag is true, abort and display message. |
eval |
( adr len -- ) |
Interpret Forth source from an array. |
execute |
( acf -- ) |
Execute the word whose code field address is on the stack. |
exit |
( -- ) |
Return from the current word. (Cannot be used in counted loops.) |
quit |
( -- ) |
Same as abort, but leave stack intact. |
Table E-46 File Loading Commands
Command |
Stack Diagram |
Description |
---|---|---|
?go |
( -- ) |
Execute Forth, FCode, or binary programs. |
boot [specifiers] -h |
( -- ) |
Load file from specified source. |
byte-load |
( adr span -- ) |
Interpret loaded FCode binary file. span is usually 1. |
dl |
( -- ) |
Load a Forth file over a serial line with TIP and interpret. Type: ~C cat filename ^-D |
dlbin |
( -- ) |
Load a binary file over a serial line with TIP. Type: ~C cat filename |
dload filename |
( adr -- ) |
Load the specified file over Ethernet at the given address. |
eval |
( adr len -- ) |
Interpret loaded Forth text file. |
go |
( -- ) |
Begin executing a previously-loaded binary program, or resume executing an interrupted program. |
init-program |
( -- ) |
Initialize to execute a binary file. |
load device-specifier argument |
( -- ) |
Load data from specified device into memory at the address given by load-base. |
load-base |
( -- adr ) |
Address at which load places the data it reads from a device. |
Table E-47 Disassembler Commands
Command |
Stack Diagram |
Description |
---|---|---|
+dis |
( -- ) |
Continue disassembling where the last disassembly left off. |
dis |
( adr -- ) |
Begin disassembling at the given address. |
Table E-48 SPARC Register Commands
Command |
Stack Diagram |
Description |
---|---|---|
%f0 through %f31 |
( -- value ) |
Return the value in the given floating point register. |
%fsr |
( -- value ) |
Return the value in the given floating point register. |
%g0 through %g7 |
( -- value ) |
Return the value in the given register. |
%i0 through %i7 |
( -- value ) |
Return the value in the given register. |
%L0 through %L7 |
( -- value ) |
Return the value in the given register. |
%o0 through %o7 |
( -- value ) |
Return the value in the given register. |
%pc %npc %psr |
( -- value ) |
Return the value in the given register. |
%y %wim %tbr |
( -- value ) |
Return the value in the given register. |
.fregisters |
( -- ) |
Display values in %f0 through %f31. |
.locals |
( -- ) |
Display the values in the i, L and o registers. |
.psr |
( -- ) |
Formatted display of the %psr data. |
.registers |
( -- ) |
Display values in %g0 through %g7, plus %pc, %npc, %psr, %y, %wim, %tbr. |
.window |
( window# -- ) |
Same as w .locals; display the desired window. |
ctrace |
( -- ) |
Display the return stack showing C subroutines. |
set-pc |
( value -- ) |
Set %pc to the given value, and set %npc to (value+4). |
to regname |
( value -- ) |
Change the value stored in any of the above registers. Use in the form: value to regname. |
w |
( window# -- ) |
Set the current window for displaying %ix, %Lx, or %ox. |
Table E-49 Breakpoint Commands
Command |
Stack Diagram |
Description |
---|---|---|
+bp |
( adr -- ) |
Add a breakpoint at the given address. |
-bp |
( adr -- ) |
Remove the breakpoint at the given address. |
--bp |
( -- ) |
Remove the most-recently-set breakpoint. |
.bp |
( -- ) |
Display all currently set breakpoints. |
.breakpoint |
( -- ) |
Perform 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 action is .instruction. To perform multiple actions, create a single definition which calls all desired actions, then load that word into .breakpoint. |
.instruction |
( -- ) |
Display the address, opcode for the last-encountered breakpoint. |
.step |
( -- ) |
Perform a specified action when a single step occurs (see .breakpoint). |
bpoff |
( -- ) |
Remove all breakpoints. |
finish-loop |
( -- ) |
Execute until the end of this loop. |
go |
( -- ) |
Continue 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 -- ) |
Execute go n times. |
hop |
( -- ) |
(Like the step command.) Treat a subroutine call as a single instruction. |
hops |
( n -- ) |
Execute hop n times. |
return |
( -- ) |
Execute until the end of this subroutine. |
returnL |
( -- ) |
Execute until the end of this leaf subroutine. |
skip |
( -- ) |
Skip (do not execute) the current instruction. |
step |
( -- ) |
Single-step one instruction. |
steps |
( n -- ) |
Execute step n times. |
till |
( adr -- ) |
Execute until the given address is encountered. Equivalent to +bp go. |
Table E-50 Forth Source-level Debugger Commands
Command |
Description |
---|---|
C |
"Continue". Switch from stepping to tracing, thus tracing the remainder of the execution of the word being debugged. |
D |
"Down a level". Mark for debugging the word whose name was just displayed, then execute it. |
F |
Start a subordinate Forth interpreter. When that interpreter exits (with resume), control returns to the debugger at the place where the F command was executed. |
Q |
"Quit". Abort the execution of the word being debugged and all its callers and return to the command interpreter. |
U |
"Up a level". Un-mark the word being debugged, mark its caller for debugging, and finish executing the word that was previously being debugged. |
debug name |
Mark the named Forth word for debugging. Enter the Forth Source-level Debugger with any subsequent attempts to execute that word. 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 ".".) |
debug-off |
Turn off the Forth Source-level Debugger so that no word is being debugged. |
resume |
Exit from a subordinate interpreter, and go back to the stepper (see the F command in this table). |
stepping |
Set 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 |
Set trace mode for the Forth Source-level Debugger. This traces the execution of the word being debugged, while showing the name and stack contents for each word called by that word. |
Space |
Execute the word just displayed and proceed to the next word. |
Table E-51 Time Utilities
Command |
Stack Diagram |
Description |
---|---|---|
get-msecs |
( -- ms ) |
Return the approximate current time in milliseconds. |
ms |
( n -- ) |
Delay for n milliseconds. Resolution is 1 millisecond. |
Table E-52 Miscellaneous Operations
Command |
Stack Diagram |
Description |
---|---|---|
callback string |
( value -- ) |
Call SunOS(TM)TM with the given value and string. |
catch |
( ??? acf -- ? error-code ) |
Execute acf; return throw error code or 0 if throw is not called. |
eject-floppy |
( -- ) |
Eject the diskette from the floppy drive. |
firmware-version |
(-- n) |
Return major/minor CPU firmware version (that is, 0x00020001 = firmware version 2.1). |
forth |
( -- ) |
Restore main Forth vocabulary to top of search order. |
ftrace |
( -- ) |
Show calling sequence when exception occurred. |
noop |
( -- ) |
Do nothing. |
old-mode |
( -- ) |
Go to Restricted Monitor. |
reset |
( -- ) |
Reset the entire system (similar to a power-cycle). |
ramforth |
( -- ) |
Copy Forth dictionary to RAM. (Speeds up interpretation in some systems and enables system word patching.) |
romforth |
( -- ) |
Turn off ramforth. |
sync |
( -- ) |
Call the operating system to write any pending information to the hard disk. Also boot after sync-ing file systems. |
throw |
( error-code -- ) |
Return given error code to catch. |
Table E-53 Multiprocessor Commands
Command |
Stack Diagram |
Description |
---|---|---|
module-info |
( -- ) |
Display type and speed of all CPU modules. |
switch-cpu |
( cpu# -- ) |
Switch to indicated CPU. |
Table E-54 Emergency Keyboard Commands
Command |
Description |
---|---|
Stop |
Bypass 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 |
Abort. |
Stop-D |
Enter diagnostic mode (set diag-switch? to true). |
Stop-F |
Enter Forth on TTYA instead of probing. Use fexit to continue with the initialization sequence. Useful if hardware is broken. |
Stop-N |
Reset NVRAM contents to default values. |