Writing FCode 2.x Programs
この本のみを検索
PDF 文書ファイルをダウンロードする

FCode Reference

A

FCode Primitives

This appendix contains four lists:
  • FCodes sorted according to functional group
  • FCodes sorted by byte value
  • FCodes sorted alphabetically by name
  • Version 2 FCodes listed alphabetically

FCodes by Function

The following tables describe FCodes currently supported by the OpenBoot PROM. New 2.0 FCodes are indicated by V2. Both the FCode token values and Forth names are included. A token value entry of CR indicates a cross-compiler-generated sequence, while - indicates that no FCode is generated.
Table A-1 Stack Manipulation
ValueFunctionStackDescription
51depth( -- +n )How many items on stack?
46drop( n -- )Removes n from the stack
522drop( n1 n2 -- )Removes 2 items from stack
47dup( n -- n n )Duplicates n
532dup( n1 n2 -- n1 n2 n1 n2 )Duplicates 2 stack items
50?dup( n -- n n | 0 )Duplicates n if it is non-zero
CR3dup( n1 n2 n3 -- n1 n2 n3 n1 n2 n3 )Copies top 3 stack items
4dnip( n1 n2 -- n2 )Discards the second stack item
48over( n1 n2 -- n1 n2 n1 )Copies second stack item to top of stack
542over( n1 n2 n3 n4 -- n1 n2 n3 n4 n1 n2 )Copies 2 stack items
4epick( +n -- n2 )Copies +n-th stack item
30>r( n -- ) ( rs: -- n)Moves a stack item to the return stack*
31r>( -- n ) ( rs: n -- )Moves item from return stack to data stack*
32r@( -- n ) ( rs: -- )Copies the top of the return stack to the data stack
4froll( +n -- )Rotates +n stack items
4arot( n1 n2 n3 -- n2 n3 n1 )Rotates 3 stack items
4b-rot( n1 n2 n3 -- n3 n1 n2 )Shuffles top 3 stack items
562rot( n1 n2 n3 n4 n5 n6 -- n3 n4 n5 n6 n1 n2 )Rotates 3 pairs of stack items
49swap( n1 n2 -- n2 n1 )Exchanges the top 2 stack items
552swap( n1 n2 n3 n4 -- n3 n4 n1 n2 )Exchanges 2 pairs of stack items
4ctuck( n1 n2 -- n2 n1 n2 )Copies the top stack item below the second item
* Use these FCodes cautiously.
Table A-2 Arithmetic Operations
ValueFunctionStackDescription
20*( n1 n2 -- n3 )Multiplies n1 times n2
1e+( n1 n2 -- n3 )Adds n1+n2
1f-( n1 n2 -- n3 )Subtracts n1-n2
21/( n1 n2 -- quot )Divides n1/n2
CR1+( n1 -- n2 )Adds one
CR1-( n1 -- n2 )Subtracts one
592*( n1 -- n2 )Multiplies by 2
572/( n1 -- n2 )Divides by 2
27<<( n1 +n -- n2 )Left shifts n1 by +n places
28>>( n1 +n -- n2 )Right shifts n1 by +n places
CR<<a( n1 +n -- n2 )Arithmetic left shifts (same as <<)
29>>a( n1 +n -- n2 )Arithmetic right shifts n1 by +n places
2dabs( n -- u )Absolute value
aealigned( adr1 -- adr2 )Adjusts an address to a machine word boundary
23and( n1 n2 -- n3 )Logical and
acbounds( startadr len -- endadr startadr )Converts start,len to end,start for do loop
2fmax( n1 n2 -- n3 )n3 is maximum of n1 and n2
2emin( n1 n2 -- n3 )n3 is minimum of n1 and n2
22mod( n1 n2 -- rem )Remainder of n1/n2
CR*/mod( n1 n2 n3 -- rem quot )Remainder, quotient of n1*n2/n3
2a/mod( n1 n2 -- rem quot )Remainder, quotient of n1/n2
2cnegate( n1 -- n2 )Changes the sign of n1
26not( n1 -- n2 )One's complement
24or( n1 n2 -- n3 )Logical or
2bu/mod( ul un -- un.rem un.quot )Unsigned 32-bit divide of ul/un
58u2/( u1 -- u2 )Logical right shifts 1 bit
25xor( n1 n2 -- n3 )Exclusive or
d4u*x( u1[32] u2[32] -- product[64] )Multiplies two unsigned 32-bit numbers, yields an unsigned 64-bit product. V2
d5xu/mod( u1[64] u2[32] -- remainder[32] quot[32] )Divides an unsigned 64-bit number by an unsigned 32-bit number, yields a 32-bit remainder and quotient V2
d8x+( x1 x2 -- x3 )Adds two 64-bit numbers V2
d9x-( x1 x2 -- x3 )Subtracts two 64-bit numbers V2
Table A-3 Memory Operations
ValueFunctionStackDescription
72!( n adr -- )Stores a 32-bit number into the variable at adr
6c+!( n adr -- )Adds n to the 32-bit number stored in the variable at adr
772!( n1 n2 adr -- )Stores 2 numbers at adr; n2 at lower address
762@( adr -- n1 n2 )Fetches 2 numbers from adr; n2 from lower address
6d@( adr -- n )Fetches a number from the variable at adr
CR?( adr -- )Displays the 32-bit number at adr
75c!( n adr -- )Stores low byte of n at adr
71c@( adr -- byte )Fetches a byte from adr
CRblank( adr len -- )Sets len bytes of memory to ASCII space, starting at adr
CRcmove( adr1 adr2 u -- )Same as move
CRcmove>( adr1 adr2 u -- )Same as move
7acomp( adr1 adr2 len -- n )Compares two byte arrays including case. n=0 if same
CRerase( adr len -- )Sets len bytes of memory to zero, starting at adr
79fill( adr u byte -- )Sets u bytes of memory to byte
0237lflips( adr len -- )Exchanges 16-bit words within 32-bit longwords in adr len V2
73l!( l adr -- )Stores the 32-bit number at adr, must be 32-bit aligned
6el@( adr -- l )Fetches the 32-bit longword at adr, must be 32-bit aligned
78move( adr1 adr2 u -- )Copies u bytes from adr1 to adr2, handles overlap correctly.
6boff( adr -- )Stores false (32-bit 0) at adr
6aon( adr -- )Stores true (32-bit -1) at adr
0236wflips( adr len -- )Exchanges bytes within 16-bit words in the specified region V2
74w!( w adr -- )Stores a 16-bit word at adr, must be 16-bit aligned
6fw@( adr -- w )Fetches the unsigned 16-bit word at adr, must be 16-bit aligned
70<w@( adr -- n )Fetches the signed 16-bit word at adr, must be 16-bit aligned
Table A-4 Atomic Access
ValueFunctionStackDescription
0230rb@( adr -- byte )Reads the 8-bit value at the given address, atomically V2
0231rb!( byte adr -- )Writes the 8-bit value at the given address, atomically V2
0232rw@( adr -- word )Reads the 16-bit value at the given address, atomically V2
0233rw!( word adr -- )Writes the 16-bit value at the given address, atomically V2
0234rl@( adr -- long )Reads the 32-bit value at the given address, atomically V2
0235rl!( long adr -- )Writes the 32-bit value at the given address, atomically V2
Table A-5 Data Exception Tests
Value FunctionStackDescription
0220 cpeek( adr -- false | byte true )Reads the 8-bit value at the given address, returns false if unsuccessful V2
0221 wpeek( adr -- false | word true )Reads the 16-bit value at the given address, returns false if unsuccessful V2
0222 lpeek( adr -- false | long true )Reads the 32-bit value at the given address, returns false if unsuccessful V2
0223 cpoke( byte adr -- ok? )Writes the 8-bit value at the given address, returns false if unsuccessful V2
0224 wpoke( word adr -- ok? )Writes the 16-bit value at the given address, returns false if unsuccessful V2
0225 lpoke( long adr -- ok? )Writes the 32-bit value at the given address, returns false if unsuccessful V2
Table A-6 Comparison Operations
ValueFunctionStackDescription
360<( n -- flag )True if n < 0
370<=( n -- flag )True if n <= 0
350<>( n -- flag )True if n <> 0
340=( n -- flag )True if n = 0, also inverts any flag
380>( n -- flag )True if n > 0
390>=( n -- flag )True if n >= 0
3a<( n1 n2 -- flag )True if n1 < n2
43<=( n1 n2 -- flag )True if n1 <= n2
3d<>( n1 n2 -- flag )True if n1 <> n2
3c=( n1 n2 -- flag )True if n1 = n2
3b>( n1 n2 -- flag )True if n1 > n2
42>=( n1 n2 -- flag )True if n1 >= n2
44between( n min max -- flag )True if min <= n <= max
CRfalse( -- 0 )The value false
CRtrue( -- -1 )The value true
40u<( u1 u2 -- flag )True if u1 < u2, unsigned
3fu<=( u1 n2 -- flag )True if u1 <= u2, unsigned
ValueFunctionStack........Description
3eu>( u1 n2 -- flag )....True if u1 > u2, unsigned
41u>=( u1 n2 -- flag )....True if u1 >= u2, unsigned
45within( n min max -- flag ) True if min <= n < max


Table A-7 Text Input
ValueFunctionStack....Description
-( text)( -- ).....Begins a comment (ignored)
-\( -- ).....Ignore rest of line (comment)
CRascii x( -- char )..ASCII value of next character
CRcontrol x( -- char )..Interprets next character as ASCII control character
8ekey( -- char )..Reads a character from the keyboard
8dkey?( -- flag )...True if a key has been typed on the keyboard
8aexpect( adr +n -- ) Gets a line of edited input from the keyboard; store at adr
88span( -- adr )...Variable containing the number of characters read by expect
-(s text)( -- ).....Begins a comment (ignored)
Table A-8 ASCII Constants
ValueFunctionStackDescription
abbell( -- n )The ASCII code for the bell character; decimal 7
a9bl( -- n )The ASCII code for the space character; decimal 32
aabs( -- n )The ASCII code for the backspace character; decimal 8
CRcarret( -- n )The ASCII code for the carriage return character; decimal 13
CRlinefeed( -- n )The ASCII code for the linefeed character; decimal 10
CRnewline( -- n )The ASCII code for the newline character; decimal 10
Table A-9 Numeric Input
ValueFunctionStackDescription
a4-1( -- -1 )Constant -1
a50( -- 0 )Constant 0
a61( -- 1 )Constant 1
a72( -- 2 )Constant 2
a83( -- 3 )Constant 3
CRb# number( -- n )Interprets next number in binary
ValueFunctionStack....Description
-binary( -- ).....If outside definition, input text in binary
CRd# number( -- n )....Interprets next number in decimal
-decimal( -- ).....If outside definition, input text in decimal
CRh# number( -- n )....Interprets next number in hexadecimal
-hex( -- ).....If outside definition, input text in hexadecimal
CRo# number( -- n )....Interprets next number in octal
-octal( -- ).....If outside definition, input text in octal


Table A-10 Numeric Primitives
ValueFunctionStack..............Description
99#( +l1 -- +l2 )...........Converts a digit in pictured numeric output
97#>( l -- adr +n )...........Ends pictured numeric output
96<#( -- )...............Initializes pictured numeric output
a0base( -- adr ).............Variable containing number base
a3digit( char base -- digit true | char false ) Converts a character to a digit
95hold( char -- )............Inserts the char in the pictured numeric output string
9a#s( +l -- 0 )............Converts the rest of the digits in pictured numeric output
98sign( n -- )..............Sets sign of pictured output
a2$number( adr len -- true | n false ).....Converts a string to a number V2
Table A-11 Numeric Output
ValueFunctionStackDescription
9d.( n -- )Displays a number
CR.d( n -- )Displays number in decimal
CRbinary( -- )If inside definition, output in binary
CRdecimal( -- )If inside definition, output in decimal
CR.h( n -- )Displays number in hexadecimal
CRhex( -- )If inside definition, output in hexadecimal
CRoctal( -- )If inside definition, output in octal
9e.r( n +n -- )Displays a number in a fixed width field
9f.s( -- )Displays the contents of the data stack
CRs.( n -- )Displays n as a signed number
9bu.( u -- )Displays an unsigned number
9cu.r( u +n -- )Prints an unsigned number in a fixed width field
Table A-12 General-purpose Output
ValueFunctionStackDescription
CR." text"( -- )Compiles string for later output
CR.( text)( -- )Displays a string now
91(cr( -- )Outputs ASCII CR character; decimal 13
92cr( -- )Starts a new line of display output
8femit( char -- )Displays the character
CRspace( -- )Outputs a single space character
CRspaces( +n -- )Outputs +n spaces
90type( adr +n -- )Displays n characters
Table A-13 Formatted Output
ValueFunctionStackDescription
94#line( -- adr )Variable holding the line number on the output device
93#out( -- adr )Variable holding the column number on the output device
Table A-14 begin Loops
ValueFunctionStackDescription
CRagain( -- )Ends begin..again (infinite) loop
CRbegin( -- )Starts conditional loop
CRrepeat( -- )Returns to loop start
CRuntil( flag -- )If true, exits begin..until loop
CRwhile( flag -- )If true, continues begin..while..repeat loop, else exits loop
Table A-15 Conditionals
ValueFunctionStackDescription
CRif( flag -- )If true, executes next FCode(s)
CRelse( -- )(optional) Executes next FCode(s) if if failed
CRthen( -- )Terminates if..else..then
Table A-16 do Loops
ValueFunctionStackDescription
CRdo( end start -- )Loops, index start to end-1 inclusive
CR?do( end start -- )Like do, but skips loop if end = start
19i( -- n )Returns current loop index value
1aj( -- n )Returns value of next outer loop index
CRleave( -- )Exits do loop immediately
CR?leave( flag -- )If flag is true, exits do loop
CRloop( -- )Increments index, returns to do
CR+loop( n -- )Increments by n, returns to do. If n<0, index start to end
Table A-17 Control Words
ValueFunctionStackDescription
1dexecute( acf -- )Executes the word whose compilation address is on the stack
33exit( -- )Returns from the current word
0238probe( arg-adr arg-len reg-adr reg-len fcode-adr fcode-len -- )V2.2
0239probe-virtual( arg-adr arg-len reg-adr reg-len fcode-adr -- )V2.2
Table A-18 Strings
ValueFunctionStackDescription
CR" text"( -- adr len )Collects a string
84count( pstr -- adr +n )Unpacks a packed string
82lcc( char -- lower-case-char )Converts char to lower case
83pack( adr len pstr -- pstr )Makes a packed string from adr len, placing it at pstr
81upc( char -- upper-case-char )Converts char to upper case
0240left-parse-string( adr len char -- adrR lenR adrL lenL )Splits a string at the given delimiter (which is discarded) V2
011bdecode-2int( adr len -- phys space )Converts a string into a physical address and space V2
Table A-19 Defining Words
ValueFunctionStackDescription
CR: (colon) name( -- )Begins colon definition
CR; (semicolon)( -- )Ends colon definition
-alias newnameoldname( -- )Creates newname with behavior of oldname
CRbuffer: name( size -- )Creates data array of size bytes
CRconstant name( n -- )Creates a constant
CRcreate name( -- )Generic defining word
CRdefer name( -- )Execution vector (change with is)
CRfield name( offset size -- offset+size )Creates a named offset pointer
c0instance( -- )Declare a data type to be local V2.1
CRstruct( -- 0 )Initializes for field creation
CRvariable name( -- )Creates a data variable
CRvalue name( n -- )Creates named value-type variable (change with is)
Table A-20 Dictionary Compilation
ValueFunctionStackDescription
d3,( n -- )Places a number in the dictionary
d0c,( n -- )Places a byte in the dictionary
adhere( -- adr )Address of top of dictionary
d2l,( l -- )Places a 32-bit longword in the dictionary
d1w,( w -- )Places a 16-bit word in the dictionary
CRis name( n -- )Changes value in a defer word or a value
Table A-21 Dictionary Search
ValueFunctionStackDescription
CR' name( -- acf )Finds the word (while executing)
CR['] name( -- acf )Finds word (while compiling)
cb$find( adr len -- adr len false | acf +-1 )Finds a name in the OpenBoot PROM
cdeval( ??? adr len -- ? )Executes Forth commands within a string V2
Table A-22 Conversions Operators
ValueFunctionStackDescription
7fbljoin( b.low b2 b3 b.hi -- l )Joins four bytes to form a longword
b0bwjoin( b.low b.hi -- w )Joins two bytes to form a 16-bit word
5a/c( -- n )Address increment for a byte; 1
66/c*( n1 -- n2 )Multiplies by /c
5eca+( adr1 index -- adr2 )Increments adr1 by index times /c
62ca1+( adr1 -- adr2 )Increments adr1 by /c
80flip( w1 -- w2 )Swaps the bytes within a 16-bit word
5c/l( -- n )Address increment for a 32-bit longword; 4
68/l*( n1 -- n2 )Multiplies by /l
60la+( adr1 index -- adr2 )Increments adr1 by index times /l
64la1+( adr1 -- adr2 )Increments adr1 by /l
7elbsplit( l -- b.low b2 b3 b.high )Splits a longword into four bytes
7clwsplit( l -- w.low w.high )Splits a longword into two words
5d/n( -- n )Address increment for a normal; 4
69/n*( n1 -- n2 )Multiplies by /n
61na+( adr1 index -- adr2 )Increments adr1 by index times /n
65na1+( adr1 -- adr2 )Increments adr1 by /n
5b/w( -- n )Address increment for a 16-bit word; 2
67/w*( n1 -- n2 )Multiplies by /w
5fwa+( adr1 index -- adr2 )Increments adr1 by index times /w
63wa1+( adr1 -- adr2 )Increments adr1 by /w
afwbsplit( w -- b.low b.high )Splits a 16-bit word into two bytes
CRwflip( l1 -- l2 )Swaps halves of 32-bit longword
7dwljoin( w.low w.high -- l )Joins two words to form a longword
Table A-23 Memory Buffers Allocation
ValueFunctionStackDescription
8balloc-mem( nbytes -- adr )Allocates nbytes of memory and returns its address
8cfree-mem( adr nbytes -- )Frees memory allocated by alloc-mem
Table A-24 Miscellaneous Operators
ValueFunctionStackDescription
86>body( acf -- apf )Finds parameter field address from compilation address
85body>( apf -- acf )Finds compilation address from parameter field address
CRemit-byte( n -- )Outputs FCode byte (use with tokenizer[)
00end0( -- )Marks the end of FCode
ffend1( -- )Alternates form for end0 (not recommended)
CRfcode-version1( -- )Begins FCode program
-fload filename( -- )Begins tokenizing filename
-headerless( -- )Creates new names with new-token (no name fields)
-headers( -- )Creates new names with named-token (default)
7bnoop( -- )Does nothing
ccoffset16( -- )All further branches use 16-bit offsets (instead of 8-bit)
-tokenizer[( -- )Begins tokenizer program commands
-]tokenizer( -- )Ends tokenizer program commands
CRfcode-version2( -- )Begins 2.0 FCode program, compiles start1 V2
-external( -- )Creates new names with external-token V2
Table A-25 Internal Operators, (invalid for program text)
ValueFunctionStackDescription
1-f{ table#1-15 }
Reserved byte codes, used for 2-byte entries
10b(lit)( -- n )Followed by 32-bit#. Compiled by numeric data
11b(')( -- acf )Followed by a token (1 or 2-byte code) . Compiled by ['] or '
12b(")( -- adr len )Followed by count byte, text. Compiled by " or ."
c3b(is)( n -- )Compiled by is
fdversion1( -- )Followed by reserved byte, checksum (2 bytes) , length (4 bytes). Compiled by fcode-version1, as the first FCode bytes
fe4-byte-id( -- )Followed by 3 identifier bytes. First FCode byte. Not supported.
13bbranch( -- )Followed by offset. Compiled by else or again
14b?branch( -- )Followed by offset. Compiled by if or until
15b(loop)( -- )Followed by offset. Compiled by loop
16b(+loop)( n -- )Followed by offset. Compiled by +loop
17b(do)( end start -- )Followed by offset. Compiled by do
18b(?do)( end start -- )Followed by offset. Compiled by ?do
1bb(leave)( -- )Compiled by leave or ?leave
ValueFunctionStackDescription
b1b(<mark)( -- )Compiled by begin
b2b(>resolve)( -- )Compiled by else or then
c4b(case)( -- )Compiled by case
c5b(endcase)( -- )Compiled by endcase
c6b(endof)( -- )Compiled by endof
1cb(of)( sel testval --sel | none )Followed by offset. Compiled by of
b5new-token( -- )Followed by table#, code#, token-type. Compiled by any defining word. Headerless, not used normally.
b6named-token( -- )Followed by packed string (count,text), table#, code#, token-type. Compiled by any defining word (: value constant etc.)
b7b(:)
Token-type compiled by :
b8b(value)Token-type compiled by value
b9b(variable)
Token-type compiled by variable
bab(constant)Token-type compiled by constant
bbb(create)
Token-type compiled by create
bcb(defer)Token-type compiled by defer
bdb(buffer:)
Token-type compiled by buffer:
beb(field)Token-type compiled by field
c2b(;)( -- )End a colon definition. Compiled by ;
caexternal-token( -- )Like named-token, but name header is always created at probe time V2
f0start0( -- )Like version1, but for version 2.0 FCodes. Uses 16-bit branches. Fetches successive tokens from same address V2
f1start1( -- )Like version1, but for version 2.0 FCodes. Uses 16-bit branches. Fetches successive tokens from consecutive addresses. Compiled by fcode-version2 V2
f2start2( -- )Like version1, but for version 2.0 FCodes. Uses 16-bit branches. Fetches successive tokens from consecutive 16-bit addresses V2
f3start4( -- )Like version1, but for version 2.0 FCodes. Uses 16-bit branches. Fetches successive tokens from consecutive 32-bit addresses V2
Table A-26 Memory Allocation
ValueFunctionStackDescription
0101dma-alloc( nbytes -- virt )Maps in nbytes of DMA space, return virtual adr
0104memmap( phys space nbytes -- virt )Maps in a region, return virtual address
0105free-virtual( virt nbytes -- )Frees virtual memory from memmap, dma-alloc,or map-sbus
0106>physical( virt -- phys space )Returns physical adr and space for virtual adr
Table A-27 Non-volatile Parameters
ValueFunctionStackDescription
010fmy-params( -- adr len )Returns a data array for this plug-in device. The data format is defined specifically for each plug-in device, in order to customize the device. Params for each device, as needed, will be stored in the system NVRAM
Table A-28 Properties
ValueFunctionStackDescription
0110attribute( xdr-adr xdr-len name-adr
name-len -- )
Declares a property with the given value structure, for
the given name string.
0111xdrint( n -- xdr-adr xdr-len )Converts a number into an xdr-format string
0112xdr+( xdr-adr1 xdr-len1 xdr-adr2
xdr-len2 -- xdr-adr xdr-len1+2 )
Merges two xdr-format strings. They must have been
created sequentially
0113xdrphys( phys space -- xdr-adr xdr-len )Converts physical address and space into an xdr-format string
0114xdrstring( adr len -- xdr-adr xdr-len )Converts a string into an xdr-format string
0115xdrbytes( adr len -- xdr-adr xdr-len )Converts a byte array into an xdr-format string V2.1
021aget-my-attribute( nam-adr nam-len -- true | xdr-adr xdr-len false )Returns the xdr-format string for the given property name V2
021bxdrtoint( xdr-adr xdr-len -- xdr2-adr
xdr2-len n )
Converts the beginning of an xdr-format string to an
integer V2
021cxdrtostring( xdr-adr xdr-len -- xdr2-adr
xdr2-len adr len )
Converts the beginning of an xdr-format string to a
normal string V2
021dget-inherited-
attribute
( nam-adr nam-len -- true | xdr-adr
xdr-len false )
Returns the value string for the given property,
searches parents' properties if not found V2
021edelete-attribute( nam-adr nam-len -- )Deletes the property with the given name V2
021fget-package-
attribute
( adr len phandle -- true | xdr-adr
xdr-len false )
Returns the xdr-format string for the given property
name in the package "phandle" V2
Table A-29 Commmonly-used Properties
ValueFunctionStackDescription
0116reg( phys space size -- )Declares location and size of device registers
0117intr( intr-level vector -- )Declares interrupt level and vector for this device
0118driver( adr len -- )Not supported
0119model( adr len -- )Declares model# for this device, such as " SUNW,501-1415-01"
011adevice-type( adr len -- )Declares type of device, e.g. " display", " block", " network", or " byte"
CRname( adr len -- )Declares SunOS driver name, as in " SUNW,zebra"
0201device-name( adr len -- )Creates the "name" attribute with the given value V2
Table A-30 System Version Information
ValueFunctionStackDescription
0210processor-type( -- processor-type )Obsolete V2
0211firmware-version( -- n )Returns major/minor CPU firmware version V2
0212fcode-version( -- n )Obsolete V2
87version( -- n )Returns major/minor FCode interface version
Table A-31 Device Activation Vector Setup
ValueFunctionStackDescription
011cis-install( acf -- )Identifies "install" routine to allocate a framebuffer
011dis-remove( acf -- )Identifies "remove" routine, to deallocate a framebuffer
011eis-selftest( acf -- )Identifies "selftest" routine for this framebuffer
011fnew-device( -- )Opens an additional device, using this driver package
0127finish-device( -- )Closes out current device, ready for new-device
Table A-32 Self-test utility Routines
ValueFunctionStackDescription
0120diagnostic-mode?( -- flag )Returns "true" if extended diagnostics are desired
0121display-status( n -- )Obsolete
ValueFunction
Stack......Description
0122memory-test-suite( adr len -- status ) Calls memory tester for given region
0123group-code
( -- adr ).....Obsolete
0124mask
( -- adr ).....Variable, holds "mask" used by memory-test-suite



Table A-33 Time Utilities
ValueFunctionStackDescription
0125get-msecs( -- ms )Returns the current time, in milliseconds, approx.
0126ms( n -- )Delays for n milliseconds. Resolution is 1 millisecond
0213alarm( acf n -- ) Periodically execute acf. If n=0, stop. V2
Table A-34 Machine-specific Support
ValueFunctionStackDescription
0130map-sbus( phys size -- virt )Maps a region of memory in 'sbus' address space
0131sbus-intr>cpu( sbus-intr# -- cpu-intr# )Translates SBus interrupt# into CPU interrupt#

Note - Table A-35 through Table A-41 apply only to display device-types.

Table A-35 User-set terminal Emulation Values
ValueFunctionStackDescription
0150#lines( -- n )Number of lines of text being used for display. This word must be initialized (using is). fbx-install does this automatically, and also properly incorporates the NVRAM parameter "screen-#rows"
0151#columns( -- n )Number of columns (chars/line) used for display. This word must be initialized (using is). fbx-install does this automatically, and also properly incorporates the NVRAM parameter "screen-#columns"
Table A-36 Terminal Emulator-set Terminal Emulation Values
ValueFunctionStackDescription
0152line#( -- n )Current cursor position (line#). 0 is top line
0153column#( -- n )Current cursor position (column#). 0 is left char.
0154inverse?( -- flag )True if output is inverted (white-on-black)
0155inverse-screen?( -- flag )True if screen has been inverted (black background)
Table A-37 Terminal Emulation Routines*
ValueFunctionStackDescription
0157draw-character( char -- )Paints the given character and advance the cursor
0158reset-screen( -- )Initializes the display device
0159toggle-cursor( -- )Draws or erase the cursor
015aerase-screen( -- )Clears all pixels on the display
015bblink-screen( -- )Flashes the display momentarily
015cinvert-screen( -- )Changes all pixels to the opposite color
015dinsert-characters( n -- )Inserts n blanks just before the cursor
015edelete-characters( n -- )Deletes n characters starting at with cursor character, rightward. Remaining chars slide left
015finsert-lines( n -- )Inserts n blank lines just before the current line, lower lines are scrolled downward
0160delete-lines( n -- )Deletes n lines starting with the current line,
lower lines are scrolled upward
0161draw-logo( line# logoaddr logowidth logoheight -- )Draws the logo
*defer-type loadable routines.
Table A-38 Frame Buffer Parameter Values*
ValueFunctionStackDescription
016cchar-height( -- n )Height (in pixels) of a character (usually 22)
016dchar-width( -- n )Width (in pixels) of a character (usually 12)
016ffontbytes( -- n )Number of bytes/scan line for font entries (usually 2)
0162frame-buffer-adr( -- adr )Address of frame buffer memory
0163screen-height( -- n )Total height of the display (in pixels)
0164screen-width( -- n )Total width of the display (in pixels)
0165window-top( -- n )Distance (in pixels) between display top and text window
0166window-left( -- n )Distance (in pixels) between display left edge and text window left edge
*These must all be initialized before using any fbx- routines.
Table A-39 Font Operators
ValueFunctionStackDescription
016adefault-font( -- fontbase charwidth charheight
fontbytes #firstchar #chars )
Returns default font values, plugs directly into
set-font
016bset-font( fontbase charwidth charheight
fontbytes #firstchar #chars -- )
Sets the character font for text output
016e>font( char -- adr )Returns font address for given ASCII character
Table A-40 One-bit Framebuffer Utilities
ValueFunctionStackDescription
0170fb1-draw-character( char -- )Paints the character and advance the cursor
0171fb1-reset-screen( -- )Initializes the display device (noop)
0172fb1-toggle-cursor( -- )Draws or erases the cursor
0173fb1-erase-screen( -- )Clears all pixels on the display
0174fb1-blink-screen( -- )Inverts the screen, twice (slow)
0175fb1-invert-screen( -- )Changes all pixels to the opposite color
0176fb1-insert-characters( n -- )Inserts n blanks just before the cursor
0177fb1-delete-characters( n -- )Deletes n characters, starting at with cursor character, rightward. Remaining chars slide left
0178fb1-insert-lines( n -- )Inserts n blank lines just before the current line,
lower lines are scrolled downward
0179fb1-delete-lines( n -- )Deletes n lines starting with the current line,lower
lines are scrolled upward
ValueFunctionStack.............Description
017afb1-draw-logo( line# logoaddr logowidth...Draws the logo
logoheight -- )
017bfb1-install( width height #columns #lines -- ) Installs the one-bit built-in routines
017cfb1-slide-up( n -- ).............Like fb1-delete-lines, but doesn't clear lines at bottom


Table A-41 Eight-bit Framebuffer Utilities
ValueFunctionStack..........Description
0180fb8-draw-character( char -- )........Paints the character and advance the cursor
0181fb8-reset-screen( -- )...........Initializes the display device (noop)
0182fb8-toggle-cursor( -- )...........Draws or erases the cursor
0183fb8-erase-screen( -- )...........Clears all pixels on the display
0184fb8-blink-screen( -- )...........Inverts the screen, twice (slow)
0185fb8-invert-screen( -- )...........Changes all pixels to the opposite color
0186fb8-insert-characters( n -- )..........Inserts n blanks just before the cursor
0187fb8-delete-characters( n -- )..........Deletes n characters starting at with cursor character,
rightward. Remaining chars slide left
0188fb8-insert-lines( n -- )..........Inserts n blank lines just before the current line, lower
lines are scrolled downward
0189fb8-delete-lines( n -- )..........Deletes n lines starting with the current line, lower
lines are scrolled upward
018afb8-draw-logo( line# logoaddr logowidth Draws the logo
logoheight -- )
018bfb8-install( width height #columns Installs the eight-bit built-in routines
#lines -- )
Table A-42 Package Support
ValueFunctionStackDescription
023cpeer( phandle --
next-phandle )
Returns phandle of package that is the next child of the the
parent of the package V2.3
023bchild( parent-phandle --
child-phandle )
Returns phandle of the package that is the first child of the
package parent-phandle V2.3
0204find-package( adr len -- false | phandle true )Finds a package named "adr len" V2
0205open-package( adr len phandle --
ihandle | 0 )
Opens an instance of the package "phandle," passes arguments
"adr len" V2
ValueFunctionStackDescription
020f$open-package( arg-adr arg-len adr len -- ihandle | 0 )Finds a package "adr len," then opens it with arguments "arg-adr arg-len" V2
020amy-parent( -- ihandle )Returns the ihandle of the parent of the current package instance V2
0203my-self( -- ihandle )Returns the instance handle of currently-executing package instance V2
020bihandle>phandle( ihandle -- phandle )Converts an ihandle to a phandle V2
0206close-package( ihandle -- )Closes an instance of a package V2
0207find-method( adr len phandle -- false | acf true )Finds the method (command) named "adr len" within the package "phandle" V2
0208call-package( [...] acf ihandle -- [...] )Executes the method "acf" within the instance "ihandle" V2
020e$call-method( [...]adr len ihandle -- [...])Executes the method named "adr len" within the instance "ihandle" V2
0209$call-parent( [...] adr len -- [...] )Executes the method "adr len" within the parent's package V2
0202my-args( -- adr len )Returns the argument string "adr len" passed when this package was opened V2
020dmy-unit( -- low high )Returns the physical unit number pair for this package V2
0102my-address( -- phys )Returns the physical adr of this plug-in device. "phys" is a "magic" number, usable by other routines V2
0103my-space( -- space )Returns address space of plug-in device. "space" is a "magic" number, usable by other routines V2
Table A-43 Asynchronous Support
ValueFunctionStackDescription
0213alarm( acf n -- )Executes the method (command) indicated by "acf" every "n" milliseconds V2
0219user-abort( -- )Abort after alarm routine finishes execution
Table A-44 Miscellaneous Operations
ValueFunctionStackDescription
0214(is-user-word)( adr len acf -- )Creates a new word called "adr len" which executes "acf" V2
01a4mac-address( -- adr len )Returns the MAC address V2
Table A-45 Interpretation
ValueFunctionStackDescription
0215suspend-fcode( -- )Suspends execution of FCode, resumes later if an undefined command is required V2
Table A-46 Error Handling
ValueFunctionStackDescription
0216abort ( -- )Aborts FCode execution, returns to the "ok" prompt V2
0217catch ( [...] acf -- [...] error-code )Executes "acf," returns throw error code or 0 if throw not encountered V2
0218throw ( error-code -- )Returns given error code to catch V2
fcferror( -- )Displays "Unimplemented FCode" and stops FCode interpretation

FCodes by Byte Value

The following table lists, in hexadecimal order, currently-assigned FCode byte values.
Table A-47 FCodes by Byte Value
ValueFunctionStackVersion 2?
00end0( -- )
10b(lit)( -- n )
11b(')( -- acf )
12b(")( -- adr len )
13bbranch( -- )
14b?branch( -- )
15b(loop)( -- )
16b(+loop)( n -- )
17b(do)( end start -- )
18b(?do)( end start -- )
19i( -- n )
1aj( -- n )
1bb(leave)( -- )
1cb(of)( sel testval -- sel | none )
1dexecute( acf -- )
1e+( n1 n2 -- n3 )
1f-( n1 n2 -- n3 )
20*( n1 n2 -- n3 )
21/( n1 n2 -- quot )
22mod( n1 n2 -- rem )
23and( n1 n2 -- n3 )
24or( n1 n2 -- n3 )
25xor( n1 n2 -- n3 )
26not( n1 -- n2 )
27<<( n1 +n -- n2 )
28>>( n1 +n -- n2 )
29>>a( n1 +n -- n2 )
2a/mod( n1 n2 -- rem quot )
2bu/mod( ul un -- un.rem un.quot )
ValueFunctionStackVersion 2?
2cnegate( n1 -- n2 )
2dabs( n -- u )
2emin( n1 n2 -- n3 )
2fmax( n1 n2 -- n3 )
30>r( n -- ) ( rs: -- n)
31r>( -- n ) ( rs: n -- )
32r@( -- n ) ( rs: -- )
33exit( -- )
340=( n -- flag )
350<>( n -- flag )
360<( n -- flag )
370<=( n -- flag )
380>( n -- flag )
390>=( n -- flag )
3a<( n1 n2 -- flag )
3b>( n1 n2 -- flag )
3c=( n1 n2 -- flag )
3d<>( n1 n2 -- flag )
3eu>( u1 n2 -- flag )
3fu<=( u1 n2 -- flag )
40u<( u1 u2 -- flag )
41u>=( u1 n2 -- flag )
42>=( n1 n2 -- flag )
43<=( n1 n2 -- flag )
44between( n min max -- flag )
45within( n min max -- flag )
46drop( n -- )
47dup( n -- n n )
48over( n1 n2 -- n1 n2 n1 )
49swap( n1 n2 -- n2 n1 )
4arot( n1 n2 n3 -- n2 n3 n1 )
4b-rot( n1 n2 n3 -- n3 n1 n2 )
4ctuck( n1 n2 -- n2 n1 n2 )
4dnip( n1 n2 -- n2 )
4epick( +n -- n2 )
ValueFunctionStackVersion 2?
4froll( +n -- )
50?dup( n -- n n | 0 )
51depth( -- +n )
522drop( n1 n2 -- )
532dup( n1 n2 -- n1 n2 n1 n2 )
542over( n1 n2 n3 n4 -- n1 n2 n3 n4 n1 n2 )
552swap( n1 n2 n3 n4 -- n3 n4 n1 n2 )
562rot( n1 n2 n3 n4 n5 n6 -- n3 n4 n5 n6 n1 n2 )
572/( n1 -- n2 )
58u2/( u1 -- u2 )
592*( n1 -- n2 )
5a/c( -- n )
5b/w( -- n )
5c/l( -- n )
5d/n( -- n )
5eca+( adr1 index -- adr2 )
5fwa+( adr1 index -- adr2 )
60la+( adr1 index -- adr2 )
61na+( adr1 index -- adr2 )
62ca1+( adr1 -- adr2 )
63wa1+( adr1 -- adr2 )
64la1+( adr1 -- adr2 )
65na1+( adr1 -- adr2 )
66/c*( n1 -- n2 )
67/w*( n1 -- n2 )
68/l*( n1 -- n2 )
69/n*( n1 -- n2 )
6aon( adr -- )
6boff( adr -- )
6c+!( n adr -- )
6d@( adr -- n )
6el@( adr -- l )
6fw@( adr -- w )
70<w@( adr -- n )
71c@( adr -- byte )
ValueFunctionStackVersion 2?
72!( n adr -- )
73l!( l adr -- )
74w!( w adr -- )
75c!( n adr -- )
762@( adr -- n1 n2 )
772!( n1 n2 adr -- )
78move( adr1 adr2 u -- )
79fill( adr u byte -- )
7acomp( adr1 adr2 len -- n )
7bnoop( -- )
7clwsplit( l -- w.low w.high )
7dwljoin( w.low w.high -- l )
7elbsplit( l -- b.low b2 b3 b.high )
7fbljoin( b.low b2 b3 b.hi -- l )
80flip( w1 -- w2 )
81upc( char -- upper-case-char )
82lcc( char -- lower-case-char )
83pack( adr len pstr -- pstr )
84count( pstr -- adr +n )
85body>( apf -- acf )
86>body( acf -- apf )
87version( -- n )
88span( -- adr )
8aexpect( adr +n -- )
8balloc-mem( nbytes -- adr )
8cfree-mem( adr nbytes -- )
8dkey?( -- flag )
8ekey( -- char )
8femit( char -- )
90type( adr +n -- )
91(cr( -- )
92cr( -- )
93#out( -- adr )
94#line( -- adr )
95hold( char -- )
ValueFunctionStackVersion 2?
96<#( -- )
97#>( l -- adr +n )
98sign( n -- )
99#( +l1 -- +l2 )
9a#s( +l -- 0 )
9bu.( u -- )
9cu.r( u +n -- )
9d.( n -- )
9e.r( n +n -- )
9f.s( -- )
a0base( -- adr )
a2$number( adr len -- true | n false )V2
a3digit( char base -- digit true | char false )
a4-1( -- -1 )
a50( -- 0 )
a61( -- 1 )
a72( -- 2 )
a83( -- 3 )
a9bl( -- n )
aabs( -- n )
abbell( -- n )
acbounds( startadr len -- endadr startadr )
adhere( -- adr )
aealigned( adr1 -- adr2 )
afwbsplit( w -- b.low b.high )
b0bwjoin( b.low b.hi -- w )
b1b(<mark)( -- )
b2b(>resolve)( -- )
b5new-token( -- )
b6named-token( -- )
b7b(:)

b8b(value)
b9b(variable)

bab(constant)
bbb(create)

ValueFunctionStackVersion 2?
bcb(defer)

bdb(buffer:)

beb(field)

c0instance( -- )V2.1
c2b(;)( -- )
c3b(is)( n -- )
c4b(case)( -- )
c5b(endcase)( -- )
c6b(endof)( -- )
caexternal-token( -- )V2
cb$find( adr len -- adr len false | acf +-1 )
ccoffset16( -- )
cdeval( ??? adr len -- ? )V2
d0c,( n -- )
d1w,( w -- )
d2l,( l -- )
d3,( n -- )
d4u*x( u1[32] u2[32] -- product[64] )V2
d5xu/mod( u1[64] u2[32] -- remainder[32] quot[32] )V2
d8x+( x1 x2 -- x3 )V2
d9x-( x1 x2 -- x3 )V2
f0start0( -- )V2
f1start1( -- )V2
f2start2( -- )V2
f3start4( -- )V2
fcferror( -- )V2.3
fdversion1( -- )
fe4-byte-id( -- )
ffend1( -- )
0101dma-alloc( nbytes -- virt )
0102my-address( -- phys )V2
0103my-space( -- space )V2
0104memmap( physoffset space size -- virtual )
0105free-virtual( virt nbytes -- )
0106>physical( virt -- phys space )
ValueFunctionStackVersion 2?
010fmy-params( -- adr len )
0110attribute( xdr-adr xdr-len name-adr name-len -- )
0111xdrint( n -- xdr-adr xdr-len )
0112xdr+( xdr-adr1 xdr-len1 xdr-adr2 xdr-len2 -- xdr-adr xdr-len1+2 )
0113xdrphys( phys space -- xdr-adr xdr-len )
0114xdrstring( adr len -- xdr-adr xdr-len )
0115xdrbytes( adr len -- xdr-adr xdr-len )V2.1
0116reg( phys space size -- )
0117intr( intr-level vector -- )
0118driver( adr len -- )
0119model( adr len -- )
011adevice-type( adr len -- )
011bdecode-2int( xdr-adr xdr-len -- phys space )V2
011cis-install( acf -- )
011dis-remove( acf -- )
011eis-selftest( acf -- )
011fnew-device( -- )
0120diagnostic-mode?( -- flag )
0121display-status( n -- )
0122memory-test-suite( adr len -- status )
0123group-code( -- adr )
0124mask( -- adr )
0125get-msecs( -- ms )
0126ms( n -- )
0127finish-device( -- )
0130map-sbus( phys size -- virt )
0131sbus-intr>cpu( sbus-intr# -- cpu-intr# )
0150#lines( -- n )
0151#columns( -- n )
0152line#( -- n )
0153column#( -- n )
0154inverse?( -- flag )
0155inverse-screen?( -- flag )
0157draw-character( char -- )
0158reset-screen( -- )
ValueFunctionStackVersion 2?
0159toggle-cursor( -- )
015aerase-screen( -- )
015bblink-screen( -- )
015cinvert-screen( -- )
015dinsert-characters( n -- )
015edelete-characters( n -- )
015finsert-lines( n -- )
0160delete-lines( n -- )
0161draw-logo( line# logoaddr logowidth logoheight -- )
0162frame-buffer-adr( -- adr )
0163screen-height( -- n )
0164screen-width( -- n )
0165window-top( -- n )
0166window-left( -- n )
016adefault-font( -- fontbase charwidth charheight fontbytes #firstchar #chars )
016bset-font( fontbase charwidth charheight fontbytes #firstchar #chars -- )
016cchar-height( -- n )
016dchar-width( -- n )
016e>font( char -- adr )
016ffontbytes( -- n )
0170fb1-draw-character( char -- )
0171fb1-reset-screen( -- )
0172fb1-toggle-cursor( -- )
0173fb1-erase-screen( -- )
0174fb1-blink-screen( -- )
0175fb1-invert-screen( -- )
0176fb1-insert-characters( n -- )
0177fb1-delete-characters( n -- )
0178fb1-insert-lines( n -- )
0179fb1-delete-lines( n -- )
017afb1-draw-logo( line# logoaddr logowidth logoheight -- )
017bfb1-install( width height #columns #lines -- )
017cfb1-slide-up( n -- )
0180fb8-draw-character( char -- )
0181fb8-reset-screen( -- )
ValueFunctionStackVersion 2?
0182fb8-toggle-cursor( -- )
0183fb8-erase-screen( -- )
0184fb8-blink-screen( -- )
0185fb8-invert-screen( -- )
0186fb8-insert-characters( n -- )
0187fb8-delete-characters( n -- )
0188fb8-insert-lines( n -- )
0189fb8-delete-lines( n -- )
018afb8-draw-logo( line# logoaddr logowidth logoheight -- )
018bfb8-install( width height #columns #lines -- )
01a4mac-address( -- adr len )V2
0201device-name( adr len -- )V2
0202my-args( -- adr len )V2
0203my-self( -- ihandle )V2
0204find-package( adr len -- false | phandle true )V2
0205open-package( adr len phandle -- ihandle | 0 )V2
0206close-package( ihandle -- )V2
0207find-method( adr len phandle -- false | acf true )V2
0208call-package( [...] acf ihandle -- [...] )V2
0209$call-parent( [...] adr len -- [...] )V2
020amy-parent( -- ihandle )V2
020bihandle>phandle( ihandle -- phandle )V2
020dmy-unit( -- low high )V2
020e$call-method( [...]adr len ihandle -- [...])V2
020f$open-package( arg-adr arg-len adr len -- ihandle | 0 )V2
0210processor-type( -- processor-type )V2
0211firmware-version( -- n )V2
0212fcode-version( -- n )V2
0213alarm( acf n -- )V2
0214(is-user-word)( adr len acf -- )V2
0215suspend-fcode( -- )V2
0216abort( -- )V2
0217catch( [...] acf -- [...] error-code )V2
0218throw( error-code -- )V2
0219user-abort( -- )V2.1
ValueFunctionStackVersion 2?
021aget-my-attribute( nam-adr nam-len -- true | xdr-adr xdr-len false )V2
021bxdrtoint( xdr-adr xdr-len -- xdr2-adr xdr2-len n )V2
021cxdrtostring( xdr-adr xdr-len -- xdr2-adr xdr2-len adr len )V2
021dget-inherited-attribute( nam-adr nam-len -- true | xdr-adr xdr-len false )V2
021edelete-attribute( nam-adr nam-len -- )V2
021fget-package-attribute( adr len phandle -- true | xdr-adr xdr-len false )V2
0220cpeek( adr -- false | byte true )V2
0221wpeek( adr -- false | word true )V2
0222lpeek( adr -- false | long true )V2
0223cpoke( byte adr -- ok? )V2
0224wpoke( word adr -- ok? )V2
0225lpoke( long adr -- ok? )V2
0230rb@( adr -- byte )V2
0231rb!( byte adr -- )V2
0232rw@( adr -- word )V2
0233rw!( word adr -- )V2
0234rl@( adr -- long )V2
0235rl!( long adr -- )V2
0236wflips( adr len -- )V2
0237lflips( adr len -- )V2
0238probe( arg-adr arg-len reg-adr reg-len fcode-adr fcode-len -- )V2.2
0239probe-virtual( arg-adr arg-len reg-adr reg-len fcode-adr -- )V2.2
023bchild( phandle -- child-phandle )V2.3
023cpeer( phandle -- peer-phandle )V2.3
0240left-parse-string( adr len char -- adrR lenR adrL lenL )V2.2
-( text)( -- )
-(s text)( -- )
-]tokenizer( -- )
-\( -- )
-alias( -- )
-binary( -- )
-decimal( -- )
-external( -- )V2
-fload filename( -- )
-headerless( -- )
ValueFunctionStackVersion 2?
-headers( -- )
-hex( -- )
-octal( -- )
-tokenizer[( -- )
CR" text"( -- adr len )
CR' name( -- acf )
CR*/mod( n1 n2 n3 -- rem quot )
CR+loop( n -- )
CR." text"( -- )
CR.( text)( -- )
CR.d( n -- )
CR.h( n -- )
CR1+( n1 -- n2 )
CR1-( n1 -- n2 )
CR3dup( n1 n2 n3 -- n1 n2 n3 n1 n2 n3 )
CR: (colon) name( -- )
CR; (semicolon)( -- )
CR<<a( n1 +n -- n2 )
CR?( adr -- )
CR?do( end start -- )
CR?leave( flag -- )
CR['] name( -- acf )
CRagain( -- )
CRascii x( -- char )
CRb# number( -- n )
CRbegin( -- )
CRblank( adr len -- )
CRbuffer: name( size -- )
CRcarret( -- n )
CRcmove( adr1 adr2 u -- )
CRcmove>( adr1 adr2 u -- )
CRconstant name( n -- )
CRcontrol x( -- char )
CRcreate name( -- )
CRd# number( -- n )
ValueFunctionStackVersion 2?
CRdecimal( -- )
CRdefer name( -- )
CRdo( end start -- )
CRelse( -- )
CRemit-byte( n -- )
CRerase( adr len -- )
CRfalse( -- 0 )
CRfcode-version1( -- )
CRfcode-version2( -- )V2
CRfield name( offset size -- offset+size )
CRh# number( -- n )
CRhex( -- )
CRif( flag -- )
CRis name( n -- )
CRleave( -- )
CRlinefeed( -- n )
CRloop( -- )
CRname( adr len -- )
CRnewline( -- n )
CRo# number( -- n )
CRrepeat( -- )
CRs.( n -- )
CRspace( -- )
CRspaces( +n -- )
CRstruct( -- 0 )
CRthen( -- )
CRtrue( -- -1 )
CRuntil( flag -- )
CRvalue name( n -- )
CRvariable name( -- )
CRwflip( l1 -- l2 )
CRwhile( flag -- )

FCodes by Name

The following table lists, in alphabetic order, currently-assigned FCodes.
Table A-48 FCodes by Name
ValueFunctionStackVersion 2?
a50( -- 0 )
360<( n -- flag )
370<=( n -- flag )
350<>( n -- flag )
340=( n -- flag )
380>( n -- flag )
390>=( n -- flag )
a61( -- 1 )
CR1+( n1 -- n2 )
CR1-( n1 -- n2 )
a72( -- 2 )
772!( n1 n2 adr -- )
592*( n1 -- n2 )
572/( n1 -- n2 )
762@( adr -- n1 n2 )
522drop( n1 n2 -- )
532dup( n1 n2 -- n1 n2 n1 n2 )
542over( n1 n2 n3 n4 -- n1 n2 n3 n4 n1 n2 )
562rot( n1 n2 n3 n4 n5 n6 -- n3 n4 n5 n6 n1 n2 )
552swap( n1 n2 n3 n4 -- n3 n4 n1 n2 )
a83( -- 3 )
CR3dup( n1 n2 n3 -- n1 n2 n3 n1 n2 n3 )
fe4-byte-id( -- )
0216abort ( -- )V2
2dabs( n -- u )
CRagain( -- )
0213alarm( acf n -- )V2
-alias( -- )
aealigned( adr1 -- adr2 )
8balloc-mem( nbytes -- adr )
ValueFunctionStackVersion 2?
23and( n1 n2 -- n3 )
CRascii x( -- char )
0110attribute( xdr-adr xdr-len name-adr name-len -- )
CRb# number( -- n )
12b(")( -- adr len )
11b(')( -- acf )
16b(+loop)( n -- )
b7b(:)
c2b(;)( -- )
b1b(<mark)( -- )
b2b(>resolve)( -- )
18b(?do)( end start -- )
bdb(buffer:)

c4b(case)( selector -- selector )
bab(constant)

bbb(create)
bcb(defer)

17b(do)( end start -- )
c5b(endcase)( -- )
c6b(endof)( -- )
beb(field)

c3b(is)( n -- )
1bb(leave)( -- )
10b(lit)( -- n )
15b(loop)( -- )
1cb(of)( sel testval -- sel | none )
b8b(value)

b9b(variable)
14b?branch( -- )
a0base( -- adr )
13bbranch( -- )
CRbegin( -- )
abbell( -- n )
44between( n min max -- flag )
-binary( -- )
ValueFunctionStackVersion 2?
a9bl( -- n )
CRblank( adr len -- )
015bblink-screen( -- )
7fbljoin( b.low b2 b3 b.hi -- l )
85body>( apf -- acf )
acbounds( startadr len -- endadr startadr )
aabs( -- n )
CRbuffer: name( size -- )
b0bwjoin( b.low b.hi -- w )
75c!( n adr -- )
d0c,( n -- )
71c@( adr -- byte )
5eca+( adr1 index -- adr2 )
62ca1+( adr1 -- adr2 )
0208call-package( [...] acf ihandle -- [...] )V2
CRcarret( -- n )
0217catch ( [...] acf -- [...] error-code )V2
016cchar-height( -- n )
016dchar-width( -- n )
0236child( phandle -- child-phandle )V2.3
0206close-package( ihandle -- )V2
CRcmove( adr1 adr2 u -- )
CRcmove>( adr1 adr2 u -- )
0153column#( -- n )
7acomp( adr1 adr2 len -- n )
CRconstant name( n -- )
CRcontrol x( -- char )
84count( pstr -- adr +n )
0220cpeek( adr -- false | byte true )V2
0223cpoke( byte adr -- ok? )V2
92cr( -- )
CRcreate name( -- )
CRd# number( -- n )
-decimal( -- )
CRdecimal( -- )
ValueFunctionStackVersion 2?
011bdecode-2int( xdr-adr xdr-len -- phys space )V2
016adefault-font( -- fontbase charwidth charheight fontbytes #firstchar #chars )
CRdefer name( -- )
021edelete-attribute( nam-adr nam-len -- )V2
015edelete-characters( n -- )
0160delete-lines( n -- )
51depth( -- +n )
0201device-name( adr len -- )V2
011adevice-type( adr len -- )
0120diagnostic-mode?( -- flag )
a3digit( char base -- digit true | char false )
0121display-status( n -- )
0101dma-alloc( nbytes -- virt )
CRdo( end start -- )
0157draw-character( char -- )
0161draw-logo( line# logoaddr logowidth logoheight -- )
0118driver( adr len -- )
46drop( n -- )
47dup( n -- n n )
CRelse( -- )
8femit( char -- )
CRemit-byte( n -- )
00end0( -- )
ffend1( -- )
CRerase( adr len -- )
015aerase-screen( -- )
cdeval( ??? adr len -- ? )V2
1dexecute( acf -- )
33exit( -- )
8aexpect( adr +n -- )
-external( -- )V2
caexternal-token( -- )V2
CRfalse( -- 0 )
0174fb1-blink-screen( -- )
0177fb1-delete-characters( n -- )
ValueFunctionStackVersion 2?
0179fb1-delete-lines( n -- )
0170fb1-draw-character( char -- )
017afb1-draw-logo( line# logoaddr logowidth logoheight -- )
0173fb1-erase-screen( -- )
0176fb1-insert-characters( n -- )
0178fb1-insert-lines( n -- )
017bfb1-install( width height #columns #lines -- )
0175fb1-invert-screen( -- )
0171fb1-reset-screen( -- )
017cfb1-slide-up( n -- )
0172fb1-toggle-cursor( -- )
0184fb8-blink-screen( -- )
0187fb8-delete-characters( n -- )
0189fb8-delete-lines( n -- )
0180fb8-draw-character( char -- )
018afb8-draw-logo( line# logoaddr logowidth logoheight -- )
0183fb8-erase-screen( -- )
0186fb8-insert-characters( n -- )
0188fb8-insert-lines( n -- )
018bfb8-install( width height #columns #lines -- )
0185fb8-invert-screen( -- )
0181fb8-reset-screen( -- )
0182fb8-toggle-cursor( -- )
0212fcode-version( -- n )V2
CRfcode-version1( -- )
CRfcode-version2( -- )V2
fcferror( -- )V2.3
CRfield name( offset size -- offset+size )
79fill( adr u byte -- )
0207find-method( adr len phandle -- false | acf true )V2
0204find-package( adr len -- false | phandle true )V2
0127finish-device( -- )
0211firmware-version( -- n )V2
80flip( w1 -- w2 )
-fload filename( -- )
ValueFunctionStackVersion 2?
016ffontbytes( -- n )
0162frame-buffer-adr( -- adr )
8cfree-mem( adr nbytes -- )
0105free-virtual( virt nbytes -- )
021dget-inherited-attribute( nam-adr nam-len -- true | xdr-adr xdr-len false )V2
0125get-msecs( -- ms )
021aget-my-attribute( nam-adr nam-len -- true | xdr-adr xdr-len false )V2
021fget-package-attribute( adr len phandle -- true | xdr-adr xdr-len false )V2
0123group-code( -- adr )
CRh# number( -- n )
-headerless( -- )
-headers( -- )
adhere( -- adr )
-hex( -- )
CRhex( -- )
95hold( char -- )
19i( -- n )
CRif( flag -- )
020bihandle>phandle( ihandle -- phandle )V2
015dinsert-characters( n -- )
015finsert-lines( n -- )
c0instance( -- )V2.1
0117intr( intr-level vector -- )
0155inverse-screen?( -- flag )
0154inverse?( -- flag )
015cinvert-screen( -- )
CRis name( n -- )
011cis-install( acf -- )
011dis-remove( acf -- )
011eis-selftest( acf -- )
1aj( -- n )
8ekey( -- char )
8dkey?( -- flag )
73l!( l adr -- )
d2l,( l -- )
ValueFunctionStackVersion 2?
6el@( adr -- l )
60la+( adr1 index -- adr2 )
64la1+( adr1 -- adr2 )
7elbsplit( l -- b.low b2 b3 b.high )
82lcc( char -- lower-case-char )
CRleave( -- )
0240left-parse-string( adr len char -- adrR lenR adrL lenL )V2
0237lflips( adr len -- )V2
0152line#( -- n )
CRlinefeed( -- n )
CRloop( -- )
0222lpeek( adr -- false | long true )V2
0225lpoke( long adr -- ok? )V2
7clwsplit( l -- w.low w.high )
01a4mac-address( -- adr len )V2
0130map-sbus( phys size -- virt )
0124mask( -- adr )
2fmax( n1 n2 -- n3 )
0122memory-test-suite( adr len -- status )
0104memmap( physoffset space size -- virtual )
2emin( n1 n2 -- n3 )
22mod( n1 n2 -- rem )
0119model( adr len -- )
78move( adr1 adr2 u -- )
0126ms( n -- )
0102my-address( -- phys )V2
0202my-args( -- adr len )V2
010fmy-params( -- adr len )
020amy-parent( -- ihandle )V2
0203my-self( -- ihandle )V2
0103my-space( -- space )V2
020dmy-unit( -- low high )V2
61na+( adr1 index -- adr2 )
65na1+( adr1 -- adr2 )
CRname( adr len -- )
ValueFunctionStackVersion 2?
b6named-token( -- )
2cnegate( n1 -- n2 )
011fnew-device( -- )
b5new-token( -- )
CRnewline( -- n )
4dnip( n1 n2 -- n2 )
7bnoop( -- )
26not( n1 -- n2 )
CRo# number( -- n )
-octal( -- )
6boff( adr -- )
ccoffset16( -- )
6aon( adr -- )
0205open-package( adr len phandle -- ihandle | 0 )V2
24or( n1 n2 -- n3 )
48over( n1 n2 -- n1 n2 n1 )
83pack( adr len pstr -- pstr )
023cpeer( phandle -- peerhandle )V2.3
4epick( +n -- n2 )
0238probe( arg-adr arg-len reg-adr reg-len fcode-adr fcode-len -- )V2.2
0239probe-virtual( arg-adr arg-len reg-adr reg-len fcode-adr -- )V2.2
0210processor-type( -- processor-type )V2
31r>( -- n ) ( rs: n -- )
32r@( -- n ) ( rs: -- )
0231rb!( byte adr -- )V2
0230rb@( adr -- byte )V2
0116reg( phys space size -- )
CRrepeat( -- )
0158reset-screen( -- )
0235rl!( long adr -- )V2
0234rl@( adr -- long )V2
4froll( +n -- )
4arot( n1 n2 n3 -- n2 n3 n1 )
0233rw!( word adr -- )V2
0232rw@( adr -- word )V2
ValueFunctionStackVersion 2?
CRs.( n -- )
0131sbus-intr>cpu( sbus-intr# -- cpu-intr# )
0163screen-height( -- n )
0164screen-width( -- n )
016bset-font( fontbase charwidth charheight fontbytes #firstchar #chars -- )
98sign( n -- )
CRspace( -- )
CRspaces( +n -- )
88span( -- adr )
f0start0( -- )V2
f1start1( -- )V2
f2start2( -- )V2
f3start4( -- )V2
CRstruct( -- 0 )
0215suspend-fcode( -- )V2
49swap( n1 n2 -- n2 n1 )
CRthen( -- )
0218throw( error-code -- )V2
0159toggle-cursor( -- )
-tokenizer[( -- )
CRtrue( -- -1 )
4ctuck( n1 n2 -- n2 n1 n2 )
90type( adr +n -- )
d4u*x( u1[32] u2[32] -- product[64] )V2
9bu.( u -- )
9cu.r( u +n -- )
2bu/mod( ul un -- un.rem un.quot )
58u2/( u1 -- u2 )
40u<( u1 u2 -- flag )
3fu<=( u1 u2 -- flag )
3eu>( u1 u2 -- flag )
41u>=( u1 u2 -- flag )
CR(u.)( n -- adr len )
CRuntil( flag -- )
81upc( char -- upper-case-char )
ValueFunctionStackVersion 2?
0219user-abort( -- )V2.1
CRvalue name( n -- )
CRvariable name( -- )
87version( -- n )
fdversion1( -- )
74w!( w adr -- )
d1w,( w -- )
6fw@( adr -- w )
5fwa+( adr1 index -- adr2 )
63wa1+( adr1 -- adr2 )
afwbsplit( w -- b.low b.high )
CRwflip( l1 -- l2 )
0236wflips( adr len -- )V2
CRwhile( flag -- )
0166window-left( -- n )
0165window-top( -- n )
45within( n min max -- flag )
7dwljoin( w.low w.high -- l )
0221wpeek( adr -- false | word true )V2
0224wpoke( word adr -- ok? )V2
d8x+( x1 x2 -- x3 )V2
d9x-( x1 x2 -- x3 )V2
0112xdr+( xdr-adr1 xdr-len1 xdr-adr2 xdr-len2 -- xdr-adr xdr-len1+2 )
0115xdrbytes( adr len -- xdr-adr xdr-len )V2.1
0111xdrint( n -- xdr-adr xdr-len )
0113xdrphys( phys space -- xdr-adr xdr-len )
0114xdrstring( adr len -- xdr-adr xdr-len )
021bxdrtoint( xdr-adr xdr-len -- xdr2-adr xdr2-len n )V2
021cxdrtostring( xdr-adr xdr-len -- xdr2-adr xdr2-len adr len )V2
25xor( n1 n2 -- n3 )
d5xu/mod( u1[64] u2[32] -- remainder[32] quot[32] )V2
CR: (colon) name( -- )
CR; (semicolon)( -- )
3a<( n1 n2 -- flag )
96<#( -- )
ValueFunctionStackVersion 2?
27<<( n1 +n -- n2 )
CR<<a( n1 +n -- n2 )
43<=( n1 n2 -- flag )
3d<>( n1 n2 -- flag )
70<w@( adr -- n )
3c=( n1 n2 -- flag )
3b>( n1 n2 -- flag )
42>=( n1 n2 -- flag )
28>>( n1 +n -- n2 )
29>>a( n1 +n -- n2 )
86>body( acf -- apf )
016e>font( char -- adr )
0106>physical( virt -- phys space )
30>r( n -- ) ( rs: -- n)
CR?( adr -- )
CR?do( end start -- )
50?dup( n -- n n | 0 )
CR?leave( flag -- )
6d@( adr -- n )
CR['] name( -- acf )
-\( -- )
-]tokenizer( -- )
72!( n adr -- )
CR" text"( -- adr len )
99#( +l1 -- +l2 )
97#>( l -- adr +n )
0151#columns( -- n )
94#line( -- adr )
0150#lines( -- n )
93#out( -- adr )
9a#s( +l -- 0 )
020e$call-method( [...]adr len ihandle -- [...])V2
0209$call-parent( [...] adr len -- [...] )V2
cb$find( adr len -- adr len false | acf +-1 )
a2$number( adr len -- true | n false )V2
ValueFunctionStackVersion 2?
020f$open-package( arg-adr arg-len adr len -- ihandle | 0 )V2
CR' name( -- acf )
-( text)( -- )
91(cr( -- )
CR(.)( n -- adr len )
0214(is-user-word)( adr len acf -- )V2
-(s text)( -- )
20*( n1 n2 -- n3 )
CR*/mod( n1 n2 n3 -- rem quot )
1e+( n1 n2 -- n3 )
6c+!( n adr -- )
CR+loop( n -- )
d3,( n -- )
1f-( n1 n2 -- n3 )
a4-1( -- -1 )
4b-rot( n1 n2 n3 -- n3 n1 n2 )
9d.( n -- )
CR." text"( -- )
CR.( text)( -- )
CR.d( n -- )
CR.h( n -- )
9e.r( n +n -- )
9f.s( -- )
21/( n1 n2 -- quot )
5a/c( -- n )
66/c*( n1 -- n2 )
5c/l( -- n )
68/l*( n1 -- n2 )
2a/mod( n1 n2 -- rem quot )
5d/n( -- n )
69/n*( n1 -- n2 )
5b/w( -- n )
67/w*( n1 -- n2 )

Version 2 FCodes

The following table lists, in alphabetic order, Version 2 FCodes. Table A-49 Version 2 FCodes
ValueFunctionStackVersion
0216abort( -- )V2
0213alarm( acf n -- )V2
0208call-package( [...] acf ihandle -- [...] )V2
0217catch( [...] acf -- [...] error-code )V2
0236child( phandle -- child-phandle )V2.3
0206close-package( ihandle -- )V2
0220cpeek( adr -- false | byte true )V2
0223cpoke( byte adr -- ok? )V2
011bdecode-2int( xdr-adr xdr-len -- phys space )V2
021edelete-attribute( nam-adr nam-len -- )V2
0201device-name( adr len -- )V2
cdeval( ??? adr len -- ? )V2
-external( -- )V2
caexternal-token( -- )V2
0212fcode-version( -- n )V2
CRfcode-version2( -- )V2
fcferror( -- )V2.3
0207find-method( adr len phandle -- false | acf true )V2
0204find-package( adr len -- false | phandle true )V2
0211firmware-version( -- n )V2
021dget-inherited-attribute( nam-adr nam-len -- true | xdr-adr xdr-len false )V2
021aget-my-attribute( nam-adr nam-len -- true | xdr-adr xdr-len false )V2
021fget-package-attribute( adr len phandle -- true | xdr-adr xdr-len false )V2
020bihandle>phandle( ihandle -- phandle )V2
c0instance( -- )V2.1
0240left-parse-string( adr len char -- adrR lenR adrL lenL )V2
0237lflips( adr len -- )V2
0222lpeek( adr -- false | long true )V2
0225lpoke( long adr -- ok? )V2
01a4mac-address( -- adr len )V2
ValueFunctionStackVersion
0102my-address( -- phys )V2
0202my-args( -- adr len )V2
020amy-parent( -- ihandle )V2
0203my-self( -- ihandle )V2
0103my-space( -- space )V2
020dmy-unit( -- low high )V2
0205open-package( adr len phandle -- ihandle | 0 )V2
023cpeer( phandle -- peerhandle )V2.3
0238probe( arg-adr arg-len reg-adr reg-len fcode-adr fcode-len -- )V2.2
0239probe-virtual( arg-adr arg-len reg-adr reg-len fcode-adr -- )V2.2
0210processor-type( -- processor-type )V2
0231rb!( byte adr -- )V2
0230rb@( adr -- byte )V2
0235rl!( long adr -- )V2
0234rl@( adr -- long )V2
0233rw!( word adr -- )V2
0232rw@( adr -- word )V2
f0start0( -- )V2
f1start1( -- )V2
f2start2( -- )V2
f3start4( -- )V2
0215suspend-fcode( -- )V2
0218throw( error-code -- )V2
d4u*x( u1[32] u2[32] -- product[64] )V2
0219user-abort( -- )V2.1
0236wflips( adr len -- )V2
0221wpeek( adr -- false | word true )V2
0224wpoke( word adr -- ok? )V2
d8x+( x1 x2 -- x3 )V2
d9x-( x1 x2 -- x3 )V2
0115xdrbytes( adr len -- xdr-adr xdr-len )V2.1
021bxdrtoint( xdr-adr xdr-len -- xdr2-adr xdr2-len n )V2
021cxdrtostring( xdr-adr xdr-len -- xdr2-adr xdr2-len adr len )V2
d5xu/mod( u1[64] u2[32] -- remainder[32] quot[32] )V2
020e$call-method( [...]adr len ihandle -- [...])V2
ValueFunctionStackVersion
0209$call-parent( [...] adr len -- [...] )V2
a2$number( adr len -- true | n false )V2
020f$open-package( arg-adr arg-len adr len -- ihandle | 0 )V2
0214(is-user-word)( adr len acf -- )V2