Table of Contents
store:core — ordinary primitive
FORTH
!
( val addr -- )(
)
;
p4:"store";
store value at addr (sizeof CELL)
store-plus:forth_usual.1 — forthword synonym
FORTH
!+
( .. )(
)
;
as:"store-plus";
forthword synonym !+
is doing the same as !++
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
store-plus:toolbelt.1 — ordinary primitive
FORTH
!+
( .. )(
)
;
as:"store-plus";
ordinary primitive !+
an executable word (no special usage info)
or wrapper call around p4_store_plus_plus
store-plus-plus:forth_usual — ordinary primitive
FORTH
!++
( addr x -- addr' )( | ) ; |
; |
Store the value _x_ into _addr_, and increment the address by one cell.
: !++ ( addr x -- addr' ) OVER ! CELL+ ;
store-back:your.1 — immediate synonym
EXTENSIONS
!>
( .. )(
)
;
as:"store-back";
immediate synonym !>
is doing the same as TO
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
quote:core — immediate synonym
FORTH
"
( [string<">] -- bstring )or perhaps ( [..] -- str-ptr str-len )( | ) ; |
; |
ignore-line:posix — ordinary primitive
EXTENSIONS
#!
( "...<eol>" -- )(
)
;
p4:"ignore-line";
ignores the rest of the line, defining `#!' is used to support forth scripts executed by the unix kernel
str-store:dstrings.1 — ordinary primitive
FORTH
$!
( .. )(
)
;
as:"str-store";
ordinary primitive $!
an executable word (no special usage info)
or wrapper call around p4_str_store
str-quote:dstrings — compiling primitive
FORTH
$"
( [ccc<">] -- $: str )(
)
;
p4:"str-quote";
Parse ccc delimited by " (double-quote) and store it in data space as an mstring. If interpreting, leave the MSA on the string stack. If compiling, append run-time semantics to the current definition that leaves the MSA on the string stack. A program should not alter the stored string. An error is thrown if the quoted string length is larger than the system parameter MAX_DATA_STR (see S,). <ansref>"string-quote"</ansref>
NOTE: In contrast to S", the string stored by $" when interpreting is not transient.
The implementation is based on PFE code for S".
str-str:shell.1 — obsolete forthword
EXTENSIONS
$$
( .. )(
)
;
as:"str-str";
obsolete forthword $$
is doing the same as $PID
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
str-dot:dstrings — ordinary primitive
FORTH
$.
( $: a$ -- )(
)
;
p4:"str-dot";
Display the string on the terminal. If the system implementation of TYPE has its output vectored, $. uses the same vector. <ansref>"string-dot"</ansref>
str-fetch:dstrings — ordinary primitive
FORTH
$@
( $var.pfa -- $: a$ )(
)
;
p4:"str-fetch";
Leave the MSA of the string held by the string variable. <ansref>"string-fetch"</ansref>
tick:core — forthword synonym
FORTH
'
( 'name' -- xt )(
)
;
p4:"tick";
return the execution token of the following name. This word is _not_ immediate and may not do what you expect in compile-mode. See ['] and '> - note that in FIG-forth the word of the same name had returned the PFA (not the CFA) and was immediate/smart, so beware when porting forth-code from FIG-forth to ANSI-forth.
paren:core — immediate primitive
FORTH
(
( 'comment<closeparen>' -- )( | ) ; |
; |
eat everything up to the next closing paren - treat it as a comment.
note-str:useful.1 — immediate primitive
EXTENSIONS
($
( .. )(
)
;
as:"note-str";
immediate primitive ($
an executable word (no special usage info)
or wrapper call around p4_prefix_begin
note-str-colon:dstrings.1 — immediate primitive
FORTH
($:
( .. )(
)
;
as:"note-str-colon";
immediate primitive ($:
an executable word (no special usage info)
or wrapper call around p4_paren
paren-dot:toolbelt.1 — ordinary primitive
FORTH
(.)
( .. )(
)
;
as:"paren-dot";
ordinary primitive (.)
an executable word (no special usage info)
or wrapper call around p4_paren_dot
done:useful.1 — immediate primitive
EXTENSIONS
)
( .. )(
)
;
as:"done";
immediate primitive )
an executable word (no special usage info)
or wrapper call around p4_prefix_end
star:core — ordinary primitive
FORTH
*
( a b -- a*b )(
)
;
p4:"star";
return the multiply of the two args
power:forth_83 — ordinary primitive
FORTH
**
( a b -- r )(
)
;
p4:"power";
raise second to top power
plus:core — ordinary primitive
FORTH
+
( a b -- a+b )(
)
;
p4:"plus";
return the sum of the two args
plus-store:core — ordinary primitive
FORTH
+!
( val addr -- )(
)
;
p4:"plus-store";
add val to the value found in addr
simulate: : +! TUCK @ + SWAP ! ;
plus-plus:forth_usual — ordinary primitive
FORTH
++
( addr -- )(
)
;
p4:"plus-plus";
Increment the value at _addr_.
: ++ ( addr -- ) 1 SWAP +! ;
plus-plus:toolbelt — ordinary primitive
FORTH
++
( addr -- )(
)
;
p4:"plus-plus";
Increment the value at _addr_.
: ++ ( addr -- ) 1 SWAP +! ;
comma:core — ordinary primitive
FORTH
,
( val -- )(
)
;
p4:"comma";
store the value in the dictionary
simulate: : , DP 1 CELLS DP +! ! ;
comma-quote:toolbelt.1 — immediate primitive
FORTH
,"
( .. )(
)
;
as:"comma-quote";
immediate primitive ,"
an executable word (no special usage info)
or wrapper call around p4_parse_comma_quote
minus:core — ordinary primitive
FORTH
-
( a b -- a-b )(
)
;
p4:"minus";
return the difference of the two arguments
dot:core — ordinary primitive
FORTH
.
( val -- )(
)
;
p4:"dot";
print the numerical value to stdout - uses BASE
dot-quote:core — compiling primitive
FORTH
."
( [string<">] -- )(
)
;
p4:"dot-quote";
print the string to stdout
dot-paren:core — immediate primitive
FORTH
.(
( [message<closeparen>] -- )( | ) ; |
; |
print the message to the screen while reading a file. This works too while compiling, so you can whatch the interpretation/compilation to go on. Some Forth-implementations won't even accept a ." message" outside compile-mode while the (current) pfe does.
slash:core — ordinary primitive
FORTH
/
( a b -- a/b )(
)
;
p4:"slash";
return the quotient of the two arguments
slash-slash:cdecl.1 — immediate synonym
FORTH
//
( .. )(
)
;
as:"slash-slash";
immediate synonym //
is doing the same as \\
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
zero:core_misc.1 — ordinary constant
FORTH
0
( .. )(
)
;
as:"zero";
( 0 ) constant 0
an ordinary constant (no special usage info)
zero-less:core — ordinary primitive
FORTH
0<
( val -- cond )(
)
;
p4:"zero-less";
return a flag that is true if val is lower than zero
simulate: : 0< 0 < ;
zero-less-equal:core_misc — ordinary primitive
FORTH
0<=
( a -- flag )(
)
;
p4:"zero-less-equal";
simulate : 0<= 0> 0= ;
zero-equal:core — ordinary primitive
FORTH
0=
( val -- cond )(
)
;
p4:"zero-equal";
return a flag that is true if val is just zero
simulate: : 0= 0 = ;
zero-greater:core — ordinary primitive
FORTH
0>
( value -- cond )(
)
;
p4:"zero-greater";
return value greater than zero
simulate: : 0> 0 > ;
zero-greater-equal:core_misc — ordinary primitive
FORTH
0>=
( a -- flag )( | ) ; |
; |
simulate : 0>= 0< 0= ;
one:core_misc.1 — ordinary constant
FORTH
1
( .. )(
)
;
as:"one";
( 1 ) constant 1
an ordinary constant (no special usage info)
one-plus:core — ordinary primitive
FORTH
1+
( val -- val+1 )(
)
;
p4:"one-plus";
return the value incremented by one
simulate: : 1+ 1 + ;
one-minus:core — ordinary primitive
FORTH
1-
( val -- val-1 )(
)
;
p4:"one-minus";
return the value decremented by one
simulate: : 1- 1 - ;
two:core_misc.1 — ordinary constant
FORTH
2
( .. )(
)
;
as:"two";
( 2 ) constant 2
an ordinary constant (no special usage info)
two-store:core — ordinary primitive
FORTH
2!
( a,a addr -- )(
)
;
p4:"two-store";
double-cell store
two-star:core — ordinary primitive
FORTH
2*
( a -- a*2 )(
)
;
p4:"two-star";
multiplies the value with two - but it does actually use a shift1 to be faster
simulate: : 2* 2 * ; ( canonic) : 2* 1 LSHIFT ; ( usual)
two-plus:forth_83 — ordinary primitive
FORTH
2+
( i -- i )(
)
;
p4:"two-plus";
add 2 to the value on stack (and leave the result there)
simulate: : 2+ 2 + ;
two-minus:forth_83 — ordinary primitive
FORTH
2-
( i -- i )(
)
;
p4:"two-minus";
substract 2 from the value on stack (and leave the result there)
simulate: : 2- 2 - ;
two-slash:core — ordinary primitive
FORTH
2/
( a -- a/2 )(
)
;
p4:"two-slash";
divides the value by two - but it does actually use a shift1 to be faster
simulate: : 2/ 2 / ; ( canonic) : 2/ 1 RSHIFT ; ( usual)
two-fetch:core — ordinary primitive
FORTH
2@
( addr -- a,a )(
)
;
p4:"two-fetch";
double-cell fetch
three:core_misc.1 — ordinary constant
FORTH
3
( .. )(
)
;
as:"three";
( 3 ) constant 3
an ordinary constant (no special usage info)
less-than:core — ordinary primitive
FORTH
<
( a b -- cond )(
)
;
p4:"less-than";
return a flag telling if a is lower than b
less-equal:core_misc — ordinary primitive
FORTH
<=
( a b -- flag )(
)
;
p4:"less-equal";
simulate : <= > 0= ;
not-equals:core — ordinary primitive
FORTH
<>
( a b -- cond )(
)
;
p4:"not-equals";
return true if a and b are not equal, see =
equals:core — ordinary primitive
FORTH
=
( a b -- cond )(
)
;
p4:"equals";
return a flag telling if a is equal to b
greater-than:core — ordinary primitive
FORTH
>
( a b -- cond )(
)
;
p4:"greater-than";
return a flag telling if a is greater than b
byte-swap:forth_83 — ordinary primitive
FORTH
><
( a -- a' )(
)
;
p4:"byte-swap";
byte-swap a word
greater-equal:core_misc — ordinary primitive
FORTH
>=
( a b -- flag )(
)
;
p4:"greater-equal";
simulate : >= < 0= ;
question:tools — ordinary primitive
FORTH
?
( addr -- )(
)
;
p4:"question";
Display the (integer) content of at address addr. This word is sensitive to BASE
simulate: : ? @ . ;
fetch:core — ordinary primitive
FORTH
@
( addr -- value )(
)
;
p4:"fetch";
fetch the value from the variables address
fetch-plus:forth_usual.1 — forthword synonym
FORTH
@+
( .. )(
)
;
as:"fetch-plus";
forthword synonym @+
is doing the same as @++
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
fetch-plus:toolbelt.1 — ordinary primitive
FORTH
@+
( .. )(
)
;
as:"fetch-plus";
ordinary primitive @+
an executable word (no special usage info)
or wrapper call around p4_fetch_plus_plus
fetch-plus-plus:forth_usual — ordinary primitive
FORTH
@++
( addr -- addr' x )( | ) ; |
; |
Fetch the value _x_ from _addr_, and increment the address by one cell.
: @++ ( addr -- addr' x ) DUP CELL+ SWAP @ ;
fetch-from:your — compiling primitive
EXTENSIONS
@>
( [name] -- value )(
)
;
p4:"fetch-from";
bracket-tick:core — compiling primitive
FORTH
[']
( [name] -- )immediate( | ) ; |
; |
will place the execution token of the following word into the dictionary. See ' for non-compiling variant.
backslash:core — immediate primitive
FORTH
\
( [comment<eol>] -- )(
)
;
p4:"backslash";
eat everything up to the next end-of-line so that it is getting ignored by the interpreter.
backslash-backslash:toolbelt — ordinary primitive
FORTH
\\
( "...<eof>" -- )( | ) ; |
; |
Ignore the rest of the input stream.
: \\ BEGIN -1 PARSE 2DROP REFILL 0= UNTIL ;
abort:exception — ordinary primitive
FORTH
ABORT
( -- )no-return(
)
;
p4:"abort";
throw - cleanup some things and go back to the QUIT routine
: ABORT -1 THROW ;
abort-quote:exception — compiling primitive
FORTH
ABORT"
( [string<">] -- )no-return( | ) ; |
; |
throw like ABORT but print an additional error-message to stdout telling what has happened.
abort-minus-wordlist:chainlist.1 — - loader type P4_DVaL
EXTENSIONS
ABORT-WORDLIST
( .. )( | ) ; |
; |
- loader type P4_DVaL ABORT-WORDLIST
abort_wl (no special usage info)
abs:core — ordinary primitive
FORTH
ABS
( value -- value' )(
)
;
p4:"abs";
return the absolute value
accept:core — ordinary primitive
FORTH
ACCEPT
( a n -- n' )(
)
;
p4:"accept";
get a string from terminal into the named input buffer, returns the number of bytes being stored in the buffer. May provide line-editing functions.
access-array:misc — ordinary primitive
FORTH
ACCESS-ARRAY
( i1 i2 ... iX addr1 --- addr2 n )( | ) ; |
; |
see BUILD-ARRAY
addr-back-name:debug.1 — ordinary primitive
FORTH
ADDR>NAME
( addr -- nfa|0 )( | ) ; |
; |
search the next corresponding namefield that address is next too. If it is not in the base-dictionary, then just return 0 as not-found.
_export const p4char * p4_addr_to_name (const p4char* addr)address-minus-unit-minus-bits:core::environment — ordinary constant
ENVIRONMENT
ADDRESS-UNIT-BITS
( .. )( | ) ; |
; |
( CHAR_BIT ) constant ADDRESS-UNIT-BITS
an ordinary constant (no special usage info)
ahead:tools — immediate primitive
FORTH
AHEAD
( -- DP-mark ORIG-magic )compile-only( | ) ; |
; |
simulate: : AHEAD MARK> (ORIG#) ;
alias:chainlist — ordinary primitive
EXTENSIONS
ALIAS
( xt "name" -- )(
)
;
p4:"alias";
create a defer word that is initialized with the given x-token. DO-ALIAS
alias-atexit:chainlist — ordinary primitive
EXTENSIONS
ALIAS-ATEXIT
( xt "name" -- )( | ) ; |
; |
create a defer word that is initialized with the given x-token.
: ALIAS-ATEXIT ATEXIT-WORDLIST DO-ALIAS ;
align:core — ordinary primitive
FORTH
ALIGN
( -- )(
)
;
p4:"align";
will make the dictionary aligned, usually to a cell-boundary, see ALIGNED
allocate:memory — ordinary primitive
FORTH
ALLOCATE
( size -- ptr|0 code )( | ) ; |
; |
allocate a chunk of memory from the system heap. use FREE to release the memory area back to the system. <br> a code of zero means success.
also:search — ordinary primitive
FORTH
ALSO
( -- )(
)
;
p4:"also";
a DUP on the search ORDER - each named vocabulary replaces the topmost ORDER vocabulary. Using ALSO will make it fixed to the search-order. (but it is not nailed in trap-conditions as if using DEFAULT-ORDER )
order: vocn ... voc2 voc1 -- vocn ... voc2 voc1 voc1
also-module:module — ordinary primitive
EXTENSIONS
ALSO-MODULE
( "name" -- )( | ) ; |
; |
affects the search-order, ALSO module-wid CONTEXT !
: ALSO-MODULE ' DUP VOC? ABORT?" is no vocabulary" ALSO EXECUTE ;
and:core — ordinary primitive
FORTH
AND
( val mask -- val' )(
)
;
p4:"and";
mask with a bitwise and - be careful when applying it to logical values.
andif:toolbelt — compiling primitive
FORTH
ANDIF
( p ... -- flag )(
)
;
p4:"andif";
Given `p ANDIF q THEN`, _q_ will not be performed if _p_ is false.
: ANDIF S" DUP IF DROP " EVALUATE ; IMMEDIATE
anew:core — ordinary primitive
EXTENSIONS
ANEW
( 'name' -- )(
)
;
p4:"anew";
creates a MARKER if it doesn't exist, or forgets everything after it if it does. (it just gets executed).
: ANEW BL WORD DUP FIND NIP IF EXECUTE THEN (MARKER) ;
append-char:forth_usual — forthword synonym
FORTH
APPEND-CHAR
( char addr -- )( | ) ; |
; |
Append _char_ to the counted string at _addr_. a.k.a. C+PLACE of the PLACE family
: APPEND-CHAR DUP >R COUNT DUP 1+ R> C! + C! ;
Append _char_ to the counted string at _addr_. a.k.a. APPEND-CHAR (being a SYNONYM now)
: C+PLACE DUP >R COUNT DUP 1+ R> C! + C! ;
append-char:toolbelt — ordinary primitive
FORTH
APPEND-CHAR
( char addr -- )( | ) ; |
; |
Append _char_ to the counted string at _addr_. a.k.a. C+PLACE of the PLACE family
: APPEND-CHAR DUP >R COUNT DUP 1+ R> C! + C! ;
Append _char_ to the counted string at _addr_. a.k.a. APPEND-CHAR (being a SYNONYM now)
: C+PLACE DUP >R COUNT DUP 1+ R> C! + C! ;
appendz:zchar.1 — forthword synonym
FORTH
APPENDZ
( .. )(
)
;
as:"appendz";
forthword synonym APPENDZ
is doing the same as +ZPLACE
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
application:misc.1 — threadstate variable
FORTH
APPLICATION
( .. )(
)
;
as:"application";
threadstate variable APPLICATION
application (no special usage info)
args-brace:dstrings — immediate primitive
FORTH
ARGS{
( arg1'$ ... argN'$ "arg1 ... argN <}>" -- )( | ) ; |
; |
compilation: ( -- $: arg1$ ... argN$ )
Immediate and compilation-only.
Copy the argument strings to the string buffer, push them onto the string stack with "argN" the most accessible, and make them into the top compile-time string stack frame. Compile the run-time code to make an argument frame out of the N most accessible run-time string stack entries. Inform the system text interpreter that it should compile run-time code for any white-space delimited argument encountered in the text of the definition, that concatenates the corresponding string in the run-time frame. At the semicolon terminating the definition, drop the compile-time argument frame and compile code to drop the run-time argument frame. <ansref>"args-brace"</ansref>
Syntax for defining a string macro GEORGE:
: george ($: a$ b$ c$ -- cat$ ) args{ arg1 arg2 arg3 } cat" This is arg1: " arg1 cat" ." ENDCAT ;
The blank following the last argument is required. For a macro with no arguments, ARGS{ } does nothing but add useless overhead and should be omitted. Two of the arguments in this example are ignored and could have been left out. Words intended only as steps in building a macro would omit ENDCAT, which terminates concatenation and leaves the concatenated string on the string stack.
Sample syntax using the string macro GEORGE:
$" bill" $" sue" $" marie" george $.
The resulting display is:
This is arg1: bill.
NOTE: Macro argument labels must be distinct from each other and from any local labels that appear in the same definition, and there is no check for that.
NOTE: At the moment the semantics of ARGS{ is undefined before DOES>.
array-of:struct — ordinary primitive
EXTENSIONS
ARRAY-OF
( some-offset n len "name" -- some-offset )( | ) ; |
; |
array-colon:structs.1 — ordinary primitive
EXTENSIONS
ARRAY:
( .. )(
)
;
as:"array-colon";
ordinary primitive ARRAY:
an executable word (no special usage info)
or wrapper call around p4_array_of
assume-dumbterm:term — ordinary primitive
EXTENSIONS
ASSUME_DUMBTERM
( -- )( | ) ; |
; |
load hardwired DUMBTERM-termcap into the terminal-driver
assume-vt100:term — ordinary primitive
EXTENSIONS
ASSUME_VT100
( -- )(
)
;
p4:"assume-vt100";
load hardwired VT100-termcap into the terminal-driver
at-x-y:facility — ordinary primitive
FORTH
AT-XY
( col row -- )(
)
;
p4:"at-x-y";
move the cursor position to the given row and column of the screen. If the output device is not a terminal this will have no effect but can still send an escape sequence.
atexit-minus-wordlist:chainlist.1 — - loader type P4_DVaL
EXTENSIONS
ATEXIT-WORDLIST
( .. )( | ) ; |
; |
- loader type P4_DVaL ATEXIT-WORDLIST
atexit_wl (no special usage info)
audio-s-sixteen:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_S16
( .. )(
)
;
as:"audio-s-sixteen";
( AUDIO_S16 ) constant AUDIO_S16
an ordinary constant (no special usage info)
audio-s-sixteen-lsb:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_S16LSB
( .. )( | ) ; |
; |
( AUDIO_S16LSB ) constant AUDIO_S16LSB
an ordinary constant (no special usage info)
audio-s-sixteen-msb:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_S16MSB
( .. )( | ) ; |
; |
( AUDIO_S16MSB ) constant AUDIO_S16MSB
an ordinary constant (no special usage info)
audio-s-sixteen-sys:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_S16SYS
( .. )( | ) ; |
; |
( AUDIO_S16SYS ) constant AUDIO_S16SYS
an ordinary constant (no special usage info)
audio-s-eight:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_S8
( .. )(
)
;
as:"audio-s-eight";
( AUDIO_S8 ) constant AUDIO_S8
an ordinary constant (no special usage info)
audio-u-sixteen:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_U16
( .. )(
)
;
as:"audio-u-sixteen";
( AUDIO_U16 ) constant AUDIO_U16
an ordinary constant (no special usage info)
audio-u-sixteen-lsb:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_U16LSB
( .. )( | ) ; |
; |
( AUDIO_U16LSB ) constant AUDIO_U16LSB
an ordinary constant (no special usage info)
audio-u-sixteen-msb:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_U16MSB
( .. )( | ) ; |
; |
( AUDIO_U16MSB ) constant AUDIO_U16MSB
an ordinary constant (no special usage info)
audio-u-sixteen-sys:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_U16SYS
( .. )( | ) ; |
; |
( AUDIO_U16SYS ) constant AUDIO_U16SYS
an ordinary constant (no special usage info)
audio-u-eight:lib_sdl.1 — ordinary constant
[SDL]
AUDIO_U8
( .. )(
)
;
as:"audio-u-eight";
( AUDIO_U8 ) constant AUDIO_U8
an ordinary constant (no special usage info)
b-slash-buf:block_misc.1 — ordinary constant
EXTENSIONS
B/BUF
( .. )(
)
;
as:"b-slash-buf";
( P4_BPBUF ) constant B/BUF
an ordinary constant (no special usage info)
back:toolbelt — ordinary primitive
FORTH
BACK
( str len char -- str len-i )( | ) ; |
; |
Look for a particular character in the string from the back toward the front.
: BACK >R BEGIN DUP WHILE 1- 2DUP + C@ R@ = UNTIL 1+ THEN R> DROP ;
backspace:misc — ordinary primitive
FORTH
BACKSPACE
( -- )(
)
;
p4:"backspace";
reverse of SPACE
sharp-backspace-minus-char:forth_usual.1 — ordinary constant
FORTH
#BACKSPACE-CHAR
( .. )( | ) ; |
; |
( '\b' ) constant #BACKSPACE-CHAR
an ordinary constant (no special usage info)
sharp-backspace-minus-char:toolbelt.1 — ordinary constant
FORTH
#BACKSPACE-CHAR
( .. )( | ) ; |
; |
( '\b' ) constant #BACKSPACE-CHAR
an ordinary constant (no special usage info)
base:core.1 — threadstate variable
FORTH
BASE
( .. )(
)
;
as:"base";
threadstate variable BASE
base (no special usage info)
behavior:header — ordinary primitive
EXTENSIONS
BEHAVIOR
( xt1 -- xt2 )(
)
;
p4:"behavior";
get the execution token xt2 that would be executed by the DEFER identified by xt1.
This command is used to obtain the execution contents of a deferred word. A typical use would be to retrieve and save the execution behavior of the deferred word, set the deferred word to a new behavior, and then later restore the old behavior.
If the deferred word identified by _xt1_ is associated with some other deferred word, _xt2_ is the execution token of that other deferred word. To retrieve the execution token of the word currently associated with that other deferred word, use the phrase BEHAVIOR BEHAVIOR .
Experience: Many years of use in OpenBoot and OpenFirmware systems. (Proposed for ANS Forth 2001)
In PFE it is the inverse of an IS operation and it will never fail if applied to a word with atleast a body. That's just like IS can be applied to almost every DOES> word where BEHAVIOR will get the value back.
dot-bell:term.1 — ordinary primitive
EXTENSIONS
.BELL
( .. )(
)
;
as:"dot-bell";
ordinary primitive .BELL
an executable word (no special usage info)
or wrapper call around p4_dot_bell
bin:file — ordinary primitive
FORTH
BIN
( access-mode -- access-mode' )( | ) ; |
; |
modify the give file access-mode to be a binary-mode
store-bits:forth_83 — ordinary primitive
FORTH
!BITS
( bits addr mask -- )( | ) ; |
; |
at the cell pointed to by addr, change only the bits that are enabled in mask
simulate: : !BITS >R 2DUP @ R NOT AND SWAP R> AND OR SWAP ! DROP ;
bl:core.1 — ordinary constant
FORTH
BL
( .. )(
)
;
as:"bl";
( ' ' ) constant BL
an ordinary constant (no special usage info)
bl-scan:toolbelt — ordinary primitive
FORTH
BL-SCAN
( str len -- str+i len-i )( | ) ; |
; |
Look for white space from start of string
: BL-SCAN BEGIN DUP WHILE OVER C@ IS-WHITE NOT WHILE 1 /STRING REPEAT THEN ;
bl-skip:toolbelt — ordinary primitive
FORTH
BL-SKIP
( str len -- str+i len-i )( | ) ; |
; |
Skip over white space at start of string.
: BL-SKIP BEGIN DUP WHILE OVER C@ IS-WHITE WHILE 1 /STRING REPEAT THEN ;
dot-blinking:term.1 — ordinary primitive
EXTENSIONS
.BLINKING
( .. )(
)
;
as:"dot-blinking";
ordinary primitive .BLINKING
an executable word (no special usage info)
or wrapper call around p4_dot_blink
dot-blinking-dot-off:term.1 — ordinary primitive
EXTENSIONS
.BLINKING.OFF
( .. )( | ) ; |
; |
ordinary primitive .BLINKING.OFF
an executable word (no special usage info)
or wrapper call around p4_dot_blink_off
blk:block.1 — threadstate variable
FORTH
BLK
( .. )(
)
;
as:"blk";
threadstate variable BLK
input.blk (no special usage info)
block:block — ordinary primitive
FORTH
BLOCK
( u -- addr )(
)
;
p4:"block";
load the specified block into a block buffer and return the address of that block buffer - see also BUFFER
block-minus-ext:block::environment — ordinary constant
ENVIRONMENT
BLOCK-EXT
( .. )(
)
;
as:"block-minus-ext";
( 1994 ) constant BLOCK-EXT
an ordinary constant (no special usage info)
block-minus-file:block_misc.1 — - loader type P4_DVaL
EXTENSIONS
BLOCK-FILE
( .. )(
)
;
as:"block-minus-file";
- loader type P4_DVaL BLOCK-FILE
input.block_file (no special usage info)
to-body:core — ordinary primitive
FORTH
>BODY
( addr -- addr' )(
)
;
p4:"to-body";
adjust the execution-token (ie. the CFA) to point to the parameter field (ie. the PFA) of a word. this is not a constant operation - most words have their parameters at "1 CELLS +" but CREATE/DOES-words have the parameters at "2 CELLS +" and ROM/USER words go indirect with a rom'ed offset i.e. "CELL + @ UP +"
body-from:header — ordinary primitive
FORTH
BODY>
( pfa -- cfa )(
)
;
p4:"body-from";
trying to convert a pointer to the parameter-field (PFA) to point then to the corresponding code-field (CFA) - note that this is not necessarily the inverse of >BODY instead it is a fast implementation assuming a VARIABLE thing had been used. Every use of "BODY>" is warned in the logfile.
implementation-specific simulation: : BODY> CELL - ;
boot-script-colon:host_k12 — ordinary primitive
FORTH
BOOT-SCRIPT:
( "string" -- )( | ) ; |
; |
DO NOT USE! will vanish w/o warning in the next version! see BOOT-SCRIPT@
boot-script-fetch:host_k12 — ordinary primitive
FORTH
BOOT-SCRIPT@
( -- s-a s-n )( | ) ; |
; |
the file that will be include on next COLD boot DO NOT USE! will vanish w/o warning in the next version!
bounds:forth_usual — ordinary primitive
FORTH
BOUNDS
( str len -- str+len str )( | ) ; |
; |
Convert _str len_ to range for DO-loop.
: BOUNDS ( str len -- str+len str ) OVER + SWAP ;
bounds:toolbelt — ordinary primitive
FORTH
BOUNDS
( str len -- str+len str )( | ) ; |
; |
Convert _str len_ to range for DO-loop.
: BOUNDS ( str len -- str+len str ) OVER + SWAP ;
branch:system.1 — ordinary primitive
FORTH
BRANCH
( .. )(
)
;
as:"branch";
ordinary primitive BRANCH
an executable word (no special usage info)
or wrapper call around p4_else_execution
question-branch:system.1 — ordinary primitive
FORTH
?BRANCH
( .. )(
)
;
as:"question-branch";
ordinary primitive ?BRANCH
an executable word (no special usage info)
or wrapper call around p4_if_execution
str-break:dstrings.1 — ordinary primitive
FORTH
$BREAK
( .. )(
)
;
as:"str-break";
ordinary primitive $BREAK
an executable word (no special usage info)
or wrapper call around str_break
str-buffer:dstrings.1 — ordinary primitive
FORTH
$BUFFER
( .. )(
)
;
as:"str-buffer";
ordinary primitive $BUFFER
an executable word (no special usage info)
or wrapper call around str_buffer
buffer:block — ordinary primitive
FORTH
BUFFER
( u -- addr )(
)
;
p4:"buffer";
get the block buffer address for the specified block - if it had not been loaded already it is not filled with data from the disk unlike BLOCK does.
build-array:misc — ordinary primitive
FORTH
BUILD-ARRAY
( n1 n2 ... nX X --- n )( | ) ; |
; |
writes X, n1, ... nX into the dictionary - returns product n1 * n2 * ... * nX
builds:core — definining primitive
FORTH
<BUILDS
( 'name' -- )(
)
;
p4:"builds";
make a HEADER whose runtime will be changed later using DOES>
note that ans'forth does not define <BUILDS and it suggests to use CREATE directly.
... if you want to write FIG-programs in pure pfe then you have to use CREATE: to get the FIG-like meaning of CREATE whereas the ans-forth CREATE is the same as <BUILDS
: <BUILDS BL WORD HEADER DOCREATE A, 0 A, ;
bye:tools — ordinary primitive
FORTH
BYE
( -- )no-return(
)
;
p4:"bye";
should quit the forth environment completly
c-store:core — ordinary primitive
FORTH
C!
( value address -- )(
)
;
p4:"c-store";
store the byte-value at address, see !
c-plus-store:forth_usual — ordinary primitive
FORTH
C+!
( n addr -- )(
)
;
p4:"c-plus-store";
Add the low-order byte of _n_ to the byte at _addr_, removing both from the stack.
c-plus-store:toolbelt — ordinary primitive
FORTH
C+!
( n addr -- )(
)
;
p4:"c-plus-store";
Add the low-order byte of _n_ to the byte at _addr_, removing both from the stack.
c-plus-place:forth_usual.1 — ordinary primitive
FORTH
C+PLACE
( .. )(
)
;
as:"c-plus-place";
ordinary primitive C+PLACE
an executable word (no special usage info)
or wrapper call around p4_append_char
c-comma:core — ordinary primitive
FORTH
C,
( value -- )(
)
;
p4:"c-comma";
store a new byte-value in the dictionary, implicit 1 ALLOT, see ,
c-fetch:core — ordinary primitive
FORTH
C@
( addr -- value )(
)
;
p4:"c-fetch";
fetch a byte-value from the address, see @
call-minus-c:dlfcn.1 — ordinary primitive
EXTENSIONS
CALL-C
( .. )(
)
;
as:"call-minus-c";
ordinary primitive CALL-C
an executable word (no special usage info)
or wrapper call around p4_call_c
case-sensitive-voc:useful — ordinary primitive
EXTENSIONS
CASE-SENSITIVE-VOC
( -- )( | ) ; |
; |
accesses CONTEXT which is generally the last named VOCABULARY . sets a flag in the vocabulary-definition so that words are matched case-sensitive.
example: VOCABULARY MY-VOC MY-VOC CASE-SENSITIVE-VOC
OBSOLETE! use DEFS-ARE-CASE-SENSITIVE
case-minus-sensitive-question:environ::environment — ordinary primitive
ENVIRONMENT
CASE-SENSITIVE?
( .. )( | ) ; |
; |
ordinary primitive CASE-SENSITIVE?
an executable word (no special usage info)
or wrapper call around p__case_sensitive_Q
case-magic:tools_misc.1 — ordinary constant
EXTENSIONS
CASE_MAGIC
( .. )(
)
;
as:"case-magic";
( P4_CASE_MAGIC ) constant CASE_MAGIC
an ordinary constant (no special usage info)
cat:dstrings — ordinary primitive
FORTH
CAT
($: a$ -- )(
)
;
p4:"cat";
Append the string body to the end of the string currently being concatenated as the last string in the string buffer, and update its count field. If there is no concatenating string, start one. An error is thrown if the size of the combined string would be larger than MAX_MCOUNT or if there is not enough room in string space even after a garbage collection.
If garbage collection occurs, a$ remains valid even when it is in the string buffer.
When there is a concatenating string, concatenation is the only basic string operation that can copy a string into the string buffer. <ansref>"cat"</ansref>
NOTE: It is left to the user to define special concatenating words like:
: \n-cat ( -- ) \n$ cat ;
cat-quote:dstrings — compiling primitive
FORTH
CAT"
( "ccc<quote>" -- )(
)
;
p4:"cat-quote";
This word has only compile-time semantics, just like CAT`. It appends run-time semantics to the current definition that concatenates the quoted string according to the specification for CAT. An error is thrown if the length of the quoted string is longer than the system parameter MAX_DATA_STR (see S,). <ansref>"cat-quote"</ansref>
catch:exception — ordinary primitive
FORTH
CATCH
( xt -- 0|n )(
)
;
p4:"catch";
execute the given execution-token and catch any exception that can be caught therein. software can arbitrarily raise an exception using THROW - the value 0 means there was no exception, other denote implementation dependent exception-codes.
cat-back-tick:dstrings — compiling primitive
FORTH
CAT`
( "ccc<backtick>" -- )( | ) ; |
; |
This word has only compile-time semantics, just like CAT". It appends run-time semantics to the current definition that concatenates the back-ticked string according to the specification for CAT. An error is thrown if the length of the quoted string is longer than the system parameter MAX_DATA_STR (see S,). <ansref>"cat-back-tick"</ansref>
cd:shell.1 — obsolete forthword
EXTENSIONS
CD
( .. )(
)
;
as:"cd";
obsolete forthword CD
is doing the same as CHDIR
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
slash-cell:misc.1 — ordinary constant
FORTH
/CELL
( .. )(
)
;
as:"slash-cell";
( sizeof (p4cell) ) constant /CELL
an ordinary constant (no special usage info)
cell:toolbelt.1 — ordinary constant
FORTH
CELL
( .. )(
)
;
as:"cell";
( sizeof(p4cell) ) constant CELL
an ordinary constant (no special usage info)
minus-cell:toolbelt.1 — ordinary constant
FORTH
-CELL
( .. )(
)
;
as:"minus-cell";
( - sizeof(p4cell) ) constant -CELL
an ordinary constant (no special usage info)
cell-percent:struct.1 — ordinary primitive
EXTENSIONS
CELL%
( .. )(
)
;
as:"cell-percent";
ordinary primitive CELL%
an executable word (no special usage info)
or wrapper call around p4_cell_mod
cell-plus:core — ordinary primitive
FORTH
CELL+
( value -- value' )(
)
;
p4:"cell-plus";
adjust the value by adding a single Cell's width - the value is often an address or offset, see CELLS
cell-minus:toolbelt — ordinary primitive
FORTH
CELL-
( addr -- addr' )(
)
;
p4:"cell-minus";
Decrement address by one cell
: CELL- ( addr -- addr' ) CELL - ;
cell-colon:structs.1 — ordinary primitive
EXTENSIONS
CELL:
( .. )(
)
;
as:"cell-colon";
ordinary primitive CELL:
an executable word (no special usage info)
or wrapper call around p4_cell_colon
cells:core — ordinary primitive
FORTH
CELLS
( value -- value' )(
)
;
p4:"cells";
scale the value by the sizeof a Cell the value is then often applied to an address or fed into ALLOT
cells-colon:structs.1 — ordinary primitive
EXTENSIONS
CELLS:
( .. )(
)
;
as:"cells-colon";
ordinary primitive CELLS:
an executable word (no special usage info)
or wrapper call around p4_cells_colon
cfa-tick:core.1 — ordinary primitive
FORTH
CFA'
( .. )(
)
;
as:"cfa-tick";
ordinary primitive CFA'
an executable word (no special usage info)
or wrapper call around p4_tick
dot-chain:chain — ordinary primitive
EXTENSIONS
.chain
( chain* -- )(
)
;
p4:"dot-chain";
show chain - compare with WORDS
chain-add:chain — ordinary primitive
EXTENSIONS
chain-add
( chain* "word-to-add" -- )( | ) ; |
; |
add chain item, for normal setup, at end of do-chain
: chain-add ' >r begin dup @ while @ repeat here swap ! 0 , r> , ; ( chain-add begin dup @ while @ repeat here swap ! 0, ' , )
chain-add-before:chain — ordinary primitive
EXTENSIONS
chain-add-before
( chain* "word-to-add" -- )( | ) ; |
; |
add chain item, for reverse chain like BYE
: chain-add-before ' >r here over @ , r> , swap ! ; ( chain-add-before link, ' , )
chain-minus-link:chain.1 — threadstate variable
EXTENSIONS
chain-link
( .. )(
)
;
as:"chain-minus-link";
threadstate variable chain-link
chain_link (no special usage info)
chain-minus-wordlists:search::environment — ordinary constant
ENVIRONMENT
CHAIN-WORDLISTS
( .. )( | ) ; |
; |
( P4_TRUE ) constant CHAIN-WORDLISTS
an ordinary constant (no special usage info)
gforth-chained:gforth — ordinary primitive
gforth'
chained
( xt list -- )\ gforth( | ) ; |
; |
generic chains
: chained linked , ;
gforth-chainperform:gforth — ordinary primitive
gforth'
chainperform
( list -- )\ gforth( | ) ; |
; |
: chainperform BEGIN @ dup WHILE dup cell+ perform REPEAT drop ;
dot-chains:chain — ordinary primitive
EXTENSIONS
.chains
( -- )(
)
;
p4:"dot-chains";
show all chains registered in the system - compare with VLIST
slash-char:useful.1 — ordinary constant
EXTENSIONS
/CHAR
( .. )(
)
;
as:"slash-char";
( sizeof(p4char) ) constant /CHAR
an ordinary constant (no special usage info)
char:core — ordinary primitive
FORTH
CHAR
( 'word' -- value )(
)
;
p4:"char";
return the (ascii-)value of the following word's first character.
char-percent:struct.1 — ordinary primitive
EXTENSIONS
CHAR%
( .. )(
)
;
as:"char-percent";
ordinary primitive CHAR%
an executable word (no special usage info)
or wrapper call around p4_char_mod
char-plus:core — ordinary primitive
FORTH
CHAR+
( value -- value' )(
)
;
p4:"char-plus";
increment the value by the sizeof one char - the value is often a pointer or an offset, see CHARS
char-colon:structs.1 — ordinary primitive
EXTENSIONS
CHAR:
( .. )(
)
;
as:"char-colon";
ordinary primitive CHAR:
an executable word (no special usage info)
or wrapper call around p4_char_colon
chars:core — ordinary primitive
FORTH
CHARS
( value -- value' )(
)
;
p4:"chars";
scale the value by the sizeof a char - the value is then often applied to an address or fed into ALLOT (did you expect that sizeof(p4char) may actually yield 2 bytes?)
sharp-chars-slash-line:toolbelt.1 — ordinary constant
FORTH
#CHARS/LINE
( .. )( | ) ; |
; |
( 80 ) constant #CHARS/LINE
an ordinary constant (no special usage info)
chars-colon:structs.1 — ordinary primitive
EXTENSIONS
CHARS:
( .. )(
)
;
as:"chars-colon";
ordinary primitive CHARS:
an executable word (no special usage info)
or wrapper call around p4_chars_colon
chdir:shell — ordinary primitive
EXTENSIONS
CHDIR
( bstring -- )(
)
;
p4:"chdir";
change the current directory. <br>
clearstack:misc — ordinary primitive
FORTH
CLEARSTACK
( -- )(
)
;
p4:"clearstack";
reset the parameter stack to be empty
: CLEARSTACK S0 SP! ;
clk-tck:posix::environment — ordinary primitive
ENVIRONMENT
CLK_TCK
( .. )(
)
;
as:"clk-tck";
ordinary primitive CLK_TCK
an executable word (no special usage info)
or wrapper call around p4__clk_tck
clock:posix — ordinary primitive
EXTENSIONS
CLOCK
( --- ticks )(
)
;
"clock";
return clock()
close-blockfile:block_misc — ordinary primitive
FORTH
CLOSE-BLOCKFILE
( -- )w32for( | ) ; |
; |
w32for-implementation:
blockhandle -1 <> if flush close-file drop then -1 set-blockfile
in pfe:
: CLOSE-BLOCKFILE BLOCK-FILE ?DUP IF FLUSH CLOSE-FILE DROP THEN OFF> BLOCK-FILE ;
gforth-close-dir:gforth — ordinary primitive
gforth'
close-dir
( wdirid -- wior )gforth close_dir( | ) ; |
; |
will vanish without warning. see gforth documentation.
close-file:file — ordinary primitive
FORTH
CLOSE-FILE
( file -- code )( | ) ; |
; |
close the file and return the status-code
close-terminal-logfile:host_k12 — ordinary primitive
EXTENSIONS
CLOSE-TERMINAL-LOGFILE
( -- )( | ) ; |
; |
close terminal logfile opened with OPEN-TERMINAL-LOGFILE
dot-clreol:term.1 — ordinary primitive
EXTENSIONS
.CLREOL
( .. )(
)
;
as:"dot-clreol";
ordinary primitive .CLREOL
an executable word (no special usage info)
or wrapper call around p4_dot_clreol
dot-clrscr:term.1 — ordinary primitive
EXTENSIONS
.CLRSCR
( .. )(
)
;
as:"dot-clrscr";
ordinary primitive .CLRSCR
an executable word (no special usage info)
or wrapper call around p4_dot_clrscr
cls:term.1 — ordinary primitive
EXTENSIONS
CLS
( .. )(
)
;
as:"cls";
ordinary primitive CLS
an executable word (no special usage info)
or wrapper call around p4_dot_clrscr
cmove:string — ordinary primitive
FORTH
CMOVE
( from-ptr to-ptr len -- )( | ) ; |
; |
memcpy an area from->to for len bytes, starting at the lower addresses, see CMOVE>
cmove-up:string — ordinary primitive
FORTH
CMOVE>
( from-ptr to-ptr len -- )( | ) ; |
; |
memcpy an area from->to for len bytes, starting with the higher addresses, see CMOVE
cold:misc — ordinary primitive
FORTH
COLD
( -- )(
)
;
p4:"cold";
cold abort - reinitialize everything and go to QUIT routine ... this routine is implemented as a warm-boot in pfe.
: WARM FENCE @ (FORGET) INCLUDE-FILE ?DUP IF COUNT INCLUDED THEN QUIT ;
collect-str-garbage:dstrings — ordinary primitive
FORTH
COLLECT-$GARBAGE
( -- collected-flag )( | ) ; |
; |
If string space is not marked as containing garbage, return false. If there is garbage, throw an error when garbage collection is disabled. Otherwise remove the garbage and return true. Garbage collection is "transparent", so the user would not normally use this word. <ansref>"collect-string-garbage"</ansref>
cols:term.1 — threadstate variable
EXTENSIONS
COLS
( .. )(
)
;
as:"cols";
threadstate variable COLS
cols (no special usage info)
come-back:debug — ordinary primitive
FORTH
COME_BACK
( -- )(
)
;
p4:"come-back";
show the return stack before last exception along with the best names as given by ADDR>NAME
compare:string — ordinary primitive
FORTH
COMPARE
( str-ptr1 str-len1 str-ptr2 str-len2 -- n )( | ) ; |
; |
compare both str-buffers, return 0 if they are equal, -1 if lower or shorter, and 1 if greater or longer
to-compile:useful — ordinary primitive
EXTENSIONS
>COMPILE
( xt -- )(
)
;
p4:"to-compile";
does the work of POSTPONE on the execution token that you got from somewhere else - so it checks if the name (that correspond to the execution-token argument) is actually immediate, so it has to be executed to compile something, e.g. IF or THEN - see also POSTPONE , COMPILE , [COMPILE] , INTERPRET
compile-comma:core — ordinary primitive
FORTH
COMPILE,
( xt -- )(
)
;
p4:"compile-comma";
place the execution-token on stack into the dictionary - in traditional forth this is not even the least different than a simple , but in call-threaded code there's a big difference - so COMPILE, is the portable one. Unlike COMPILE , [COMPILE] and POSTPONE this word does not need the xt to have actually a name, see :NONAME
constant:core — definining primitive
FORTH
CONSTANT
( value 'name' -- )( | ) ; |
; |
CREATE a new word with runtime ((CONSTANT)) so that the value placed here is returned everytime the constant's name is used in code. See VALUE for constant-like names that are expected to change during execution of the program. In a ROM-able forth the CONSTANT-value may get into a shared ROM-area and is never copied to a RAM-address.
two-constant:double — definining primitive
FORTH
2CONSTANT
( x1 x2 "name" -- )( | ) ; |
; |
create a word that contains the specified twocell number in its body. when the name is executed, these numbers are left on the stack
12. 2CONSTANT X .s <emtpy stack> ok X .s 0 12 ok
str-constant:dstrings — definining primitive
FORTH
$CONSTANT
( "name" $: a$ -- )( | ) ; |
; |
Create a definition for "name" with the execution semantics "name" execution: ($: -- a$ )
It is assumed that the input string resides as a measured, unchanging string outside of string space. <ansref>"string-constant"</ansref>
For example:
$" This is a sample string." $constant sample$
offset-constant:useful — definining primitive
EXTENSIONS
+CONSTANT
( offset "name" -- )( | ) ; |
; |
create a new offsetword. The word is created and upon execution it adds the offset, ie. compiling the OFFSET-RT runtime:
( address -- address+offset )
This word is just a convenience word, just use the word +FIELD directly and choose a DROP to flag the end of a current offset-field declaration series. See also /FIELD series to declare simple structures which end with a final CONSTANT to memorize the complete size. The /FIELD style is more traditional.
context:system.1 — - loader type P4_DVaL
FORTH
CONTEXT
( .. )(
)
;
as:"context";
- loader type P4_DVaL CONTEXT
context (no special usage info)
context-Q:useful — ordinary primitive
EXTENSIONS
CONTEXT?
( -- number )(
)
;
p4:"context-Q";
GET-CONTEXT and count how many times it is in the order but the CONTEXT variable itself. The returned number is therefore minus one the occurences in the complete search-order. usage:
ALSO EXTENSIONS CONTEXT? [IF] PREVIOUS [THEN] ALSO DEF' DEFAULT-ORDER : CONTEXT? 0 LVALUE _count GET-ORDER 1- SWAP LVALUE _context 0 ?DO _context = IF 1 +TO _count THEN LOOP _count ;
control:forth_usual — compiling primitive
FORTH
CONTROL
( [word] -- val )(
)
;
p4:"control";
see ASCII, but returns char - '@'
simulate: : CONTROL [COMPILE] [CHAR] [CHAR] @ - STATE @ IF [COMPILE] LITERAL THEN ;
convert:core — ordinary primitive
FORTH
CONVERT
( a b -- a b )(
)
;
p4:"convert";
digit conversion, obsolete, superseded by >NUMBER
copy-file:file_misc — ordinary primitive
FORTH
COPY-FILE
( src-str src-strlen dst-str dst-strlen -- errno|0 )( | ) ; |
; |
like RENAME-FILE, copies the file from src-name to dst-name and returns an error-code or null
core-minus-ext:core::environment — ordinary constant
ENVIRONMENT
CORE-EXT
( .. )(
)
;
as:"core-minus-ext";
( 1994 ) constant CORE-EXT
an ordinary constant (no special usage info)
count:core — ordinary primitive
FORTH
COUNT
( counted-string -- string-pointer string-length )( | ) ; |
; |
usually before calling TYPE
slash-counted-minus-string:core::environment — ordinary constant
ENVIRONMENT
/COUNTED-STRING
( .. )( | ) ; |
; |
( UCHAR_MAX ) constant /COUNTED-STRING
an ordinary constant (no special usage info)
cp:shell.1 — compiling primitive
EXTENSIONS
CP
( .. )(
)
;
as:"cp";
compiling primitive CP
an executable word (no special usage info)
or wrapper call around p4_cp
cr:core — ordinary primitive
FORTH
CR
( -- )(
)
;
p4:"cr";
print a carriage-return/new-line on stdout
create:core.1 — forthword synonym
FORTH
CREATE
( .. )(
)
;
as:"create";
forthword synonym CREATE
is doing the same as <BUILDS
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
create-blockfile:block_misc — ordinary primitive
FORTH
CREATE-BLOCKFILE
( n "filename" -- )w32for( | ) ; |
; |
w32for-implementation:
close-blockfile parse-word r/w create-file abort" failed to create block-file" set-blockfile dup b/buf m* blockhandle resize-file abort" unable to create a file of that size" empty-buffers 0 do i wipe loop flush
pfe does not wipe the buffers
create-file:file — ordinary primitive
FORTH
CREATE-FILE
( str-adr str-len mode -- file code )( | ) ; |
; |
create the file with the given name and open it - returns the file id and a status code. A code of zero means success. An existing file of the same name is truncated upon open.
c-reset:forth_usual — ordinary primitive
FORTH
CRESET
( n addr -- )(
)
;
p4:"c-reset";
reset bits in byte at given address
simulate: : CRESET TUCK @ SWAP NOT AND SWAP ! ;
cs-minus-drop:tools_misc.1 — ordinary primitive
FORTH
CS-DROP
( .. )(
)
;
as:"cs-minus-drop";
ordinary primitive CS-DROP
an executable word (no special usage info)
or wrapper call around p4_two_drop
cs-pick:tools — ordinary primitive
FORTH
CS-PICK
( 2a 2b 2c ... n -- 2a 2b 2c ... 2a )( | ) ; |
; |
pick a value in the compilation-stack - note that the compilation stack _can_ be seperate in some forth-implemenations. In PFE the parameter-stack is used in a double-cell fashion, so CS-PICK would 2PICK a DP-mark and a COMP-magic, see PICK
cs-roll:tools — ordinary primitive
FORTH
CS-ROLL
( 2a 2b 2c ... n -- 2b 2c ... 2a )( | ) ; |
; |
roll a value in the compilation-stack - note that the compilation stack _can_ be seperate in some forth-implemenations. In PFE the parameter-stack is used in a double-cell fashion, so CS-ROLL would 2ROLL a DP-mark and a COMP-magic, see ROLL
cs-minus-swap:tools_misc.1 — ordinary primitive
FORTH
CS-SWAP
( .. )(
)
;
as:"cs-minus-swap";
ordinary primitive CS-SWAP
an executable word (no special usage info)
or wrapper call around p4_two_swap
c-set:forth_usual — ordinary primitive
FORTH
CSET
( n addr -- )(
)
;
p4:"c-set";
set bits in byte at given address
simulate: : CSET TUCK @ SWAP OR SWAP ! ;
csp:tools_misc.1 — threadstate variable
FORTH
CSP
( .. )(
)
;
as:"csp";
threadstate variable CSP
csp (no special usage info)
c-toggle:forth_usual — ordinary primitive
FORTH
CTOGGLE
( n addr -- )(
)
;
p4:"c-toggle";
toggle bits in byte at given address
simulate: : CTOGGLE TUCK @ SWAP XOR SWAP ! ;
current:system.1 — threadstate variable
FORTH
CURRENT
( .. )(
)
;
as:"current";
threadstate variable CURRENT
current (no special usage info)
dot-date:core_misc — ordinary primitive
FORTH
.CVERSION
( -- )(
)
;
p4:"dot-date";
show the compile date of the current PFE system
: .CVERSION [ ENVIRONMENT ] FORTH-NAME TYPE FORTH-DATE TYPE ;
cwd:shell — ordinary primitive
EXTENSIONS
$CWD
( -- str-ptr str-len )(
)
;
p4:"cwd";
calls system's
getcwd
c-backslash-quote:zchar.1 — compiling primitive
FORTH
C\"
( .. )(
)
;
as:"c-backslash-quote";
compiling primitive C\"
an executable word (no special usage info)
or wrapper call around p4_c_backslash_quote
d-plus:double — ordinary primitive
FORTH
D+
( d1.ud1 d2.ud2 -- d3.ud3 )( | ) ; |
; |
the double-cell sum operation ( + )
d-minus:double.1 — ordinary primitive
FORTH
D-
( .. )(
)
;
as:"d-minus";
ordinary primitive D-
an executable word (no special usage info)
or wrapper call around p4_d_minus
d-dot:double — ordinary primitive
FORTH
D.
( d1.d1 -- )(
)
;
p4:"d-dot";
freefield output for a double-cell number ( . )
d-dot-r:double — ordinary primitive
FORTH
D.R
( d1.d1 n -- )(
)
;
p4:"d-dot-r";
aligned output for a double-cell number ( .R )
d-zero-less:double — ordinary primitive
FORTH
D0<
( d1.d1 -- flag )(
)
;
p4:"d-zero-less";
the double-cell less-than-zero operation ( 0< )
d-zero-equals:double — ordinary primitive
FORTH
D0=
( d1.d1 -- flag )(
)
;
p4:"d-zero-equals";
the double-cell equal-to-zero operation ( 0= )
d-two-star:double — ordinary primitive
FORTH
D2*
( d1.d1 -- d1.d1' )(
)
;
p4:"d-two-star";
the double-cell arithmetic shiftleft-by-1 operation ( 2* )
d-two-slash:double — ordinary primitive
FORTH
D2/
( d1.d1 -- d1.d1' )(
)
;
p4:"d-two-slash";
the double-cell arithmetic shiftright-by-1 operation ( 2/ )
d-less:double — ordinary primitive
FORTH
D<
( d1.d1 d2.d2 -- flag )(
)
;
p4:"d-less";
the double-cell is-less operation ( < )
d-equals:double — ordinary primitive
FORTH
D=
( d1.d1 d2.d2 -- flag )(
)
;
p4:"d-equals";
the double-cell is-equal operation ( = )
d-back-f:floating.1 — ordinary primitive
FORTH
D>F
( .. )(
)
;
as:"d-back-f";
ordinary primitive D>F
an executable word (no special usage info)
or wrapper call around p4_d_to_f
d-back-f:fpnostack.1 — ordinary primitive
EXTENSIONS
D>F
( .. )(
)
;
as:"d-back-f";
ordinary primitive D>F
an executable word (no special usage info)
or wrapper call around p4_nofp_d_to_f
d-to-s:double — ordinary primitive
FORTH
D>S
( d.d -- n )(
)
;
p4:"d-to-s";
result is the numeric equivalent of d. If the double number was greater than what could fit into a single cell number, the modulo cellsize will be left since the higher-significant bits are just DROPed
d-abs:double — ordinary primitive
FORTH
DABS
( d1.d1 -- d1.d1' )(
)
;
p4:"d-abs";
the double-cell abs operation ( ABS )
def-tick:useful.1 — obsolete immediate
EXTENSIONS
DEF'
( .. )(
)
;
as:"def-tick";
obsolete immediate DEF'
is doing the same as [DEF]
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
default-order:search — ordinary primitive
FORTH
DEFAULT-ORDER
( -- )(
)
;
p4:"default-order";
nail the current search ORDER so that it will even survive a trap-condition. This default-order can be explicitly loaded with RESET-ORDER
defer:header — definining primitive
EXTENSIONS
DEFER
( 'word' -- )(
)
;
p4:"defer";
create a new word with ((DEFER))-semantics
simulate: : DEFER CREATE 0, DOES> ( the ((DEFER)) runtime ) @ ?DUP IF EXECUTE THEN ; : DEFER DEFER-RT HEADER 0 , ;
declare as <c>"DEFER deferword"</c> <br> and set as <c>"['] executionword IS deferword"</c> (in pfe, you can also use
TO deferword
to set the execution)
sharp-define:cdecl.1 — ordinary primitive
FORTH
#DEFINE
( .. )(
)
;
as:"sharp-define";
ordinary primitive #DEFINE
an executable word (no special usage info)
or wrapper call around p4_sh_define
defined:core_misc.1 — ordinary primitive
FORTH
DEFINED
( .. )(
)
;
as:"defined";
ordinary primitive DEFINED
an executable word (no special usage info)
or wrapper call around p4_defined
defined:tools_misc.1 — ordinary primitive
FORTH
DEFINED
( .. )(
)
;
as:"defined";
ordinary primitive DEFINED
an executable word (no special usage info)
or wrapper call around p4_defined
defined:core_misc — immediate primitive
FORTH
[DEFINED]
( [name] -- flag )( | ) ; |
; |
Search the dictionary for _name_. If _name_ is found, return TRUE; otherwise return FALSE. Immediate for use in definitions.
This word will actually return what FIND returns (the NFA). does check for the word using find (so it does not throw like ' ) and puts it on stack. As it is immediate it does work in compile-mode too, so it places its argument in the cs-stack then. This is most useful with a directly following [IF] clause, so that sth. like an
[IFDEF] word
can be simulated through
[DEFINED] word [IF]
: [DEFINED] DEFINED ; IMMEDIATE : [DEFINED] BL WORD COUNT (FIND-NFA) ; IMMEDIATE
defined:toolbelt — immediate primitive
FORTH
[DEFINED]
( [name] -- flag )( | ) ; |
; |
Search the dictionary for _name_. If _name_ is found, return TRUE; otherwise return FALSE. Immediate for use in definitions.
This word will actually return what FIND returns (the NFA). does check for the word using find (so it does not throw like ' ) and puts it on stack. As it is immediate it does work in compile-mode too, so it places its argument in the cs-stack then. This is most useful with a directly following [IF] clause, so that sth. like an
[IFDEF] word
can be simulated through
[DEFINED] word [IF]
: [DEFINED] DEFINED ; IMMEDIATE : [DEFINED] BL WORD COUNT (FIND-NFA) ; IMMEDIATE
defined:tools_misc — immediate primitive
FORTH
[DEFINED]
( [name] -- flag )( | ) ; |
; |
Search the dictionary for _name_. If _name_ is found, return TRUE; otherwise return FALSE. Immediate for use in definitions.
This word will actually return what FIND returns (the NFA). does check for the word using find (so it does not throw like ' ) and puts it on stack. As it is immediate it does work in compile-mode too, so it places its argument in the cs-stack then. This is most useful with a directly following [IF] clause, so that sth. like an
[IFDEF] word
can be simulated through
[DEFINED] word [IF]
: [DEFINED] DEFINED ; IMMEDIATE : [DEFINED] BL WORD COUNT (FIND-NFA) ; IMMEDIATE
definitions:search — ordinary primitive
FORTH
DEFINITIONS
( -- )(
)
;
p4:"definitions";
make the current context-vocabulary the definition-vocabulary, that is where new names are declared in. see ORDER
defs-are-case-sensitive:useful — ordinary primitive
EXTENSIONS
DEFS-ARE-CASE-SENSITIVE
( -- )( | ) ; |
; |
accesses CURRENT which is generally the last wordlist that the DEFINTIONS shall go in. sets there a flag in the vocabulary-definition so that words are matched case-sensitive.
example: VOCABULARY MY-VOC MY-VOC DEFINITIONS DEFS-ARE-CASE-SENSITIVE
defs-are-searched-also:useful — ordinary primitive
EXTENSIONS
DEFS-ARE-SEARCHED-ALSO
( -- )( | ) ; |
; |
binds CONTEXT with CURRENT. If the CURRENT VOCABULARY is in the search-order (later), then the CONTEXT vocabulary will be searched also. If the result of this word could lead into a recursive lookup with FIND it will throw
CURRENT_DELETED
and leave the CURRENT VOCABULARY unaltered.
example:
MY-VOC DEFINITIONS MY-VOC-PRIVATE DEFS-ARE-SEARCHED-ALSO
bracket-def:useful — immediate primitive
EXTENSIONS
[DEF]
( -- )(
)
;
p4:"bracket-def";
immediatly set topmost CONTEXT voc to CURRENT compilation voc.
: DEF' CURRENT @ CONTEXT ! ; IMMEDIATE
note that in PFE most basic vocabularies are immediate, so that you can use a sequence of
FORTH ALSO DEFINITIONS [DEF] : GET-FIND-3 [ANS] ['] FIND [FIG] ['] FIND [DEF] ['] FIND ;
where the first wordlist to be searched via the search order are [ANS] and [FIG] and FORTH (in this order) and which may or may not yield different flavours of the FIND routine (i.e. different XTs)
delete-file:file — ordinary primitive
FORTH
DELETE-FILE
( str-adr str-len -- code )( | ) ; |
; |
delete the named file and return a status code
str-depth:dstrings — ordinary primitive
FORTH
$DEPTH
( -- n )(
)
;
p4:"str-depth";
Leave the number of items on the string stack. <ansref>"string-depth"</ansref>
dest-magic:tools_misc.1 — ordinary constant
EXTENSIONS
DEST_MAGIC
( .. )(
)
;
as:"dest-magic";
( P4_DEST_MAGIC ) constant DEST_MAGIC
an ordinary constant (no special usage info)
df-store:floating.1 — ordinary primitive
FORTH
DF!
( .. )(
)
;
as:"df-store";
ordinary primitive DF!
an executable word (no special usage info)
or wrapper call around p4_f_store
df-store:fpnostack.1 — ordinary primitive
EXTENSIONS
DF!
( .. )(
)
;
as:"df-store";
ordinary primitive DF!
an executable word (no special usage info)
or wrapper call around p4_nofp_f_store
df-fetch:floating.1 — ordinary primitive
FORTH
DF@
( .. )(
)
;
as:"df-fetch";
ordinary primitive DF@
an executable word (no special usage info)
or wrapper call around p4_f_fetch
df-fetch:fpnostack.1 — ordinary primitive
EXTENSIONS
DF@
( .. )(
)
;
as:"df-fetch";
ordinary primitive DF@
an executable word (no special usage info)
or wrapper call around p4_nofp_f_fetch
dfalign:floating.1 — ordinary primitive
FORTH
DFALIGN
( .. )(
)
;
as:"dfalign";
ordinary primitive DFALIGN
an executable word (no special usage info)
or wrapper call around p4_d_f_align
dfalign:fpnostack.1 — ordinary primitive
EXTENSIONS
DFALIGN
( .. )(
)
;
as:"dfalign";
ordinary primitive DFALIGN
an executable word (no special usage info)
or wrapper call around p4_nofp_d_f_align
dfaligned:floating.1 — ordinary primitive
FORTH
DFALIGNED
( .. )(
)
;
as:"dfaligned";
ordinary primitive DFALIGNED
an executable word (no special usage info)
or wrapper call around p4_d_f_aligned
dfaligned:fpnostack.1 — ordinary primitive
EXTENSIONS
DFALIGNED
( .. )(
)
;
as:"dfaligned";
ordinary primitive DFALIGNED
an executable word (no special usage info)
or wrapper call around p4_nofp_d_f_aligned
dfloat-percent:struct.1 — ordinary primitive
EXTENSIONS
DFLOAT%
( .. )(
)
;
as:"dfloat-percent";
ordinary primitive DFLOAT%
an executable word (no special usage info)
or wrapper call around p4_dfloat_mod
dfloat-plus:floating.1 — ordinary primitive
FORTH
DFLOAT+
( .. )(
)
;
as:"dfloat-plus";
ordinary primitive DFLOAT+
an executable word (no special usage info)
or wrapper call around p4_d_float_plus
dfloat-plus:fpnostack.1 — ordinary primitive
EXTENSIONS
DFLOAT+
( .. )(
)
;
as:"dfloat-plus";
ordinary primitive DFLOAT+
an executable word (no special usage info)
or wrapper call around p4_nofp_d_float_plus
dfloats:floating.1 — ordinary primitive
FORTH
DFLOATS
( .. )(
)
;
as:"dfloats";
ordinary primitive DFLOATS
an executable word (no special usage info)
or wrapper call around p4_d_floats
dfloats:fpnostack.1 — ordinary primitive
EXTENSIONS
DFLOATS
( .. )(
)
;
as:"dfloats";
ordinary primitive DFLOATS
an executable word (no special usage info)
or wrapper call around p4_nofp_d_floats
dictfence:tools_misc.1 — threadstate variable
EXTENSIONS
DICTFENCE
( .. )(
)
;
as:"dictfence";
threadstate variable DICTFENCE
dict (no special usage info)
paren-dictfence:tools_misc.1 — ordinary primitive
EXTENSIONS
(DICTFENCE)
( .. )(
)
;
as:"paren-dictfence";
ordinary primitive (DICTFENCE)
an executable word (no special usage info)
or wrapper call around p4_paren_dictfence
dictlimit:tools_misc.1 — threadstate variable
EXTENSIONS
DICTLIMIT
( .. )(
)
;
as:"dictlimit";
threadstate variable DICTLIMIT
dictlimit (no special usage info)
paren-dictlimit:tools_misc.1 — ordinary primitive
EXTENSIONS
(DICTLIMIT)
( .. )(
)
;
as:"paren-dictlimit";
ordinary primitive (DICTLIMIT)
an executable word (no special usage info)
or wrapper call around p4_paren_dictlimit
dlcall:dlfcn.1 — obsolete immediate
FORTH
DLCALL
( .. )(
)
;
as:"dlcall";
obsolete immediate DLCALL
is doing the same as LOCAL-DLCALL
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
dlsym:dlfcn.1 — obsolete immediate
FORTH
DLSYM
( .. )(
)
;
as:"dlsym";
obsolete immediate DLSYM
is doing the same as LOCAL-DLSYM
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
d-max:double — ordinary primitive
FORTH
DMAX
( d1.d1 d2.d2 -- d1.d1|d2.d2 )( | ) ; |
; |
the double-cell max operation ( MAX )
d-min:double — ordinary primitive
FORTH
DMIN
( d1.d1 d2.d2 -- d1.d1|d2.d2 )( | ) ; |
; |
the double-cell max operation ( MIN )
d-negate:double — ordinary primitive
FORTH
DNEGATE
( d1.d1 -- d1.d1' )( | ) ; |
; |
the double-cell arithmetic negate operation ( NEGATE )
Q-do:core — compiling primitive
FORTH
?DO
( end start -- ).. LOOP(
)
;
p4:"Q-do";
start a control-loop just like DO - but don't execute atleast once. Instead jump over the code-piece if the loop's variables are not in a range to allow any loop.
do-alias:chainlist — ordinary primitive
EXTENSIONS
DO-ALIAS
( exec-token wordlist* "do-name" -- )( | ) ; |
; |
create an ALIAS with the exec-token in the specified wordlist
: DO-ALIAS GET-CURRENT SWAP SET-CURRENT SWAP ALIAS SET-CURRENT ;
do-all-words:chainlist — ordinary primitive
EXTENSIONS
DO-ALL-WORDS
( wordlist* -- )( | ) ; |
; |
EXECUTE each entry in the wordlist in the reverse order defined
: DO-ALL-WORDS 0 FIRST-NAME BEGIN ?DUP WHILE DUP NAME> EXECUTE NAME-NEXT REPEAT ;
to run the NEW-WORDLIST in original order, use REDO-ALL-WORDS
do-all-words-while:chainlist — compiling primitive
EXTENSIONS
DO-ALL-WORDS-WHILE
( wordlist* "word" -- )( | ) ; |
; |
EXECUTE each entry in the wordlist in the reverse order defined but only as long as after EXECUTE of "word" a TRUE flag is left on the stack. The wordlist execution is cut when a FALSE flag is seen. (the current wordlist entry is _not_ on the stack!)
: DO-ALL-WORDS-WHILE ' STATE @ IF LITERAL, COMPILE DO-ALL-WORDS-WHILE-LOOP EXIT THEN >R 0 FIRST-NAME BEGIN ?DUP WHILE R@ EXECUTE 0= IF R>DROP DROP EXIT THEN DUP NAME> EXECUTE NAME-NEXT REPEAT R>DROP ;
to run the NEW-WORDLIST in original order, use REDO-ALL-WORDS
do-all-words-while-loop:chainlist — ordinary primitive
EXTENSIONS
DO-ALL-WORDS-WHILE-LOOP
( wordlist* xt -- )( | ) ; |
; |
EXECUTE each entry in the wordlist in the reverse order defined but only as long as after EXECUTE of "word" a TRUE flag is left on the stack. The wordlist execution is cut when a FALSE flag is seen. (the current wordlist entry is _not_ on the stack!)
: DO-ALL-WORDS-WHILE-LOOP >R 0 FIRST-NAME BEGIN ?DUP WHILE R@ EXECUTE 0= IF R>DROP DROP EXIT THEN DUP NAME> EXECUTE NAME-NEXT REPEAT R>DROP ;
compare with DO-ALL-WORDS-WHILE
do-chain:chain — ordinary primitive
EXTENSIONS
do-chain
( chain* -- )(
)
;
p4:"do-chain";
execute chain
: do-chain being @ ?dup while dup>r cell+ @execute r> repeat ;
do-synonym:chainlist — ordinary primitive
EXTENSIONS
DO-SYNONYM
( wordlist* "do-name" "orig-name" -- )( | ) ; |
; |
create a SYNONYM in the specified wordlist.
: DO-SYNONYM GET-CURRENT SWAP SET-CURRENT SYNONYM SET-CURRENT ;
DO-ALIAS / DO-ALL-WORDS / NEW-WORDLIST / WORDLIST / ORDER
doer:useful.1 — ordinary primitive
EXTENSIONS
DOER
( .. )(
)
;
as:"doer";
ordinary primitive DOER
an executable word (no special usage info)
or wrapper call around p4_defer
double-percent:struct.1 — ordinary primitive
EXTENSIONS
DOUBLE%
( .. )(
)
;
as:"double-percent";
ordinary primitive DOUBLE%
an executable word (no special usage info)
or wrapper call around p4_double_mod
double-minus-ext:double::environment — ordinary constant
ENVIRONMENT
DOUBLE-EXT
( .. )(
)
;
as:"double-minus-ext";
( 1994 ) constant DOUBLE-EXT
an ordinary constant (no special usage info)
double-colon:structs.1 — ordinary primitive
EXTENSIONS
DOUBLE:
( .. )(
)
;
as:"double-colon";
ordinary primitive DOUBLE:
an executable word (no special usage info)
or wrapper call around p4_two_cell_colon
dp:misc.1 — threadstate variable
FORTH
DP
( .. )(
)
;
as:"dp";
threadstate variable DP
dp (no special usage info)
dpl:forth_83.1 — threadstate variable
FORTH
DPL
( .. )(
)
;
as:"dpl";
threadstate variable DPL
dpl (no special usage info)
drop:core — ordinary primitive
FORTH
DROP
( a -- )(
)
;
p4:"drop";
just drop the word on the top of stack, see DUP
two-drop:core — ordinary primitive
FORTH
2DROP
( a b -- )(
)
;
p4:"two-drop";
double-cell drop, also used to drop two items
str-drop:dstrings — ordinary primitive
FORTH
$DROP
( $: a$ -- )(
)
;
p4:"str-drop";
Drop the topmost string stack entry, marking it as garbage if it is initially bound to the top of the string stack. <ansref>"string-drop"</ansref>
str-two-drop:dstrings — ordinary primitive
FORTH
$2DROP
( $: a$ b$ -- )( | ) ; |
; |
Drop the two topmost string stack entries, marking them as garbage if appropriate. <ansref>"string-two-drop"</ansref>
three-drop:forth_usual — ordinary primitive
FORTH
3DROP
( x y z -- )(
)
;
p4:"three-drop";
Drop the top three elements from the stack.
: 3DROP DROP 2DROP ;
four-drop:forth_usual — ordinary primitive
FORTH
4DROP
( x y z -- )(
)
;
p4:"four-drop";
Drop the top three elements from the stack.
: 4DROP 2DROP 2DROP ;
three-drop:toolbelt — ordinary primitive
FORTH
3DROP
( x y z -- )(
)
;
p4:"three-drop";
Drop the top three elements from the stack.
: 3DROP DROP 2DROP ;
drop-str-frame:dstrings — ordinary primitive
FORTH
DROP-$FRAME
( -- )(
)
;
p4:"drop-str-frame";
Drop the topmost string frame from the string frame stack and string stack. Errors are thrown if either stack would underflow or if the string frame does not begin at the top of the string stack. The case where the frame has zero entries on the string stack is handled properly. <ansref>"drop-string-frame"</ansref>
paren-drop-minus-str-frame:dstrings.1 — compiling primitive
FORTH
(DROP-$FRAME)
( .. )( | ) ; |
; |
compiling primitive (DROP-$FRAME)
an executable word (no special usage info)
or wrapper call around p4_do_drop_str_frame
dstrings:dstrings.1 — threadstate variable
FORTH
DSTRINGS
( .. )(
)
;
as:"dstrings";
threadstate variable DSTRINGS
dstrings (no special usage info)
dstrings-minus-ext:dstrings::environment — ordinary constant
ENVIRONMENT
DSTRINGS-EXT
( .. )( | ) ; |
; |
( 20627 ) constant DSTRINGS-EXT
an ordinary constant (no special usage info)
dstrings-minus-loaded:dstrings::environment — constructor primitive
ENVIRONMENT
DSTRINGS-LOADED
( .. )( | ) ; |
; |
constructor primitive DSTRINGS-LOADED
an executable word (no special usage info)
or wrapper call around dstrings_init
d-u-less:double_misc — ordinary primitive
FORTH
DU<
( d1,d1 d2,d2 -- flag )( | ) ; |
; |
the double-cell unsigned-is-less operation ( U< )
dump:tools — ordinary primitive
FORTH
DUMP
( addr len -- )(
)
;
p4:"dump";
show a hex-dump of the given area, if it's more than a screenful it will ask using ?CR
You can easily cause a segmentation fault of something like that by accessing memory that does not belong to the pfe-process.
two-dup:core — ordinary primitive
FORTH
2DUP
( a,a -- a,a a,a )(
)
;
p4:"two-dup";
double-cell duplication, also used to duplicate two items
simulate: : 2DUP OVER OVER ; ( wrong would be : 2DUP DUP DUP ; !!)
Q-dup:core — ordinary primitive
FORTH
?DUP
( value -- value|[nothing] )( | ) ; |
; |
one of the rare words whose stack-change is condition-dependet. This word will duplicate the value only if it is not zero. The usual place to use it is directly before a control-word that can go to different places where we can spare an extra DROP on the is-null-part. This makes the code faster and often a little easier to read.
example: : XX BEGIN ?DUP WHILE DUP . 2/ REPEAT ; instead of : XX BEGIN DUP WHILE DUP . 2/ REPEAT DROP ;
str-dup:dstrings — ordinary primitive
FORTH
$DUP
( $: a$ -- a$ a$ )(
)
;
p4:"str-dup";
Leave a copy of the topmost string stack entry. The string value is not copied. <ansref>"string-dupe"</ansref>
str-two-dup:dstrings — ordinary primitive
FORTH
$2DUP
( $: a$ b$ -- a$ b$ a$ b$ )( | ) ; |
; |
Leave copies of the two topmost string stack entries. The string values are not copied. <ansref>"string-two-dupe"</ansref>
three-dup:forth_usual — ordinary primitive
FORTH
3DUP
( x y z -- x y z x y z )( | ) ; |
; |
Copy top three elements on the stack onto top of stack.
: 3DUP THIRD THIRD THIRD ;
or
: 3DUP 3 PICK 3 PICK 3 PICK ;
four-dup:forth_usual — ordinary primitive
FORTH
4DUP
( a b c d -- a b c d a b c d )( | ) ; |
; |
simulate: : 4DUP 4 PICK 4 PICK 4 PICK 4 PICK ;
three-dup:toolbelt — ordinary primitive
FORTH
3DUP
( x y z -- x y z x y z )( | ) ; |
; |
Copy top three elements on the stack onto top of stack.
: 3DUP THIRD THIRD THIRD ;
or
: 3DUP 3 PICK 3 PICK 3 PICK ;
slash-dynamic-minus-string:dstrings::environment — ordinary constant
ENVIRONMENT
/DYNAMIC-STRING
( .. )( | ) ; |
; |
( MAX_MCOUNT ) constant /DYNAMIC-STRING
an ordinary constant (no special usage info)
edit-block:edit — ordinary primitive
EXTENSIONS
EDIT-BLOCK
( blk -- )(
)
;
p4:"edit-block";
start the internal block-editor on the assigned block
edit-minus-block-minus-start:edit.1 — ordinary primitive
FORTH
EDIT-BLOCK-START
( .. )( | ) ; |
; |
ordinary primitive EDIT-BLOCK-START
an executable word (no special usage info)
or wrapper call around p4_edit_block
edit-blockfile:misc — ordinary primitive
FORTH
EDIT-BLOCKFILE
( name -- )( | ) ; |
; |
will load the edit module in the background and look for a word called EDIT-BLOCK that could be used to edit the blockfile. If no EDIT-BLOCKFILE word can be loaded, nothing will happen. Otherwise, OPEN-BLOCKFILE is called followed by 0 EDIT-BLOCK to start editing the file at the first block.
edit-error:edit — ordinary primitive
EXTENSIONS
EDIT-ERROR
( -- )(
)
;
p4:"edit-error";
if an error occured, this routine can be called to invoke an appropriate EDITOR (see also EDIT-BLOCK)
to-from-edit-minus-init-back-back:edit.1 — constructor primitive
EXTENSIONS
<<edit-init>>
( .. )( | ) ; |
; |
constructor primitive <<edit-init>>
an executable word (no special usage info)
or wrapper call around p4_edit_init
edit-minus-text:edit.1 — ordinary primitive
EXTENSIONS
EDIT-TEXT
( .. )(
)
;
as:"edit-minus-text";
ordinary primitive EDIT-TEXT
an executable word (no special usage info)
or wrapper call around p4_edit_text
ekey:facility — ordinary primitive
FORTH
EKEY
( -- keycode )(
)
;
p4:"ekey";
return a keyboard event, the encoding may differ, esp. that it can contain special keys.
ekey-to-char:facility — ordinary primitive
FORTH
EKEY>CHAR
( keycode -- keycode false | char true )( | ) ; |
; |
ekey-question:facility — ordinary primitive
FORTH
EKEY?
( -- flag )(
)
;
p4:"ekey-question";
check if a character is available from the keyboard to be received - unlike KEY? it will not discard non-visible codes.
bracket-else:tools — immediate primitive
FORTH
[ELSE]
( -- )(
)
;
p4:"bracket-else";
eat up everything upto and including the next [THEN]. count nested [IF] ... [THEN] constructs. see [IF]
this word provides a simple pre-compiler mechanism
emit:core — ordinary primitive
FORTH
EMIT
( char -- )(
)
;
p4:"emit";
print the char-value on stack to stdout
paren-emit:misc.1 — ordinary primitive
FORTH
(EMIT)
( .. )(
)
;
as:"paren-emit";
ordinary primitive (EMIT)
an executable word (no special usage info)
or wrapper call around p4_paren_emit
star-emit-star:misc.1 — threadstate variable
FORTH
*EMIT*
( .. )(
)
;
as:"star-emit-star";
threadstate variable *EMIT*
emit (no special usage info)
emit-question:facility — ordinary primitive
FORTH
EMIT?
( -- flag )(
)
;
p4:"emit-question";
if EMIT can safely output characters without blocking the forth by waiting for an indefinite time.
emits:forth_usual — ordinary primitive
FORTH
EMITS
( n char -- )(
)
;
p4:"emits";
Emit _char_ _n_ times.
: EMITS ( n char -- ) SWAP 0 ?DO DUP EMIT LOOP DROP ;
also compare
: SPACES BL EMITS ; : SPACE BL EMIT ;
emits:toolbelt — ordinary primitive
FORTH
EMITS
( n char -- )(
)
;
p4:"emits";
Emit _char_ _n_ times.
: EMITS ( n char -- ) SWAP 0 ?DO DUP EMIT LOOP DROP ;
also compare
: SPACES BL EMITS ; : SPACE BL EMIT ;
empty:toolbelt — ordinary primitive
FORTH
EMPTY
( -- )(
)
;
p4:"empty";
Reset the dictionary to a predefined golden state, discarding all definitions and releasing all allocated data space beyond that state.
empty-str:dstrings — ordinary primitive
FORTH
EMPTY$
( $: -- empty$ )(
)
;
p4:"empty-str";
Push the MSA of a fixed, external representation of the empty string onto the string stack. <ansref>"empty-string"</ansref>
empty-buffers:block — ordinary primitive
FORTH
EMPTY-BUFFERS
( -- )(
)
;
p4:"empty-buffers";
unassign all block buffers, does not even UPDATE
end-module:module — ordinary primitive
EXTENSIONS
END-MODULE
( old-current -- )( | ) ; |
; |
clean up the cs-stack from the last MODULE definition. Effectivly, MODULE definitions can be nested.
: END-MODULE ( old-current ) PREVIOUS PREVIOUS CURRENT !
end-struct:struct — ordinary primitive
EXTENSIONS
END-STRUCT
( here some-offset -- )( | ) ; |
; |
terminate definition of a new structure (mpe.000)
: END-STRUCT SWAP ! ?CSP ;
end-subrecord:struct — ordinary primitive
EXTENSIONS
END-SUBRECORD
( outer-offset here some-offset -- outer-offset+some )( | ) ; |
; |
end definition of a subrecord (mpe.000)
: END-SUBRECORD TUCK SWAP ! + ;
end-variant:struct — ordinary primitive
EXTENSIONS
END-VARIANT
( outer-offset here some-offset -- outer-offset )( | ) ; |
; |
terminate definition of a new variant (mpe.000)
: END-STRUCT TUCK SWAP ! 2DUP < IF NIP ELSE DROP THEN ;
endcat:dstrings — ordinary primitive
FORTH
ENDCAT
( -- $: cat$ | empty$ )( | ) ; |
; |
If there is no concatenating string, do nothing but leave the empty string. If there is, leave it as a string bound to the top of the string stack, and terminate concatenation, permitting normal copies into the string buffer. <ansref>"end-cat"</ansref>
endif:forth_usual.1 — immediate synonym
FORTH
ENDIF
( .. )(
)
;
as:"endif";
immediate synonym ENDIF
is doing the same as THEN
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
ends-Q:toolbelt — ordinary primitive
FORTH
ENDS?
( str len pattern len2 -- str len flag )( | ) ; |
; |
Check end of string.
: ENDS? DUP >R 2OVER DUP R> - /STRING COMPARE 0= ;
endstructure:struct — ordinary primitive
EXTENSIONS
ENDSTRUCTURE
( here some-offset -- )( | ) ; |
; |
environ-minus-ext:environ::environment — ordinary constant
ENVIRONMENT
ENVIRON-EXT
( .. )( | ) ; |
; |
( 2000 ) constant ENVIRON-EXT
an ordinary constant (no special usage info)
environment-minus-wordlist:environ.1 — - loader type P4_DVaL
FORTH
ENVIRONMENT-WORDLIST
( .. )( | ) ; |
; |
- loader type P4_DVaL ENVIRONMENT-WORDLIST
environ_wl (no special usage info)
environment-Q-core:core — ordinary primitive
FORTH
ENVIRONMENT?
( a1 n1 -- false | ?? true )( | ) ; |
; |
check the environment for a property, usually a condition like questioning the existance of specified wordset, but it can also return some implementation properties like "WORDLISTS" (the length of the search-order) or "#LOCALS" (the maximum number of locals)
Here it implements the environment queries as a SEARCH-WORDLIST in a user-visible vocabulary called ENVIRONMENT
: ENVIRONMENT? ['] ENVIRONMENT >WORDLIST SEARCH-WORDLIST IF EXECUTE TRUE ELSE FALSE THEN ;
environment-Q-core:environ — ordinary primitive
FORTH
ENVIRONMENT?
( a1 n1 -- false | ?? true )( | ) ; |
; |
check the environment for a property, usually a condition like questioning the existance of specified wordset, but it can also return some implementation properties like "WORDLISTS" (the length of the search-order) or "#LOCALS" (the maximum number of locals)
Here it implements the environment queries as a SEARCH-WORDLIST in a user-visible vocabulary called ENVIRONMENT
: ENVIRONMENT? ['] ENVIRONMENT >WORDLIST SEARCH-WORDLIST IF EXECUTE TRUE ELSE FALSE THEN ;
sharp-eol-minus-char:toolbelt.1 — ordinary constant
FORTH
#EOL-CHAR
( .. )( | ) ; |
; |
( EOL_CHAR ) constant #EOL-CHAR
an ordinary constant (no special usage info)
erase:core — ordinary primitive
FORTH
ERASE
( ptr len -- )(
)
;
p4:"erase";
fill an area will zeros.
2000 CREATE DUP ALLOT ERASE
geteuid:shell — ordinary primitive
EXTENSIONS
$EUID
( -- val )(
)
;
p4:"geteuid";
calls system's
geteuid
exception-minus-ext:exception::environment — ordinary constant
ENVIRONMENT
EXCEPTION-EXT
( .. )( | ) ; |
; |
( 1994 ) constant EXCEPTION-EXT
an ordinary constant (no special usage info)
exception-magic:tools_misc.1 — ordinary constant
EXTENSIONS
EXCEPTION_MAGIC
( .. )( | ) ; |
; |
( P4_EXCEPTION_MAGIC ) constant EXCEPTION_MAGIC
an ordinary constant (no special usage info)
execute:core — ordinary primitive
FORTH
EXECUTE
( xt -- )(
)
;
p4:"execute";
run the execution-token on stack - this will usually trap if it was null for some reason, see >EXECUTE
simulate: : EXECUTE >R EXIT ;
fetch-execute:forth_usual — ordinary primitive
FORTH
@EXECUTE
( xt -- ? )(
)
;
p4:"fetch-execute";
executes:misc — ordinary primitive
FORTH
EXECUTES
( n [word] -- )(
)
;
p4:"executes";
stores the execution token of following word into the callback pointer for the specified function-key
exitcode:misc.1 — threadstate variable
FORTH
EXITCODE
( .. )(
)
;
as:"exitcode";
threadstate variable EXITCODE
exitcode (no special usage info)
expand-fn:misc — ordinary primitive
FORTH
EXPAND-FN
( addr1 u1 addr2 -- addr2 cnt2 )( | ) ; |
; |
paren-expect:misc.1 — ordinary primitive
FORTH
(EXPECT)
( .. )(
)
;
as:"paren-expect";
ordinary primitive (EXPECT)
an executable word (no special usage info)
or wrapper call around p4_paren_expect
star-expect-star:misc.1 — threadstate variable
FORTH
*EXPECT*
( .. )(
)
;
as:"star-expect-star";
threadstate variable *EXPECT*
expect (no special usage info)
export:module — ordinary primitive
EXTENSIONS
EXPORT
( old-current "name" -- old-current )( | ) ; |
; |
the named word in the hidden dictionary (i.e. the wordlist referenced in CURRENT) is exported into the public wordlist of it (i.e. which is in this implementation CONTEXT[1]). The actual implemenation will create a DEFER-word in the public wordlist withits parameter area pointing to the cfa of the hidden implementation.
: EXPORT CURRENT @ CONTEXT CELL+ @ CURRENT ! DEFER CURRENT ! LATEST COUNT CURRENT @ SEARCH-WORDLIST IF LATEST NAME> >BODY ! ELSE ABORT" can't find word to export" THEN ;
expose-module:module — ordinary primitive
EXTENSIONS
EXPOSE-MODULE
( "name" -- )( | ) ; |
; |
affects the search order, ALSO module-wid CONTEXT ! hidden'
: EXPOSE-MODULE ALSO S" HIDDEN'" ' DUP VOC? ABORT?" is no vocabulary" >VOC SEARCH-WORDLIST 0= IF " no hidden vocabulary found" THEN DUP VOC? ABORT?" hidden is no vocabulary" EXECUTE ;
f-store:floating.1 — ordinary primitive
FORTH
F!
( .. )(
)
;
as:"f-store";
ordinary primitive F!
an executable word (no special usage info)
or wrapper call around p4_f_store
f-store:fpnostack.1 — ordinary primitive
EXTENSIONS
F!
( .. )(
)
;
as:"f-store";
ordinary primitive F!
an executable word (no special usage info)
or wrapper call around p4_nofp_f_store
f-star:floating.1 — ordinary primitive
FORTH
F*
( .. )(
)
;
as:"f-star";
ordinary primitive F*
an executable word (no special usage info)
or wrapper call around p4_f_star
f-star:fpnostack.1 — ordinary primitive
EXTENSIONS
F*
( .. )(
)
;
as:"f-star";
ordinary primitive F*
an executable word (no special usage info)
or wrapper call around p4_nofp_f_star
f-star-star:floating.1 — ordinary primitive
FORTH
F**
( .. )(
)
;
as:"f-star-star";
ordinary primitive F**
an executable word (no special usage info)
or wrapper call around p4_f_star_star
f-star-star:fpnostack.1 — ordinary primitive
EXTENSIONS
F**
( .. )(
)
;
as:"f-star-star";
ordinary primitive F**
an executable word (no special usage info)
or wrapper call around p4_nofp_f_star_star
f-plus:floating.1 — ordinary primitive
FORTH
F+
( .. )(
)
;
as:"f-plus";
ordinary primitive F+
an executable word (no special usage info)
or wrapper call around p4_f_plus
f-plus:fpnostack.1 — ordinary primitive
EXTENSIONS
F+
( .. )(
)
;
as:"f-plus";
ordinary primitive F+
an executable word (no special usage info)
or wrapper call around p4_nofp_f_plus
f-minus:floating.1 — ordinary primitive
FORTH
F-
( .. )(
)
;
as:"f-minus";
ordinary primitive F-
an executable word (no special usage info)
or wrapper call around p4_f_minus
f-minus:fpnostack.1 — ordinary primitive
EXTENSIONS
F-
( .. )(
)
;
as:"f-minus";
ordinary primitive F-
an executable word (no special usage info)
or wrapper call around p4_nofp_f_minus
f-dot:floating.1 — ordinary primitive
FORTH
F.
( .. )(
)
;
as:"f-dot";
ordinary primitive F.
an executable word (no special usage info)
or wrapper call around p4_f_dot
f-dot:fpnostack.1 — ordinary primitive
EXTENSIONS
F.
( .. )(
)
;
as:"f-dot";
ordinary primitive F.
an executable word (no special usage info)
or wrapper call around p4_nofp_f_dot
f-slash:floating.1 — ordinary primitive
FORTH
F/
( .. )(
)
;
as:"f-slash";
ordinary primitive F/
an executable word (no special usage info)
or wrapper call around p4_f_slash
f-slash:fpnostack.1 — ordinary primitive
EXTENSIONS
F/
( .. )(
)
;
as:"f-slash";
ordinary primitive F/
an executable word (no special usage info)
or wrapper call around p4_nofp_f_slash
f-zero:floating_misc.1 — threadstate variable
FORTH
F0
( .. )(
)
;
as:"f-zero";
threadstate variable F0
f0 (no special usage info)
f-zero-from:floating.1 — ordinary primitive
FORTH
F0<
( .. )(
)
;
as:"f-zero-from";
ordinary primitive F0<
an executable word (no special usage info)
or wrapper call around p4_f_zero_less
f-zero-from:fpnostack.1 — ordinary primitive
EXTENSIONS
F0<
( .. )(
)
;
as:"f-zero-from";
ordinary primitive F0<
an executable word (no special usage info)
or wrapper call around p4_nofp_f_zero_less
f-zero-equal:floating.1 — ordinary primitive
FORTH
F0=
( .. )(
)
;
as:"f-zero-equal";
ordinary primitive F0=
an executable word (no special usage info)
or wrapper call around p4_f_zero_equal
f-zero-equal:fpnostack.1 — ordinary primitive
EXTENSIONS
F0=
( .. )(
)
;
as:"f-zero-equal";
ordinary primitive F0=
an executable word (no special usage info)
or wrapper call around p4_nofp_f_zero_equal
f-from:floating.1 — ordinary primitive
FORTH
F<
( .. )(
)
;
as:"f-from";
ordinary primitive F<
an executable word (no special usage info)
or wrapper call around p4_f_less_than
f-from:fpnostack.1 — ordinary primitive
EXTENSIONS
F<
( .. )(
)
;
as:"f-from";
ordinary primitive F<
an executable word (no special usage info)
or wrapper call around p4_nofp_f_less_than
f-from-equal:floating_misc.1 — ordinary primitive
FORTH
F<=
( .. )(
)
;
as:"f-from-equal";
ordinary primitive F<=
an executable word (no special usage info)
or wrapper call around p4_f_less_than_or_equal
f-from-equal:fpnostack.1 — ordinary primitive
EXTENSIONS
F<=
( .. )(
)
;
as:"f-from-equal";
ordinary primitive F<=
an executable word (no special usage info)
or wrapper call around p4_nofp_f_less_than_or_equal
f-from-back:floating_misc.1 — ordinary primitive
FORTH
F<>
( .. )(
)
;
as:"f-from-back";
ordinary primitive F<>
an executable word (no special usage info)
or wrapper call around p4_f_not_equal
f-from-back:fpnostack.1 — ordinary primitive
EXTENSIONS
F<>
( .. )(
)
;
as:"f-from-back";
ordinary primitive F<>
an executable word (no special usage info)
or wrapper call around p4_nofp_f_not_equal
f-equal:floating_misc.1 — ordinary primitive
FORTH
F=
( .. )(
)
;
as:"f-equal";
ordinary primitive F=
an executable word (no special usage info)
or wrapper call around p4_f_equal
f-equal:fpnostack.1 — ordinary primitive
EXTENSIONS
F=
( .. )(
)
;
as:"f-equal";
ordinary primitive F=
an executable word (no special usage info)
or wrapper call around p4_nofp_f_equal
f-back:floating_misc.1 — ordinary primitive
FORTH
F>
( .. )(
)
;
as:"f-back";
ordinary primitive F>
an executable word (no special usage info)
or wrapper call around p4_f_greater_than
f-back:fpnostack.1 — ordinary primitive
EXTENSIONS
F>
( .. )(
)
;
as:"f-back";
ordinary primitive F>
an executable word (no special usage info)
or wrapper call around p4_nofp_f_greater_than
f-back-equal:floating_misc.1 — ordinary primitive
FORTH
F>=
( .. )(
)
;
as:"f-back-equal";
ordinary primitive F>=
an executable word (no special usage info)
or wrapper call around p4_f_greater_than_or_equal
f-back-equal:fpnostack.1 — ordinary primitive
EXTENSIONS
F>=
( .. )(
)
;
as:"f-back-equal";
ordinary primitive F>=
an executable word (no special usage info)
or wrapper call around p4_nofp_f_greater_than_or_equal
f-back-d:floating.1 — ordinary primitive
FORTH
F>D
( .. )(
)
;
as:"f-back-d";
ordinary primitive F>D
an executable word (no special usage info)
or wrapper call around p4_f_to_d
f-back-d:fpnostack.1 — ordinary primitive
EXTENSIONS
F>D
( .. )(
)
;
as:"f-back-d";
ordinary primitive F>D
an executable word (no special usage info)
or wrapper call around p4_nofp_f_to_d
f-fetch:floating.1 — ordinary primitive
FORTH
F@
( .. )(
)
;
as:"f-fetch";
ordinary primitive F@
an executable word (no special usage info)
or wrapper call around p4_f_fetch
f-fetch:fpnostack.1 — ordinary primitive
EXTENSIONS
F@
( .. )(
)
;
as:"f-fetch";
ordinary primitive F@
an executable word (no special usage info)
or wrapper call around p4_nofp_f_fetch
fabs:floating.1 — ordinary primitive
FORTH
FABS
( .. )(
)
;
as:"fabs";
ordinary primitive FABS
an executable word (no special usage info)
or wrapper call around p4_f_abs
fabs:fpnostack.1 — ordinary primitive
EXTENSIONS
FABS
( .. )(
)
;
as:"fabs";
ordinary primitive FABS
an executable word (no special usage info)
or wrapper call around p4_nofp_f_abs
facility-minus-ext:facility::environment — ordinary constant
ENVIRONMENT
FACILITY-EXT
( .. )( | ) ; |
; |
( 1994 ) constant FACILITY-EXT
an ordinary constant (no special usage info)
facos:floating.1 — ordinary primitive
FORTH
FACOS
( .. )(
)
;
as:"facos";
ordinary primitive FACOS
an executable word (no special usage info)
or wrapper call around p4_f_acos
facos:fpnostack.1 — ordinary primitive
EXTENSIONS
FACOS
( .. )(
)
;
as:"facos";
ordinary primitive FACOS
an executable word (no special usage info)
or wrapper call around p4_nofp_f_acos
facosh:floating.1 — ordinary primitive
FORTH
FACOSH
( .. )(
)
;
as:"facosh";
ordinary primitive FACOSH
an executable word (no special usage info)
or wrapper call around p4_f_acosh
facosh:fpnostack.1 — ordinary primitive
EXTENSIONS
FACOSH
( .. )(
)
;
as:"facosh";
ordinary primitive FACOSH
an executable word (no special usage info)
or wrapper call around p4_nofp_f_acosh
falign:floating.1 — ordinary primitive
FORTH
FALIGN
( .. )(
)
;
as:"falign";
ordinary primitive FALIGN
an executable word (no special usage info)
or wrapper call around p4_d_f_align
falign:fpnostack.1 — ordinary primitive
EXTENSIONS
FALIGN
( .. )(
)
;
as:"falign";
ordinary primitive FALIGN
an executable word (no special usage info)
or wrapper call around p4_nofp_d_f_align
faligned:floating.1 — ordinary primitive
FORTH
FALIGNED
( .. )(
)
;
as:"faligned";
ordinary primitive FALIGNED
an executable word (no special usage info)
or wrapper call around p4_d_f_aligned
faligned:fpnostack.1 — ordinary primitive
EXTENSIONS
FALIGNED
( .. )(
)
;
as:"faligned";
ordinary primitive FALIGNED
an executable word (no special usage info)
or wrapper call around p4_nofp_d_f_aligned
falog:floating.1 — ordinary primitive
FORTH
FALOG
( .. )(
)
;
as:"falog";
ordinary primitive FALOG
an executable word (no special usage info)
or wrapper call around p4_f_alog
falog:fpnostack.1 — ordinary primitive
EXTENSIONS
FALOG
( .. )(
)
;
as:"falog";
ordinary primitive FALOG
an executable word (no special usage info)
or wrapper call around p4_nofp_f_alog
false:core.1 — ordinary constant
FORTH
FALSE
( .. )(
)
;
as:"false";
( P4_FALSE ) constant FALSE
an ordinary constant (no special usage info)
fasin:floating.1 — ordinary primitive
FORTH
FASIN
( .. )(
)
;
as:"fasin";
ordinary primitive FASIN
an executable word (no special usage info)
or wrapper call around p4_f_asin
fasin:fpnostack.1 — ordinary primitive
EXTENSIONS
FASIN
( .. )(
)
;
as:"fasin";
ordinary primitive FASIN
an executable word (no special usage info)
or wrapper call around p4_nofp_f_asin
fasinh:floating.1 — ordinary primitive
FORTH
FASINH
( .. )(
)
;
as:"fasinh";
ordinary primitive FASINH
an executable word (no special usage info)
or wrapper call around p4_f_asinh
fasinh:fpnostack.1 — ordinary primitive
EXTENSIONS
FASINH
( .. )(
)
;
as:"fasinh";
ordinary primitive FASINH
an executable word (no special usage info)
or wrapper call around p4_nofp_f_asinh
fatan:floating.1 — ordinary primitive
FORTH
FATAN
( .. )(
)
;
as:"fatan";
ordinary primitive FATAN
an executable word (no special usage info)
or wrapper call around p4_f_atan
fatan:fpnostack.1 — ordinary primitive
EXTENSIONS
FATAN
( .. )(
)
;
as:"fatan";
ordinary primitive FATAN
an executable word (no special usage info)
or wrapper call around p4_nofp_f_atan
fatan-two:floating.1 — ordinary primitive
FORTH
FATAN2
( .. )(
)
;
as:"fatan-two";
ordinary primitive FATAN2
an executable word (no special usage info)
or wrapper call around p4_f_atan2
fatan-two:fpnostack.1 — ordinary primitive
EXTENSIONS
FATAN2
( .. )(
)
;
as:"fatan-two";
ordinary primitive FATAN2
an executable word (no special usage info)
or wrapper call around p4_nofp_f_atan2
fatanh:floating.1 — ordinary primitive
FORTH
FATANH
( .. )(
)
;
as:"fatanh";
ordinary primitive FATANH
an executable word (no special usage info)
or wrapper call around p4_f_atanh
fatanh:fpnostack.1 — ordinary primitive
EXTENSIONS
FATANH
( .. )(
)
;
as:"fatanh";
ordinary primitive FATANH
an executable word (no special usage info)
or wrapper call around p4_nofp_f_atanh
str-fbreak:dstrings.1 — ordinary primitive
FORTH
$FBREAK
( .. )(
)
;
as:"str-fbreak";
ordinary primitive $FBREAK
an executable word (no special usage info)
or wrapper call around sf_break
fconstant:floating.1 — definining primitive
FORTH
FCONSTANT
( .. )(
)
;
as:"fconstant";
definining primitive FCONSTANT
an executable word (no special usage info)
or wrapper call around p4_f_constant
fconstant:fpnostack.1 — definining primitive
EXTENSIONS
FCONSTANT
( .. )(
)
;
as:"fconstant";
definining primitive FCONSTANT
an executable word (no special usage info)
or wrapper call around p4_nofp_f_constant
fcos:floating.1 — ordinary primitive
FORTH
FCOS
( .. )(
)
;
as:"fcos";
ordinary primitive FCOS
an executable word (no special usage info)
or wrapper call around p4_f_cos
fcos:fpnostack.1 — ordinary primitive
EXTENSIONS
FCOS
( .. )(
)
;
as:"fcos";
ordinary primitive FCOS
an executable word (no special usage info)
or wrapper call around p4_nofp_f_cos
fcosh:floating.1 — ordinary primitive
FORTH
FCOSH
( .. )(
)
;
as:"fcosh";
ordinary primitive FCOSH
an executable word (no special usage info)
or wrapper call around p4_f_cosh
fcosh:fpnostack.1 — ordinary primitive
EXTENSIONS
FCOSH
( .. )(
)
;
as:"fcosh";
ordinary primitive FCOSH
an executable word (no special usage info)
or wrapper call around p4_nofp_f_cosh
fdepth:floating.1 — ordinary primitive
FORTH
FDEPTH
( .. )(
)
;
as:"fdepth";
ordinary primitive FDEPTH
an executable word (no special usage info)
or wrapper call around p4_f_depth
fdepth:fpnostack.1 — ordinary primitive
EXTENSIONS
FDEPTH
( .. )(
)
;
as:"fdepth";
ordinary primitive FDEPTH
an executable word (no special usage info)
or wrapper call around p4_nofp_f_depth
fdrop:floating.1 — ordinary primitive
FORTH
FDROP
( .. )(
)
;
as:"fdrop";
ordinary primitive FDROP
an executable word (no special usage info)
or wrapper call around p4_f_drop
fdrop:fpnostack.1 — ordinary primitive
EXTENSIONS
FDROP
( .. )(
)
;
as:"fdrop";
ordinary primitive FDROP
an executable word (no special usage info)
or wrapper call around p4_nofp_f_drop
fdup:floating.1 — ordinary primitive
FORTH
FDUP
( .. )(
)
;
as:"fdup";
ordinary primitive FDUP
an executable word (no special usage info)
or wrapper call around p4_f_dup
fdup:fpnostack.1 — ordinary primitive
EXTENSIONS
FDUP
( .. )(
)
;
as:"fdup";
ordinary primitive FDUP
an executable word (no special usage info)
or wrapper call around p4_nofp_f_dup
fe-dot:floating.1 — ordinary primitive
FORTH
FE.
( .. )(
)
;
as:"fe-dot";
ordinary primitive FE.
an executable word (no special usage info)
or wrapper call around p4_f_e_dot
fe-dot:fpnostack.1 — ordinary primitive
EXTENSIONS
FE.
( .. )(
)
;
as:"fe-dot";
ordinary primitive FE.
an executable word (no special usage info)
or wrapper call around p4_nofp_f_e_dot
fence:tools_misc.1 — threadstate variable
EXTENSIONS
FENCE
( .. )(
)
;
as:"fence";
threadstate variable FENCE
fence (no special usage info)
fexp:floating.1 — ordinary primitive
FORTH
FEXP
( .. )(
)
;
as:"fexp";
ordinary primitive FEXP
an executable word (no special usage info)
or wrapper call around p4_f_exp
fexp:fpnostack.1 — ordinary primitive
EXTENSIONS
FEXP
( .. )(
)
;
as:"fexp";
ordinary primitive FEXP
an executable word (no special usage info)
or wrapper call around p4_nofp_f_exp
fexpm-one:floating.1 — ordinary primitive
FORTH
FEXPM1
( .. )(
)
;
as:"fexpm-one";
ordinary primitive FEXPM1
an executable word (no special usage info)
or wrapper call around p4_f_expm1
fexpm-one:fpnostack.1 — ordinary primitive
EXTENSIONS
FEXPM1
( .. )(
)
;
as:"fexpm-one";
ordinary primitive FEXPM1
an executable word (no special usage info)
or wrapper call around p4_nofp_f_expm1
to-ffa:header — ordinary primitive
EXTENSIONS
>FFA
( nfa -- ffa )obsolete(
)
;
p4:"to-ffa";
converts a pointer to the name-field (NFA) to point then to the corresponding flag-field (FFA) - in traditinal Forth this is the same address. pfe _can_ do different.
implementation-specific configure-dependent simulation: : FFA 1- ;
ffa-from:header — ordinary primitive
EXTENSIONS
FFA>
( ffa -- nfa )obsolete( | ) ; |
; |
converts a pointer to the flag-field (FFA) to point then to the corresponding name-field (NFA) - in traditinal Forth this is the same address. pfe _can_ do different.
implementation-specific configure-dependent simulation: : FFA 1+ ;
field:struct — definining primitive
EXTENSIONS
FIELD
( offset size "name" -- offset+size )( | ) ; |
; |
plus-field:useful — ordinary primitive
EXTENSIONS
+FIELD
( offset "name" -- offset )( | ) ; |
; |
created a new name with an OFFSET-RT runtime using the given offset. Leave the offset-value untouched, so it can be modified with words like CHAR+ and CELL+ and SFLOAT+ ; This word is the simplest way to declared structure access words in forth - the two STRUCT modules contain a more elaborate series of words. Use this one like:
0 ( a fresh definition is started ) +FIELD zapp.a+ CHAR+ ( zero offset from the base of the struct ) +FIELD zapp.b+ CELL+ ( no alignment, starts off at 1 from base ) +FIELD zapp+ DROP ( store size of complete zap structure ) 0 zapp+ ( extend the zap structure ) +FIELD zappx.c+ CELL+ ( a new field ) +FIELD zappx+ DROP ( and save it again ) CREATE zapp1 0 zapp+ ALLOT ( a way to allocate a strucutre ) zapp2 zapp.b+ @ ( read a value from the field ) 16 zapp2 zapp.b+ ! ( store a value in there )
this form is not the traditional form used in forth, it is however quite simple. Use the simplefield declaration with /FIELD to be compatible with traditional styles that build on top of sizeof constants in forth (which are not part of the ANS Forth standard).
slash-field:useful — ordinary primitive
EXTENSIONS
/FIELD
( offset size "name" -- offset+size )( | ) ; |
; |
created a new +FIELD name with an OFFSET-RT of offset. Then add the size value to the offset so that the next /FIELD declaration will start at the end of the field currently declared. This word is the simplest way to declared structure access words in forth - the two STRUCT modules contain a more elaborate series of words. This one is used like:
0 ( a fresh definition is started ) /CHAR /FIELD ->zapp.a ( zero offset from the base of the struct ) /CELL /FIELD ->zapp.b ( no alignment, starts off at 1 from base ) CONSTANT /zapp ( store size of complete zap structure ) /zapp ( extend the zap structure ) /CELL /FIELD ->zappx.c ( a new field ) CONSTANT /zappx ( and save it again ) CREATE zapp1 /zapp ALLOT ( a way to allocate a strucutre ) /zapp BUFFER: zapp2 ( another way to do it, semi-standard ) zapp2 ->zapp.b @ ( read a value from the field ) 16 zapp2 ->zapp.b ! ( store a value in there )
compare also with /CHAR /WCHAR /CELL /DCELL and use +FIELD as the lowlevel word, can simulate as
: /FIELD SWAP +FIELD + ;
field-minus-offset:useful.1 — forthword synonym
EXTENSIONS
FIELD-OFFSET
( .. )( | ) ; |
; |
forthword synonym FIELD-OFFSET
is doing the same as +CONSTANT
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
fig-minus-word:your.1 — obsolete forthword
EXTENSIONS
FIG-WORD
( .. )(
)
;
as:"fig-minus-word";
obsolete forthword FIG-WORD
is doing the same as HERE-WORD
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
Q-file:tools_misc — ordinary primitive
FORTH
?FILE
( file-id -- )(
)
;
p4:"Q-file";
check the file-id otherwise (fixme)
file-block:file_misc — ordinary primitive
FORTH
FILE-BLOCK
( a file-id -- c )( | ) ; |
; |
file-buffer:file_misc — ordinary primitive
FORTH
FILE-BUFFER
( a file-id -- c )( | ) ; |
; |
file-check:forth_usual — ordinary primitive
FORTH
FILE-CHECK
( n -- )(
)
;
p4:"file-check";
Check for file access error.
\ : FILE-CHECK ( n -- ) THROW ; : FILE-CHECK ( n -- ) ABORT" File Access Error " ;
file-check:toolbelt — ordinary primitive
FORTH
FILE-CHECK
( n -- )(
)
;
p4:"file-check";
Check for file access error.
\ : FILE-CHECK ( n -- ) THROW ; : FILE-CHECK ( n -- ) ABORT" File Access Error " ;
file-empty-buffers:file_misc — ordinary primitive
FORTH
FILE-EMPTY-BUFFERS
( file-id -- )( | ) ; |
; |
file-minus-ext:file::environment — ordinary constant
ENVIRONMENT
FILE-EXT
( .. )(
)
;
as:"file-minus-ext";
( 1994 ) constant FILE-EXT
an ordinary constant (no special usage info)
file-flush:file_misc — ordinary primitive
FORTH
FILE-FLUSH
( file-id -- )( | ) ; |
; |
simulate : FILE-FLUSH DUP FILE-SAVE-BUFFERS FILE-EMTPY-BUFFERS ;
file-position:file — ordinary primitive
FORTH
FILE-POSITION
( file -- p.pos code )( | ) ; |
; |
return the current position in the file and return a status code. A code of zero means success.
file-rw:file_misc — ordinary primitive
FORTH
FILE-R/W
( addr blk f fid -- )( | ) ; |
; |
like FIG-Forth
R/W
file-save-buffers:file_misc — ordinary primitive
FORTH
FILE-SAVE-BUFFERS
( file-id -- )( | ) ; |
; |
file-size:file — ordinary primitive
FORTH
FILE-SIZE
( file -- s.size code )( | ) ; |
; |
return the current size of the file and return a status code. A code of zero means success.
file-status:file — ordinary primitive
FORTH
FILE-STATUS
( str-adr str-len -- sub-code code )( | ) ; |
; |
check the named file - if it exists the status code is zero. The sub-code is implementation-specific.
file-thru:file_misc — ordinary primitive
FORTH
FILE-THRU
( lo hi file-id -- )( | ) ; |
; |
see THRU
file-update:file_misc — ordinary primitive
FORTH
FILE-UPDATE
( file-id -- )( | ) ; |
; |
fill:core — ordinary primitive
FORTH
FILL
( mem-addr mem-length char -- )( | ) ; |
; |
fill a memory area with the given char, does now simply call memset()
find:core — ordinary primitive
FORTH
FIND
( bstring -- cfa|bstring -1|0|1 )( | ) ; |
; |
looks into the current search-order and tries to find the name string as the name of a word. Returns its execution-token or the original-bstring if not found, along with a flag-like value that is zero if nothing could be found. Otherwise it will be 1 if the word had been immediate, -1 otherwise.
find-arg:dstrings — ordinary primitive
FORTH
FIND-ARG
( s -- i true | false )( | ) ; |
; |
Leave true and its index i in the top string frame if the Forth string matches an element of the frame, else leave false. The index of the top frame element is zero. <ansref>"find-arg"</ansref>
flit:floating_misc.1 — ordinary primitive
FORTH
FLIT
( .. )(
)
;
as:"flit";
ordinary primitive FLIT
an executable word (no special usage info)
or wrapper call around p4_f_literal_execution
fliteral:floating.1 — compiling primitive
FORTH
FLITERAL
( .. )(
)
;
as:"fliteral";
compiling primitive FLITERAL
an executable word (no special usage info)
or wrapper call around p4_f_literal
fliteral:fpnostack.1 — compiling primitive
EXTENSIONS
FLITERAL
( .. )(
)
;
as:"fliteral";
compiling primitive FLITERAL
an executable word (no special usage info)
or wrapper call around p4_nofp_f_literal
fln:floating.1 — ordinary primitive
FORTH
FLN
( .. )(
)
;
as:"fln";
ordinary primitive FLN
an executable word (no special usage info)
or wrapper call around p4_f_ln
fln:fpnostack.1 — ordinary primitive
EXTENSIONS
FLN
( .. )(
)
;
as:"fln";
ordinary primitive FLN
an executable word (no special usage info)
or wrapper call around p4_nofp_f_ln
flnp-one:floating.1 — ordinary primitive
FORTH
FLNP1
( .. )(
)
;
as:"flnp-one";
ordinary primitive FLNP1
an executable word (no special usage info)
or wrapper call around p4_f_lnp1
flnp-one:fpnostack.1 — ordinary primitive
EXTENSIONS
FLNP1
( .. )(
)
;
as:"flnp-one";
ordinary primitive FLNP1
an executable word (no special usage info)
or wrapper call around p4_nofp_f_lnp1
back-float:floating.1 — ordinary primitive
FORTH
>FLOAT
( .. )(
)
;
as:"back-float";
ordinary primitive >FLOAT
an executable word (no special usage info)
or wrapper call around p4_to_float
back-float:fpnostack.1 — ordinary primitive
EXTENSIONS
>FLOAT
( .. )(
)
;
as:"back-float";
ordinary primitive >FLOAT
an executable word (no special usage info)
or wrapper call around p4_nofp_to_float
float-percent:struct.1 — ordinary primitive
EXTENSIONS
FLOAT%
( .. )(
)
;
as:"float-percent";
ordinary primitive FLOAT%
an executable word (no special usage info)
or wrapper call around p4_float_mod
float-plus:floating.1 — ordinary primitive
FORTH
FLOAT+
( .. )(
)
;
as:"float-plus";
ordinary primitive FLOAT+
an executable word (no special usage info)
or wrapper call around p4_d_float_plus
float-plus:fpnostack.1 — ordinary primitive
EXTENSIONS
FLOAT+
( .. )(
)
;
as:"float-plus";
ordinary primitive FLOAT+
an executable word (no special usage info)
or wrapper call around p4_nofp_d_float_plus
float-minus-input:floating_misc.1 — threadstate variable
FORTH
FLOAT-INPUT
( .. )( | ) ; |
; |
threadstate variable FLOAT-INPUT
float_input (no special usage info)
float-colon:structs.1 — ordinary primitive
EXTENSIONS
FLOAT:
( .. )(
)
;
as:"float-colon";
ordinary primitive FLOAT:
an executable word (no special usage info)
or wrapper call around p4_float_colon
floating:fpnostack::environment — ordinary constant
ENVIRONMENT
FLOATING
( .. )(
)
;
as:"floating";
( 1994 ) constant FLOATING
an ordinary constant (no special usage info)
floating-minus-ext:floating::environment — ordinary constant
ENVIRONMENT
FLOATING-EXT
( .. )( | ) ; |
; |
( 1994 ) constant FLOATING-EXT
an ordinary constant (no special usage info)
floating-minus-loaded:floating::environment — constructor primitive
ENVIRONMENT
FLOATING-LOADED
( .. )( | ) ; |
; |
constructor primitive FLOATING-LOADED
an executable word (no special usage info)
or wrapper call around floating_init
floating-minus-stack:floating::environment — ordinary primitive
ENVIRONMENT
FLOATING-STACK
( .. )( | ) ; |
; |
ordinary primitive FLOATING-STACK
an executable word (no special usage info)
or wrapper call around p__floating_stack
floats:floating.1 — ordinary primitive
FORTH
FLOATS
( .. )(
)
;
as:"floats";
ordinary primitive FLOATS
an executable word (no special usage info)
or wrapper call around p4_d_floats
floats:fpnostack.1 — ordinary primitive
EXTENSIONS
FLOATS
( .. )(
)
;
as:"floats";
ordinary primitive FLOATS
an executable word (no special usage info)
or wrapper call around p4_nofp_d_floats
flog:floating.1 — ordinary primitive
FORTH
FLOG
( .. )(
)
;
as:"flog";
ordinary primitive FLOG
an executable word (no special usage info)
or wrapper call around p4_f_log
flog:fpnostack.1 — ordinary primitive
EXTENSIONS
FLOG
( .. )(
)
;
as:"flog";
ordinary primitive FLOG
an executable word (no special usage info)
or wrapper call around p4_nofp_f_log
floor:floating.1 — ordinary primitive
FORTH
FLOOR
( .. )(
)
;
as:"floor";
ordinary primitive FLOOR
an executable word (no special usage info)
or wrapper call around p4_floor
floor:fpnostack.1 — ordinary primitive
EXTENSIONS
FLOOR
( .. )(
)
;
as:"floor";
ordinary primitive FLOOR
an executable word (no special usage info)
or wrapper call around p4_nofp_floor
floored:core::environment — ordinary constant
ENVIRONMENT
FLOORED
( .. )(
)
;
as:"floored";
( P4_TRUE ) constant FLOORED
an ordinary constant (no special usage info)
flush:block — ordinary primitive
FORTH
FLUSH
( -- )(
)
;
p4:"flush";
call SAVE-BUFFERS and then unassign all block buffers with EMPTY-BUFFERS
flush-file:file — ordinary primitive
FORTH
FLUSH-FILE
( file -- code )( | ) ; |
; |
flush all unsaved buffers of the file to disk. A status code of zero means success.
f-m-slash-mod:core — ordinary primitive
FORTH
FM/MOD
( n1.n1 n2 -- m n )( | ) ; |
; |
divide the double-cell value n1 by n2 and return both (floored) quotient n and remainder m
fmax:floating.1 — ordinary primitive
FORTH
FMAX
( .. )(
)
;
as:"fmax";
ordinary primitive FMAX
an executable word (no special usage info)
or wrapper call around p4_f_max
fmax:fpnostack.1 — ordinary primitive
EXTENSIONS
FMAX
( .. )(
)
;
as:"fmax";
ordinary primitive FMAX
an executable word (no special usage info)
or wrapper call around p4_nofp_f_max
fmin:floating.1 — ordinary primitive
FORTH
FMIN
( .. )(
)
;
as:"fmin";
ordinary primitive FMIN
an executable word (no special usage info)
or wrapper call around p4_f_min
fmin:fpnostack.1 — ordinary primitive
EXTENSIONS
FMIN
( .. )(
)
;
as:"fmin";
ordinary primitive FMIN
an executable word (no special usage info)
or wrapper call around p4_nofp_f_min
fnegate:floating.1 — ordinary primitive
FORTH
FNEGATE
( .. )(
)
;
as:"fnegate";
ordinary primitive FNEGATE
an executable word (no special usage info)
or wrapper call around p4_f_negate
fnegate:fpnostack.1 — ordinary primitive
EXTENSIONS
FNEGATE
( .. )(
)
;
as:"fnegate";
ordinary primitive FNEGATE
an executable word (no special usage info)
or wrapper call around p4_nofp_f_negate
forget:tools — ordinary primitive
FORTH
FORGET
( "word" -- )(
)
;
p4:"forget";
simulate: : FORGET [COMPILE] ' >NAME (FORGET) ; IMMEDIATE
paren-forget:tools_misc.1 — ordinary primitive
EXTENSIONS
(FORGET)
( .. )(
)
;
as:"paren-forget";
ordinary primitive (FORGET)
an executable word (no special usage info)
or wrapper call around p4_paren_forget
forth-minus-contact:environ::environment — ordinary primitive
ENVIRONMENT
FORTH-CONTACT
( .. )( | ) ; |
; |
ordinary primitive FORTH-CONTACT
an executable word (no special usage info)
or wrapper call around p__forth_contact
forth-minus-license:environ::environment — ordinary primitive
ENVIRONMENT
FORTH-LICENSE
( .. )( | ) ; |
; |
ordinary primitive FORTH-LICENSE
an executable word (no special usage info)
or wrapper call around p__forth_license
forth-minus-name:environ::environment — ordinary primitive
ENVIRONMENT
FORTH-NAME
( .. )(
)
;
as:"forth-minus-name";
ordinary primitive FORTH-NAME
an executable word (no special usage info)
or wrapper call around p__forth_name
forth-minus-version:environ::environment — ordinary primitive
ENVIRONMENT
FORTH-VERSION
( .. )( | ) ; |
; |
ordinary primitive FORTH-VERSION
an executable word (no special usage info)
or wrapper call around p__forth_version
forth-minus-wordlist:search.1 — - loader type P4_DVaL
FORTH
FORTH-WORDLIST
( .. )( | ) ; |
; |
- loader type P4_DVaL FORTH-WORDLIST
forth_wl (no special usage info)
fourth:toolbelt — ordinary primitive
FORTH
FOURTH
( w x y z -- w x y z w )( | ) ; |
; |
Copy fourth element on the stack onto top of stack.
: FOURTH 3 PICK ;
fover:floating.1 — ordinary primitive
FORTH
FOVER
( .. )(
)
;
as:"fover";
ordinary primitive FOVER
an executable word (no special usage info)
or wrapper call around p4_f_over
fover:fpnostack.1 — ordinary primitive
EXTENSIONS
FOVER
( .. )(
)
;
as:"fover";
ordinary primitive FOVER
an executable word (no special usage info)
or wrapper call around p4_nofp_f_over
f-p-store:floating_misc — ordinary primitive
FORTH
FP!
( addr -- )(
)
;
p4:"f-p-store";
sets the floating point stack pointer - this is the inverse of FP@
f-p-fetch:floating_misc — ordinary primitive
FORTH
FP@
( -- addr )(
)
;
p4:"f-p-fetch";
returns the floating point stack pointer
fpnostack-minus-ext:fpnostack::environment — ordinary constant
ENVIRONMENT
FPNOSTACK-EXT
( .. )( | ) ; |
; |
( 1994 ) constant FPNOSTACK-EXT
an ordinary constant (no special usage info)
fpnostack-minus-loaded:fpnostack::environment — constructor primitive
ENVIRONMENT
FPNOSTACK-LOADED
( .. )( | ) ; |
; |
constructor primitive FPNOSTACK-LOADED
an executable word (no special usage info)
or wrapper call around fpnostack_init
str-frame:dstrings — ordinary primitive
FORTH
$FRAME
( u -- )(
)
;
p4:"str-frame";
Push the description of a string stack frame starting at the top of the string stack and containing u entries onto the string frame stack. Errors are thrown if the frame stack would overflow or if the depth of the string stack above the top frame, if there is one, is less than u. The value u = 0 is allowed. <ansref>"string-frame"</ansref>
NOTE: The current implementation pushes u and the string stack pointer onto the frame stack.
str-frame-minus-depth:dstrings.1 — ordinary primitive
FORTH
$FRAME-DEPTH
( .. )( | ) ; |
; |
ordinary primitive $FRAME-DEPTH
an executable word (no special usage info)
or wrapper call around frame_depth
slash-frame-minus-stack:dstrings.1 — ordinary primitive
FORTH
/FRAME-STACK
( .. )( | ) ; |
; |
ordinary primitive /FRAME-STACK
an executable word (no special usage info)
or wrapper call around per_frame_stack
sharp-frames:dstrings.1 — ordinary primitive
FORTH
#FRAMES
( .. )(
)
;
as:"sharp-frames";
ordinary primitive #FRAMES
an executable word (no special usage info)
or wrapper call around num_frames
free:memory — ordinary primitive
FORTH
FREE
( ptr -- code )(
)
;
p4:"free";
free the memory from ALLOCATE a code of zero means success.
frot:floating.1 — ordinary primitive
FORTH
FROT
( .. )(
)
;
as:"frot";
ordinary primitive FROT
an executable word (no special usage info)
or wrapper call around p4_f_rot
frot:fpnostack.1 — ordinary primitive
EXTENSIONS
FROT
( .. )(
)
;
as:"frot";
ordinary primitive FROT
an executable word (no special usage info)
or wrapper call around p4_nofp_f_rot
fround:floating.1 — ordinary primitive
FORTH
FROUND
( .. )(
)
;
as:"fround";
ordinary primitive FROUND
an executable word (no special usage info)
or wrapper call around p4_f_round
fround:fpnostack.1 — ordinary primitive
EXTENSIONS
FROUND
( .. )(
)
;
as:"fround";
ordinary primitive FROUND
an executable word (no special usage info)
or wrapper call around p4_nofp_f_round
fs-dot:floating.1 — ordinary primitive
FORTH
FS.
( .. )(
)
;
as:"fs-dot";
ordinary primitive FS.
an executable word (no special usage info)
or wrapper call around p4_f_s_dot
fs-dot:fpnostack.1 — ordinary primitive
EXTENSIONS
FS.
( .. )(
)
;
as:"fs-dot";
ordinary primitive FS.
an executable word (no special usage info)
or wrapper call around p4_nofp_f_s_dot
fsin:floating.1 — ordinary primitive
FORTH
FSIN
( .. )(
)
;
as:"fsin";
ordinary primitive FSIN
an executable word (no special usage info)
or wrapper call around p4_f_sin
fsin:fpnostack.1 — ordinary primitive
EXTENSIONS
FSIN
( .. )(
)
;
as:"fsin";
ordinary primitive FSIN
an executable word (no special usage info)
or wrapper call around p4_nofp_f_sin
fsincos:floating.1 — ordinary primitive
FORTH
FSINCOS
( .. )(
)
;
as:"fsincos";
ordinary primitive FSINCOS
an executable word (no special usage info)
or wrapper call around p4_f_sincos
fsincos:fpnostack.1 — ordinary primitive
EXTENSIONS
FSINCOS
( .. )(
)
;
as:"fsincos";
ordinary primitive FSINCOS
an executable word (no special usage info)
or wrapper call around p4_nofp_f_sincos
fsinh:floating.1 — ordinary primitive
FORTH
FSINH
( .. )(
)
;
as:"fsinh";
ordinary primitive FSINH
an executable word (no special usage info)
or wrapper call around p4_f_sinh
fsinh:fpnostack.1 — ordinary primitive
EXTENSIONS
FSINH
( .. )(
)
;
as:"fsinh";
ordinary primitive FSINH
an executable word (no special usage info)
or wrapper call around p4_nofp_f_sinh
str-fsp:dstrings.1 — ordinary primitive
FORTH
$FSP
( .. )(
)
;
as:"str-fsp";
ordinary primitive $FSP
an executable word (no special usage info)
or wrapper call around sf_sp
str-fsp-zero:dstrings.1 — ordinary primitive
FORTH
$FSP0
( .. )(
)
;
as:"str-fsp-zero";
ordinary primitive $FSP0
an executable word (no special usage info)
or wrapper call around sf_sp0
fsqrt:floating.1 — ordinary primitive
FORTH
FSQRT
( .. )(
)
;
as:"fsqrt";
ordinary primitive FSQRT
an executable word (no special usage info)
or wrapper call around p4_f_sqrt
fsqrt:fpnostack.1 — ordinary primitive
EXTENSIONS
FSQRT
( .. )(
)
;
as:"fsqrt";
ordinary primitive FSQRT
an executable word (no special usage info)
or wrapper call around p4_nofp_f_sqrt
fswap:floating.1 — ordinary primitive
FORTH
FSWAP
( .. )(
)
;
as:"fswap";
ordinary primitive FSWAP
an executable word (no special usage info)
or wrapper call around p4_f_swap
fswap:fpnostack.1 — ordinary primitive
EXTENSIONS
FSWAP
( .. )(
)
;
as:"fswap";
ordinary primitive FSWAP
an executable word (no special usage info)
or wrapper call around p4_nofp_f_swap
ftan:floating.1 — ordinary primitive
FORTH
FTAN
( .. )(
)
;
as:"ftan";
ordinary primitive FTAN
an executable word (no special usage info)
or wrapper call around p4_f_tan
ftan:fpnostack.1 — ordinary primitive
EXTENSIONS
FTAN
( .. )(
)
;
as:"ftan";
ordinary primitive FTAN
an executable word (no special usage info)
or wrapper call around p4_nofp_f_tan
ftanh:floating.1 — ordinary primitive
FORTH
FTANH
( .. )(
)
;
as:"ftanh";
ordinary primitive FTANH
an executable word (no special usage info)
or wrapper call around p4_f_tanh
ftanh:fpnostack.1 — ordinary primitive
EXTENSIONS
FTANH
( .. )(
)
;
as:"ftanh";
ordinary primitive FTANH
an executable word (no special usage info)
or wrapper call around p4_nofp_f_tanh
fvariable:floating.1 — definining primitive
FORTH
FVARIABLE
( .. )(
)
;
as:"fvariable";
definining primitive FVARIABLE
an executable word (no special usage info)
or wrapper call around p4_f_variable
fvariable:fpnostack.1 — definining primitive
EXTENSIONS
FVARIABLE
( .. )(
)
;
as:"fvariable";
definining primitive FVARIABLE
an executable word (no special usage info)
or wrapper call around p4_nofp_f_variable
f-like:floating.1 — ordinary primitive
FORTH
F~
( .. )(
)
;
as:"f-like";
ordinary primitive F~
an executable word (no special usage info)
or wrapper call around p4_f_proximate
f-like:fpnostack.1 — ordinary primitive
EXTENSIONS
F~
( .. )(
)
;
as:"f-like";
ordinary primitive F~
an executable word (no special usage info)
or wrapper call around p4_nofp_f_proximate
garbage-Q:dstrings — ordinary primitive
FORTH
$GARBAGE?
( -- flag )(
)
;
str:"garbage-Q";
Leave true if there is garbage in the current string space. Not normally used, since garbage collection is transparent. <ansref>"string-garbage-question"</ansref>
str-gc-minus-off:dstrings.1 — ordinary primitive
FORTH
$GC-OFF
( .. )(
)
;
as:"str-gc-minus-off";
ordinary primitive $GC-OFF
an executable word (no special usage info)
or wrapper call around p4_str_gc_off
str-gc-minus-on:dstrings.1 — ordinary primitive
FORTH
$GC-ON
( .. )(
)
;
as:"str-gc-minus-on";
ordinary primitive $GC-ON
an executable word (no special usage info)
or wrapper call around p4_str_gc_on
get-current:search — ordinary primitive
FORTH
GET-CURRENT
( -- voc )(
)
;
p4:"get-current";
return the current definition vocabulary, see DEFINITIONS
get-order:search — ordinary primitive
FORTH
GET-ORDER
( -- vocn ... voc1 n )( | ) ; |
; |
get the current search order onto the stack, see SET-ORDER
gettimeofday:posix — ordinary primitive
EXTENSIONS
GETTIMEOFDAY
( -- double-time )( | ) ; |
; |
returns SVR/BSD gettimeofday(2). Never defined on 16-bit systems, hence TIME&DATE is more portable.
gforth-minus-dir:gforth::environment — ordinary constant
ENVIRONMENT
GFORTH-DIR
( .. )(
)
;
as:"gforth-minus-dir";
( 500 ) constant GFORTH-DIR
an ordinary constant (no special usage info)
getgid:shell — ordinary primitive
EXTENSIONS
$GID
( -- val )(
)
;
p4:"getgid";
calls system's
getgid
gotoxy:term — ordinary primitive
EXTENSIONS
GOTOXY
( x y -- )(
)
;
p4:"gotoxy";
move the cursor to the specified position on the screen - this is usually done by sending a corresponding esc-sequence to the terminal.
h-sh:toolbelt — immediate primitive
FORTH
H#
( "hexnumber" -- n )(
)
;
p4:"h-sh";
Get the next word in the input stream as a hex single-number literal. (Adopted from Open Firmware.)
: H# ( "hexnumber" -- n ) \ Simplified for easy porting. 0 0 BL WORD COUNT BASE @ >R HEX >NUMBER R> BASE ! ABORT" Not Hex " 2DROP ( n) STATE @ IF POSTPONE LITERAL THEN ; IMMEDIATE
dot-h2:your — ordinary primitive
EXTENSIONS
.H2
( value -- )(
)
;
p4:"dot-h2";
print hexadecimal, but with per-byte 0-padding
0x0 -> 00 0xf -> 0f 0x12 -> 12 0x123 -> 0123 0x1234 -> 1234 0x12345 -> 012345
header:header.1 — obsolete forthword
EXTENSIONS
HEADER
( .. )(
)
;
as:"header";
obsolete forthword HEADER
is doing the same as $HEADER
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
str-header:header — ordinary primitive
EXTENSIONS
$HEADER
( bstring -- )(
)
;
p4:"str-header";
header-comma:header — ordinary primitive
EXTENSIONS
HEADER,
( str-ptr str-len -- )( | ) ; |
; |
CREATE a new header in the dictionary from the given string, without CFA
usage: : VARIABLE BL WORD COUNT HEADER, DOVAR , ;
header-minus-ext:header::environment — ordinary constant
ENVIRONMENT
HEADER-EXT
( .. )(
)
;
as:"header-minus-ext";
( 1983 ) constant HEADER-EXT
an ordinary constant (no special usage info)
paren-help:help.1 — ordinary primitive
FORTH
(HELP)
( .. )(
)
;
as:"paren-help";
ordinary primitive (HELP)
an executable word (no special usage info)
or wrapper call around p4_paren_help
here-word:your — ordinary primitive
EXTENSIONS
HERE-WORD
( char "name<char>" -- )( | ) ; |
; |
a FIG-compatible WORD. Where ANSI says "skip leading delimiters" this one acts as "skip leading whitespace". And it will not return anything and have the string parsed to HERE
dot-highlight:term.1 — ordinary primitive
EXTENSIONS
.HIGHLIGHT
( .. )(
)
;
as:"dot-highlight";
ordinary primitive .HIGHLIGHT
an executable word (no special usage info)
or wrapper call around p4_dot_highlight
dot-highlight-dot-off:term.1 — ordinary primitive
EXTENSIONS
.HIGHLIGHT.OFF
( .. )( | ) ; |
; |
ordinary primitive .HIGHLIGHT.OFF
an executable word (no special usage info)
or wrapper call around p4_dot_highlight_off
hiword:toolbelt — ordinary primitive
FORTH
HIWORD
( xxyy -- xx )(
)
;
p4:"hiword";
The high half of the value.
: HIWORD ( xxyy -- xx ) 16 RSHIFT ;
hld:misc.1 — threadstate variable
FORTH
HLD
( .. )(
)
;
as:"hld";
threadstate variable HLD
hld (no special usage info)
slash-hold:core::environment — ordinary constant
ENVIRONMENT
/HOLD
( .. )(
)
;
as:"slash-hold";
( MIN_HOLD ) constant /HOLD
an ordinary constant (no special usage info)
hold:core — ordinary primitive
FORTH
HOLD
( char -- )(
)
;
p4:"hold";
the old-style forth-formatting system -- this word adds a char to the picutred output string.
dot-home:term.1 — ordinary primitive
EXTENSIONS
.HOME
( .. )(
)
;
as:"dot-home";
ordinary primitive .HOME
an executable word (no special usage info)
or wrapper call around p4_dot_home
home:shell — ordinary primitive
EXTENSIONS
$HOME
( -- str-ptr str-len )(
)
;
p4:"home";
calls system's
getenv(HOME)
host-minus-system:environ::environment — ordinary primitive
ENVIRONMENT
HOST-SYSTEM
( .. )( | ) ; |
; |
ordinary primitive HOST-SYSTEM
an executable word (no special usage info)
or wrapper call around p__host_system
htonl:posix.1 — ordinary primitive
EXTENSIONS
HTONL
( .. )(
)
;
as:"htonl";
ordinary primitive HTONL
an executable word (no special usage info)
or wrapper call around p4_ntohl
htons:posix.1 — ordinary primitive
EXTENSIONS
HTONS
( .. )(
)
;
as:"htons";
ordinary primitive HTONS
an executable word (no special usage info)
or wrapper call around p4_ntohs
id-dot:misc — ordinary primitive
FORTH
ID.
( nfa -- )(
)
;
p4:"id-dot";
print the name-field pointed to by the nfa-argument. a synonym for .NAME - but this word is more portable due its heritage from fig-forth.
in fig-forth the name-field is effectivly a bstring with some flags, so the nfa's count has to be masked out, e.g.
: .NAME COUNT 32 AND TYPE ;
in other pfe configurations, the name might not contain the flags it it just a counted string - and there may be even more possibility.
: .NAME COUNT TYPE ;
you should more and more convert your code to use the sequence NAME>STRING TYPE
sharp-ifndef:cdecl.1 — immediate primitive
FORTH
#IFNDEF
( .. )(
)
;
as:"sharp-ifndef";
immediate primitive #IFNDEF
an executable word (no special usage info)
or wrapper call around p4_sh_ifnotdef
paren-immediate-sharp:header.1 — obsolete forthword
EXTENSIONS
(IMMEDIATE#)
( .. )( | ) ; |
; |
obsolete forthword (IMMEDIATE#)
is doing the same as IMMEDIATE-MASK
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
immediate-minus-mask:header.1 — ordinary constant
EXTENSIONS
IMMEDIATE-MASK
( .. )( | ) ; |
; |
( P4xIMMEDIATE ) constant IMMEDIATE-MASK
an ordinary constant (no special usage info)
back-in:core.1 — threadstate variable
FORTH
>IN
( .. )(
)
;
as:"back-in";
threadstate variable >IN
input.to_in (no special usage info)
include:file_misc — ordinary primitive
FORTH
INCLUDE
( 'filename' -- ? )(
)
;
p4:"include";
load the specified file, see also LOAD" filename"
include-file:file — ordinary primitive
FORTH
INCLUDE-FILE
( file -- )( | ) ; |
; |
INTERPRET the given file
included:file — ordinary primitive
FORTH
INCLUDED
( str-adr str-len -- )( | ) ; |
; |
open the named file and then INCLUDE-FILE see also the interactive INCLUDE
input-magic:tools_misc.1 — ordinary constant
EXTENSIONS
INPUT_MAGIC
( .. )(
)
;
as:"input-magic";
( P4_INPUT_MAGIC ) constant INPUT_MAGIC
an ordinary constant (no special usage info)
instance:struct — ordinary primitive
EXTENSIONS
INSTANCE
( len "name" -- )(
)
;
p4:"instance";
Create a named instance of a named structure.
: INSTANCE CREATE ALLOT ;
instance-addr:struct — ordinary primitive
EXTENSIONS
INSTANCE-ADDR
( len -- addr )( | ) ; |
; |
Create nameless instance of a structure and return base address.
: INSTANCE-ADDR HERE SWAP ALLOT ;
integer-colon:structs.1 — ordinary primitive
EXTENSIONS
INTEGER:
( .. )(
)
;
as:"integer-colon";
ordinary primitive INTEGER:
an executable word (no special usage info)
or wrapper call around p4_cell_colon
dot-intensity:term.1 — ordinary primitive
EXTENSIONS
.INTENSITY
( .. )(
)
;
as:"dot-intensity";
ordinary primitive .INTENSITY
an executable word (no special usage info)
or wrapper call around p4_dot_intensity
dot-intensity-dot-off:term.1 — ordinary primitive
EXTENSIONS
.INTENSITY.OFF
( .. )( | ) ; |
; |
ordinary primitive .INTENSITY.OFF
an executable word (no special usage info)
or wrapper call around p4_dot_intensity_off
interpret:forth_83.1 — ordinary primitive
FORTH
INTERPRET
( .. )(
)
;
as:"interpret";
ordinary primitive INTERPRET
an executable word (no special usage info)
or wrapper call around p4_interpret
into:your — compiling primitive
EXTENSIONS
INTO
( [name] -- pfa )(
)
;
p4:"into";
will return the parameter-field address of the following word. Unlike others, this word will also return the address of LOCALS| and local LVALUE - so in fact a
TO A
and
INTO A !
are the same. This word is most useful when calling C-exported function with a temporary local-VAR as a return-place argument - so the address of a local has to be given as an arg. Beware that you should not try to save the address anywhere else, since a local's address does always depend of the RP-depth - EXIT from a colon-word and the value may soon get overwritten. (see also TO )
invert:core — ordinary primitive
FORTH
INVERT
( value -- value' )(
)
;
p4:"invert";
make a bitwise negation of the value on stack. see also NEGATE
is:header — compiling primitive
EXTENSIONS
IS
( xt-value [word] -- )(
)
;
p4:"is";
set a DEFER word (in pfe: set the DOES-field - which is the BODY-field in ans-mode and therefore the same as TO / in fig-mode the DOES-field is one cell higher up than for a CREATE: VARIABLE Use IS freely on each DOES-words in both modes).
: IS ' STATE @ IF LITERAL, POSTPONE >DOES-BODY POSTPONE ! ELSE >DOES-BODY ! THEN ; IMMEDIATE
is-alnum:toolbelt — ordinary primitive
FORTH
IS-ALNUM
( char -- flag )(
)
;
p4:"is-alnum";
Test _char_ for alphanumeric [A-Za-z0-9].
: IS-ALNUM DUP IS-ALPHA ORIF DUP IS-DIGIT THEN NIP ;
is-alpha:toolbelt — ordinary primitive
FORTH
IS-ALPHA
( char -- flag )(
)
;
p4:"is-alpha";
Test _char_ for alphabetic [A-Za-z].
: IS-ALPHA 32 OR [CHAR] a - 26 U< ;
is-digit:toolbelt — ordinary primitive
FORTH
IS-DIGIT
( char -- flag )(
)
;
p4:"is-digit";
Test _char_ for digit [0-9].
: IS-DIGIT [CHAR] 0 - 10 U< ;
is-white:toolbelt — ordinary primitive
FORTH
IS-WHITE
( char -- flag )(
)
;
p4:"is-white";
Test char for white space.
: IS-WHITE 33 - 0< ;
k-minus-down:term.1 — ordinary constant
EXTENSIONS
K-DOWN
( .. )(
)
;
as:"k-minus-down";
( P4_KEY_kd ) constant K-DOWN
an ordinary constant (no special usage info)
k-minus-end:term.1 — ordinary constant
EXTENSIONS
K-END
( .. )(
)
;
as:"k-minus-end";
( P4_KEY_kH ) constant K-END
an ordinary constant (no special usage info)
k-minus-home:term.1 — ordinary constant
EXTENSIONS
K-HOME
( .. )(
)
;
as:"k-minus-home";
( P4_KEY_kh ) constant K-HOME
an ordinary constant (no special usage info)
k-minus-left:term.1 — ordinary constant
EXTENSIONS
K-LEFT
( .. )(
)
;
as:"k-minus-left";
( P4_KEY_kl ) constant K-LEFT
an ordinary constant (no special usage info)
k-minus-next:term.1 — ordinary constant
EXTENSIONS
K-NEXT
( .. )(
)
;
as:"k-minus-next";
( P4_KEY_kN ) constant K-NEXT
an ordinary constant (no special usage info)
k-minus-prior:term.1 — ordinary constant
EXTENSIONS
K-PRIOR
( .. )(
)
;
as:"k-minus-prior";
( P4_KEY_kP ) constant K-PRIOR
an ordinary constant (no special usage info)
k-minus-right:term.1 — ordinary constant
EXTENSIONS
K-RIGHT
( .. )(
)
;
as:"k-minus-right";
( P4_KEY_kr ) constant K-RIGHT
an ordinary constant (no special usage info)
k-minus-up:term.1 — ordinary constant
EXTENSIONS
K-UP
( .. )(
)
;
as:"k-minus-up";
( P4_KEY_ku ) constant K-UP
an ordinary constant (no special usage info)
k-one:term.1 — ordinary constant
EXTENSIONS
K1
( .. )(
)
;
as:"k-one";
( P4_KEY_k1 ) constant K1
an ordinary constant (no special usage info)
k-ten:term.1 — ordinary constant
EXTENSIONS
K10
( .. )(
)
;
as:"k-ten";
( P4_KEY_k0 ) constant K10
an ordinary constant (no special usage info)
sharp-k-twelve-ninetyseven-minus-g-twenty:host_k12.1 — ordinary constant
FORTH
#K1297-G20
( .. )( | ) ; |
; |
( _K12_SOURCE+100 ) constant #K1297-G20
an ordinary constant (no special usage info)
k-two:term.1 — ordinary constant
EXTENSIONS
K2
( .. )(
)
;
as:"k-two";
( P4_KEY_k2 ) constant K2
an ordinary constant (no special usage info)
k-three:term.1 — ordinary constant
EXTENSIONS
K3
( .. )(
)
;
as:"k-three";
( P4_KEY_k3 ) constant K3
an ordinary constant (no special usage info)
k-four:term.1 — ordinary constant
EXTENSIONS
K4
( .. )(
)
;
as:"k-four";
( P4_KEY_k4 ) constant K4
an ordinary constant (no special usage info)
k-five:term.1 — ordinary constant
EXTENSIONS
K5
( .. )(
)
;
as:"k-five";
( P4_KEY_k5 ) constant K5
an ordinary constant (no special usage info)
k-six:term.1 — ordinary constant
EXTENSIONS
K6
( .. )(
)
;
as:"k-six";
( P4_KEY_k6 ) constant K6
an ordinary constant (no special usage info)
k-seven:term.1 — ordinary constant
EXTENSIONS
K7
( .. )(
)
;
as:"k-seven";
( P4_KEY_k7 ) constant K7
an ordinary constant (no special usage info)
k-eight:term.1 — ordinary constant
EXTENSIONS
K8
( .. )(
)
;
as:"k-eight";
( P4_KEY_k8 ) constant K8
an ordinary constant (no special usage info)
k-nine:term.1 — ordinary constant
EXTENSIONS
K9
( .. )(
)
;
as:"k-nine";
( P4_KEY_k9 ) constant K9
an ordinary constant (no special usage info)
key:core — ordinary primitive
FORTH
KEY
( -- char )(
)
;
p4:"key";
return a single character from the keyboard - the key is not echoed.
paren-key:misc.1 — ordinary primitive
FORTH
(KEY)
( .. )(
)
;
as:"paren-key";
ordinary primitive (KEY)
an executable word (no special usage info)
or wrapper call around p4_paren_key
star-key-star:misc.1 — threadstate variable
FORTH
*KEY*
( .. )(
)
;
as:"star-key-star";
threadstate variable *KEY*
key (no special usage info)
key-question:facility — ordinary primitive
FORTH
KEY?
( -- flag )(
)
;
p4:"key-question";
if a character is available from the keyboard, return true. The KEY word will retrieve the actual character.
l-to-name:header — ordinary primitive
FORTH
L>NAME
( lfa -- nfa )(
)
;
p4:"l-to-name";
converts a pointer to the link-field (LFA) to point then to the corresponding name-field (CFA) - this one is one of the slowest operation available. One should always use the inverse operation "N>LINK" and cache an older value if that is needed. Some words might be linked but they do not have a name-field (just the other fields) but this word can not detect that and will try to look into the bits of the dictionary anway in the assumption that there is something - and if done in the wrong place it might even segfault. Only in fig-mode and for traditional fig-mode programs, this word may possibly have enough extra assertions to be somewhat reliable. (and fig-mode did not know about SYNONYMs - see note at LINK>).
implementation-specific configure-dependent fig-only simulation: : L>NAME BEGIN DUP C@ 128 AND 0= WHILE 1- REPEAT ;
last:header.1 — threadstate variable
FORTH
LAST
( .. )(
)
;
as:"last";
threadstate variable LAST
last (no special usage info)
latest:header — ordinary primitive
FORTH
LATEST
( -- nfa )(
)
;
p4:"latest";
return the NFA of the lateset definition in the CURRENT vocabulary
local-buffer-var:locals — compiling primitive
EXTENSIONS
LBUFFER:
( size [name] -- )( | ) ; |
; |
declares a single local VALUE using (LOCAL) - which will hold the address of an area like BUFFER: but carved from the return-stack (as in C with alloca). This local buffer will be automatically given up at the end of the word. The return-stack-pointer will be increased only at the time of this function (and the address assigned to the LVALUE) so that the provided size gets determined at runtime. Note that in some configurations the forth-return-stack area is quite small - for large string operations you should consider to use a POCKET-PAD in pfe.
: LBUFFER: STATE @ IF BUFFER: ELSE :NONAME ( size -- rp* ) R> RP@ - DUP RP! SWAP >R ;NONAME COMPILE, POSTPONE LVALUE THEN ; IMMEDIATE
question-leave:forth_usual — compiling primitive
FORTH
?LEAVE
( cond -- )(
)
;
p4:"question-leave";
leave a (innermost) loop if condition is true
lexeme:toolbelt — ordinary primitive
FORTH
LEXEME
( "name" -- str len )(
)
;
p4:"lexeme";
Get the next word on the line as a character string. If it's a single character, use it as the delimiter to get a phrase.
: LEXEME BL WORD ( addr) DUP C@ 1 = IF CHAR+ C@ WORD THEN COUNT ;
license:core_misc — ordinary primitive
FORTH
LICENSE
( -- )(
)
;
p4:"license";
show a lisence info - the basic PFE system is licensed under the terms of the LGPL (Lesser GNU Public License) - binary modules loaded into the system and hooking into the system may carry another LICENSE
: LICENSE [ ENVIRONMENT ] FORTH-LICENSE TYPE ;
dot-line:misc — ordinary primitive
FORTH
.LINE
( line# block# -- )(
)
;
p4:"dot-line";
to-link:header — ordinary primitive
FORTH
>LINK
( cfa -- lfa )(
)
;
p4:"to-link";
converts a pointer to the code-field (CFA) to point then to the corresponding link-field (LFA) - in some configurations this can be a very slow operation since the system might need to walk through all header-words in the system, looking for a >NAME that has the cfa and *then* returning the "N>LINK" result here - which might be none at all if the word is a :NONAME. Use always >NAME and treat this word as non-portable just like any assumption about the contents of the >LINK-field. Only in fig-mode and for traditional fig-mode programs, this word may possibly have enough extra assertions to be somewhat reliable. (and fig-mode did not know about SYNONYMs - see note at LINK>).
link-comma:chain — ordinary primitive
EXTENSIONS
link,
( list -- )(
)
;
p4:"link-comma";
: link, here over @ a, swap ! ;
link-from:header — ordinary primitive
FORTH
LINK>
( lfa -- cfa )(
)
;
p4:"link-from";
converts a pointer to the link-field (LFA) to point then to the corresponding code-field (CFA)
BEWARE: this one does not care about SYNONYMs and it is the only way to get at the data of a SYNONYM. Therefore, if you have a synonym called A for an old word B then there is a different result using "NAME>" on an A-nfa or using "N>LINK LINK>" since the first "NAME>" will return the xt of B while the latter will return the xt of A - but executing an xt of A is an error and it will THROW
this difference is intentional to allow knowledgable persons to do weird things looking around in the dictionary. The forth standard words will not give you much of a chance to get hold of the nfa of a SYNONYM word anyway - asking FIND for a word A will return the execution token of B immediatly and "NAME>" on that one lead to the nfa of B and not that of A.
gforth-linked:gforth — ordinary primitive
gforth'
linked
( list -- )\ gforth( | ) ; |
; |
: linked here over @ a, swap ! ;
(note: win32forth calls it "link," )
list:block — ordinary primitive
FORTH
LIST
( u -- )(
)
;
p4:"list";
display the block
lit:misc.1 — ordinary primitive
FORTH
LIT
( .. )(
)
;
as:"lit";
ordinary primitive LIT
an executable word (no special usage info)
or wrapper call around p4_literal_execution
literal:core — compiling primitive
FORTH
LITERAL
( value -- )immediate( | ) ; |
; |
if compiling this will take the value from the compiling-stack and puts in dictionary so that it will pop up again at the run-time of the word currently in creation. This word is used in compiling words but may also be useful in making a hard-constant value in some code-piece like this:
: DCELLS [ 2 CELLS ] LITERAL * ; ( will save a multiplication at runtime)
(in most configurations this word is statesmart and it will do nothing in interpret-mode. See LITERAL, for a non-immediate variant)
two-literal:double — compiling primitive
FORTH
2LITERAL
( x1 x2 -- )immediate( | ) ; |
; |
compile a double-cell number to the current definition. When run, the doubele-cell is left on the stack for execution.
( -- x1 x2 )
(in most configurations this word is statesmart and it will do nothing in interpret-mode. See 2LITERAL, for a non-immediate variant)
literal-comma:double_misc — ordinary primitive
FORTH
LITERAL,
( value -- )(
)
;
p4:"literal-comma";
ll:shell.1 — compiling primitive
EXTENSIONS
LL
( .. )(
)
;
as:"ll";
compiling primitive LL
an executable word (no special usage info)
or wrapper call around p4_ll
ln:shell.1 — compiling primitive
EXTENSIONS
LN
( .. )(
)
;
as:"ln";
compiling primitive LN
an executable word (no special usage info)
or wrapper call around p4_link
load-quote:misc — compiling primitive
FORTH
LOAD"
( [filename<">] -- ? )obsolete ( | ) ; |
; |
load the specified file - this word can be compiled into a word-definition obsolete! use OPEN-BLOCKFILE name LOAD
loadf-locate:useful — ordinary primitive
EXTENSIONS
LOADF-LOCATE
( "name" -- )( | ) ; |
; |
look for the filename created by LOADF that had been defining the given name. LOADF has created a marker that is above the INCLUDED file and that marker has a body-value just below the INCLUDED file. Hence the symbol was defined during LOADF execution of that file.
: LOADF-LOCATE ?EXEC POSTPONE ' (LOADF-LOCATE) .NAME ;
paren-loadf-minus-locate:useful.1 — ordinary primitive
EXTENSIONS
(LOADF-LOCATE)
( .. )( | ) ; |
; |
ordinary primitive (LOADF-LOCATE)
an executable word (no special usage info)
or wrapper call around p4_paren_loadf_locate
Q-loading:tools_misc — ordinary primitive
FORTH
?LOADING
( -- )(
)
;
p4:"Q-loading";
check that the currently interpreted text is from a file/block, otherwise THROW
loadm:dlfcn — ordinary primitive
FORTH
LOADM
( 'filename' -- )(
)
;
p4:"loadm";
dlmap the shared object (or share an already mapped object) and run the per-thread initialization code. This is the user-convenient function, otherwise use (LOADM)
simulate: : LOADM BL WORD ((IS_MODULE_LOADED)) IF EXIT THEN HERE (LOADM) 0= IF ." -- load failed: " HERE COUNT TYPE CR THEN ;
paren-loadm:dlfcn.1 — ordinary primitive
FORTH
(LOADM)
( .. )(
)
;
as:"paren-loadm";
ordinary primitive (LOADM)
an executable word (no special usage info)
or wrapper call around p4_paren_loadm
to-from-load-signals-back-back:signals.1 — constructor primitive
EXTENSIONS
<<load_signals>>
( .. )( | ) ; |
; |
constructor primitive <<load_signals>>
an executable word (no special usage info)
or wrapper call around p4_load_signals
paren-local:locals.1 — compiling primitive
FORTH
(LOCAL)
( .. )(
)
;
as:"paren-local";
compiling primitive (LOCAL)
an executable word (no special usage info)
or wrapper call around p4_paren_local
local-minus-dlcall:dlfcn.1 — immediate primitive
FORTH
LOCAL-DLCALL
( .. )( | ) ; |
; |
immediate primitive LOCAL-DLCALL
an executable word (no special usage info)
or wrapper call around p4_local_dlcall
local-dlsym:dlfcn — immediate primitive
FORTH
LOCAL-DLSYM
( [symbolname] -- address )exec-only( | ) ; |
; |
lookup the symbol that follows and leave the address (or null)
sharp-locals:locals::environment — ordinary constant
ENVIRONMENT
#LOCALS
( .. )(
)
;
as:"sharp-locals";
( MAX_LOCALS ) constant #LOCALS
an ordinary constant (no special usage info)
locals-minus-ext:locals::environment — ordinary constant
ENVIRONMENT
LOCALS-EXT
( .. )(
)
;
as:"locals-minus-ext";
( 1994 ) constant LOCALS-EXT
an ordinary constant (no special usage info)
locals-minus-loaded:locals::environment — constructor primitive
ENVIRONMENT
LOCALS-LOADED
( .. )( | ) ; |
; |
constructor primitive LOCALS-LOADED
an executable word (no special usage info)
or wrapper call around locals_init
locals-bar:locals — compiling primitive
FORTH
LOCALS|
( xN ... x2 x1 [name1 .. nameN <|>] -- )( | ) ; |
; |
create local identifiers to be used in the current definition. At runtime, each identifier will be assigned a value from the parameter stack. <br> The identifiers may be treated as if being a VALUE , it does also implement the ansi TO extensions for locals. Note that the identifiers are only valid inside the currently compiled word, the SEE decompiled word will show them as <A> <B> ... <N> a.s.o. <br> see also LVALUE
loop-magic:tools_misc.1 — ordinary constant
EXTENSIONS
LOOP_MAGIC
( .. )(
)
;
as:"loop-magic";
( P4_LOOP_MAGIC ) constant LOOP_MAGIC
an ordinary constant (no special usage info)
lower:forth_usual — ordinary primitive
FORTH
LOWER
( addr cnt -- )(
)
;
p4:"lower";
convert string to lower case This is not in L&P's F83 but provided for symmetry
simulate: : LOWER 0 DO DUP I + DUP C@ >R _tolower SWAP C! LOOP DROP ;
lower-minus-case:misc.1 — threadstate variable
FORTH
LOWER-CASE
( .. )(
)
;
as:"lower-minus-case";
threadstate variable LOWER-CASE
wordl_flag (no special usage info)
lower-minus-case-minus-fn:misc.1 — threadstate variable
FORTH
LOWER-CASE-FN
( .. )( | ) ; |
; |
threadstate variable LOWER-CASE-FN
lower_case_fn (no special usage info)
lower-minus-case-minus-fn-question:misc.1 — - loader type P4_DVaL
FORTH
LOWER-CASE-FN?
( .. )( | ) ; |
; |
- loader type P4_DVaL LOWER-CASE-FN?
lower_case_fn (no special usage info)
loword:toolbelt — ordinary primitive
FORTH
LOWORD
( xxyy -- yy )(
)
;
p4:"loword";
The low half of the value.
: LOWORD ( xxyy -- yy ) 65535 AND ;
ls:shell.1 — compiling primitive
EXTENSIONS
LS
( .. )(
)
;
as:"ls";
compiling primitive LS
an executable word (no special usage info)
or wrapper call around p4_ls
ls-cdefs:misc — ordinary primitive
FORTH
LS.COLON-DEFS
( -- )(
)
;
p4:"ls-cdefs";
see WORDS
ls-constants:misc — ordinary primitive
FORTH
LS.CONSTANTS
( -- )(
)
;
p4:"ls-constants";
see WORDS
ls-ddefs:misc — ordinary primitive
FORTH
LS.DOES-DEFS
( -- )(
)
;
p4:"ls-ddefs";
see WORDS
ls-markers:misc — ordinary primitive
FORTH
LS.MARKERS
( -- )(
)
;
p4:"ls-markers";
see WORDS
ls-primitives:misc — ordinary primitive
FORTH
LS.PRIMITIVES
( -- )(
)
;
p4:"ls-primitives";
see WORDS
ls-variables:misc — ordinary primitive
FORTH
LS.VARIABLES
( -- )(
)
;
p4:"ls-variables";
see WORDS
ls-vocabularies:misc — ordinary primitive
FORTH
LS.VOCABULARIES
( -- )( | ) ; |
; |
see WORDS
ls-words:misc — ordinary primitive
FORTH
LS.WORDS
( -- )(
)
;
p4:"ls-words";
see WORDS
l-shift:core — ordinary primitive
FORTH
LSHIFT
( value shift-val -- value' )( | ) ; |
; |
does a bitwise left-shift on value
lt-dlcose:dlfcn — ordinary primitive
EXTENSIONS
lt_dlclose
( handle -- ior )( | ) ; |
; |
close handle that was returned by lt_dlopenext
lt-dlerror:dlfcn — ordinary primitive
EXTENSIONS
lt_dlerror
( -- z-string* )( | ) ; |
; |
returns string describing the last dlerror as for lt_dlopenext and lt_dlsym
lt-dlinit:dlfcn — ordinary primitive
EXTENSIONS
lt_dlinit
( -- ior )(
)
;
p4:"lt-dlinit";
initialiize library, usually open the program itself so that its handles can be found under "0"
lt-dlopenext:dlfcn — ordinary primitive
EXTENSIONS
lt_dlopenext
( name-ptr,len -- handle-ptr|0 )( | ) ; |
; |
walk the searchpath for dlopen and try to open a binary module under the given name with the usual file extension for the current system.
lt-dlsym:dlfcn — ordinary primitive
EXTENSIONS
lt_dlsym
( name-ptr,len handle -- symbol-addr|0)( | ) ; |
; |
try to find the name in the binary module denoted by its handle .. if handle is null, use the main body of the program
local-value:locals — compiling primitive
EXTENSIONS
LVALUE
( value [name] -- )( | ) ; |
; |
declares a single local VALUE using (LOCAL) - a sequence of LVALUE declarations can replace a LOCALS| argument, ie.
LOCALS| a b c |
is the same as
LVALUE a LVALUE b LVALUE c
. This should also clarify the runtime stack behaviour of LOCALS| where the stack parameters seem to be assigned in reverse order as opposed to their textual identifier declarations. <br> compare with VALUE and the pfe's convenience word VAR.
: LVALUE STATE @ IF VALUE ELSE BL WORD COUNT DUP (LOCAL) (TO) THEN ; IMMEDIATE
paren-m-str-colon:dstrings.1 — compiling primitive
FORTH
(M$:)
( .. )(
)
;
as:"paren-m-str-colon";
compiling primitive (M$:)
an executable word (no special usage info)
or wrapper call around p4_marg_execution
m-star:core — ordinary primitive
FORTH
M*
( a b -- m,m )(
)
;
p4:"m-star";
multiply and return a double-cell result
make:useful — compiling primitive
EXTENSIONS
MAKE
( [word] -- )... ;AND(
)
;
p4:"make";
make a seperated piece of code between MAKE and ;AND and on execution of the MAKE the named word is twisted to point to this piece of code. The word is usually a DOER but the current implementation works on DEFER just as well, just as it does on other words who expect to find an execution-token in its PFA. You could even create a colon-word that starts with NOOP and can then make that colon-word be prefixed with the execution of the code piece. This MAKE does even work on LOCALS| and VAR but it is uncertain what that is good for.
make-str-space:dstrings — ordinary primitive
FORTH
MAKE-$SPACE
( size #frames -- addr )( | ) ; |
; |
Allocate and initialize a string space with size bytes available for the string buffer including the string stack, and with a string frame stack for frame description entries holding up to #frames. The size is rounded up to cell alignment, and the buffer begins and ends with cell alignment. Return addr, the address of the string space. The standard word FREE with addr as input can be used to release the space. <ansref>"make-string-space"</ansref>
marker:core — ordinary primitive
FORTH
MARKER
( 'name' -- )(
)
;
p4:"marker";
create a named marker that you can use to FORGET , running the created word will reset the dict/order variables to the state at the creation of this name.
: MARKER PARSE-WORD (MARKER) ;
see also ANEW which is not defined in ans-forth but which uses the MARKER functionality in the way it should have been defined.
paren-marker:core — ordinary primitive
EXTENSIONS
(MARKER)
( str-ptr str-len -- )( | ) ; |
; |
create a named marker that you can use to FORGET , running the created word will reset the dict/order variables to the state at the creation of this name.
: (MARKER) (CREATE) HERE , GET-ORDER DUP , 0 DO ?DUP IF , THEN LOOP 0 , ... DOES> DUP @ (FORGET) ... ;
max:core — ordinary primitive
FORTH
MAX
( a b -- c )(
)
;
p4:"max";
return the maximum of a and b
max-minus-char:core::environment — ordinary constant
ENVIRONMENT
MAX-CHAR
( .. )(
)
;
as:"max-minus-char";
( UCHAR_MAX ) constant MAX-CHAR
an ordinary constant (no special usage info)
max-minus-d:double::environment — ordinary primitive
ENVIRONMENT
MAX-D
( .. )(
)
;
as:"max-minus-d";
ordinary primitive MAX-D
an executable word (no special usage info)
or wrapper call around p__max_d
max-minus-files:file::environment — ordinary primitive
ENVIRONMENT
MAX-FILES
( .. )(
)
;
as:"max-minus-files";
ordinary primitive MAX-FILES
an executable word (no special usage info)
or wrapper call around p__max_files
max-minus-float:floating::environment — ordinary primitive
ENVIRONMENT
MAX-FLOAT
( .. )(
)
;
as:"max-minus-float";
ordinary primitive MAX-FLOAT
an executable word (no special usage info)
or wrapper call around p__max_float
max-minus-float:fpnostack::environment — ordinary primitive
ENVIRONMENT
MAX-FLOAT
( .. )(
)
;
as:"max-minus-float";
ordinary primitive MAX-FLOAT
an executable word (no special usage info)
or wrapper call around p__nofp_max_float
max-minus-n:toolbelt.1 — ordinary constant
FORTH
MAX-N
( .. )(
)
;
as:"max-minus-n";
( CELL_MAX ) constant MAX-N
an ordinary constant (no special usage info)
max-minus-n:core::environment — ordinary constant
ENVIRONMENT
MAX-N
( .. )(
)
;
as:"max-minus-n";
( CELL_MAX ) constant MAX-N
an ordinary constant (no special usage info)
max-minus-u:core::environment — ordinary constant
ENVIRONMENT
MAX-U
( .. )(
)
;
as:"max-minus-u";
( UCELL_MAX ) constant MAX-U
an ordinary constant (no special usage info)
max-minus-ud:double::environment — ordinary primitive
ENVIRONMENT
MAX-UD
( .. )(
)
;
as:"max-minus-ud";
ordinary primitive MAX-UD
an executable word (no special usage info)
or wrapper call around p__max_ud
memory-minus-alloc-minus-ext:memory::environment — ordinary constant
ENVIRONMENT
MEMORY-ALLOC-EXT
( .. )( | ) ; |
; |
( 1994 ) constant MEMORY-ALLOC-EXT
an ordinary constant (no special usage info)
memory-check:forth_usual — ordinary primitive
FORTH
MEMORY-CHECK
( n -- )(
)
;
p4:"memory-check";
Check for memory allocation error.
\ : MEMORY-CHECK ( n -- ) THROW ; : MEMORY-CHECK ( n -- ) ABORT" Memory Allocation Error " ;
memory-check:toolbelt — ordinary primitive
FORTH
MEMORY-CHECK
( n -- )(
)
;
p4:"memory-check";
Check for memory allocation error.
\ : MEMORY-CHECK ( n -- ) THROW ; : MEMORY-CHECK ( n -- ) ABORT" Memory Allocation Error " ;
min:core — ordinary primitive
FORTH
MIN
( a b -- c )(
)
;
p4:"min";
return the minimum of a and b
mkdir:shell.1 — compiling primitive
EXTENSIONS
MKDIR
( .. )(
)
;
as:"mkdir";
compiling primitive MKDIR
an executable word (no special usage info)
or wrapper call around p4_md
mod:core — ordinary primitive
FORTH
MOD
( a b -- c )(
)
;
p4:"mod";
return the module of "a mod b"
slash-mod:core — ordinary primitive
FORTH
/MOD
( a b -- m n )(
)
;
p4:"slash-mod";
divide a and b and return both quotient n and remainder m
module:module — ordinary primitive
EXTENSIONS
MODULE
( "name" -- old-current )( | ) ; |
; |
create a new WORDLIST with the given name. It will also have an implicit hidden vocabulary just as well and all DEFINITIONS will go into that hidden wordlist. Therefore the old CURRENT is memorized on the cs-stack.
effectivly, CONTEXT[1] will have the wordlist-id of the public wordlist "name" and CONTEXT[0] will have the hidden wordlist contained in "name" - the hidden wordlist will always be known as HIDDEN' so that it can be re-referenced without need to use ALSO just to access a single definition from just another vocabulary. Note that HIDDEN' is defined immediate (a VOCABULARY' ) to modify the ORDER inside a colon definition.
: MODULE CURRENT @ ( -- old-current ) VOCABULARY ALSO LATEST NAME> EXECUTE ALSO DEFINITIONS C" HIDDEN'" $CREATE WORDLIST CONTEXT ! ;
move:core — ordinary primitive
FORTH
MOVE
( from to length -- )(
)
;
p4:"move";
memcpy an area
move-file:file_misc — ordinary primitive
FORTH
MOVE-FILE
( src-str src-strlen dst-str dst-strlen -- errno|0 )( | ) ; |
; |
like RENAME-FILE, but also across-volumes <br> moves the file from src-name to dst-name and returns an error-code or null
byte-swap-move:forth_83 — ordinary primitive
FORTH
>MOVE<
( from-addr to-addr count -- )( | ) ; |
; |
see MOVE , does byte-swap for each word underway
ms:facility — ordinary primitive
FORTH
MS
( n -- )(
)
;
p4:"ms";
wait at least the specified milliseconds (suspend the forth tasklet)
mv:shell.1 — compiling primitive
EXTENSIONS
MV
( .. )(
)
;
as:"mv";
compiling primitive MV
an executable word (no special usage info)
or wrapper call around p4_mv
newline-str:dstrings — ordinary primitive
FORTH
\n$
( $: -- newline$ )(
)
;
p4:"newline-str";
Push the MSA of a fixed, external string whose body is the Unix newline character onto the string stack. <ansref>"newline-string"</ansref>
n-to-link:header — ordinary primitive
FORTH
N>LINK
( nfa -- lfa )(
)
;
p4:"n-to-link";
converts a pointer to the name-field (NFA) to point then to the corresponding link-field (LFA) - this operation is quicker than the inverse L>NAME. This word is a specific implementation detail and should not be used by normal users - instead use always NAME> which is much more portable. Many systems may possibly not even have a >LINK-field in the sense that a @ on this adress will lead to another >NAME. Any operation on the resulting >LINK-adress is even dependent on the current configuration of PFE - only in fig-mode you are asserted to have the classic detail. (and fig-mode did not know about SYNONYMs - see note at LINK>).
implementation-specific configure-dependent fig-only simulation: : N>LINK C@ + ;
dot-name:misc.1 — forthword synonym
FORTH
.NAME
( .. )(
)
;
as:"dot-name";
forthword synonym .NAME
is doing the same as ID.
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
to-name:header — ordinary primitive
FORTH
>NAME
( cfa -- nfa )(
)
;
p4:"to-name";
converts a pointer to the code-field (CFA) to point then to the corresponding name-field (NFA)
implementation-specific simulation: : >NAME >LINK L>NAME ;
name-flags-store:header — ordinary primitive
EXTENSIONS
NAME-FLAGS!
( nfa-flags nfa -- )( | ) ; |
; |
set the nfa-flags of nfa given. Note that in the fig-style the nfa-flags would include the nfa-count in the lower bits - therefore this should only set bits that had been previously retrieved with NAME-FLAGS@
: IMMEDIATE LAST @ NAME-FLAGS@ IMMEDIATE-MASK OR LAST @ NAME-FLAGS! ;
name-flags-fetch:header — ordinary primitive
EXTENSIONS
NAME-FLAGS@
( nfa -- nfa-flags )( | ) ; |
; |
get the nfa-flags that corresponds to the nfa given. Note that in the fig-style would include the nfa-count in the lower bits. (see NAME-FLAGS!)
name-to-string:header — ordinary primitive
FORTH
NAME>STRING
( name-token -- str-ptr str-len )( | ) ; |
; |
convert a name-token into a string-span, used to detect the name for a word and print it. The word ID. can be defined as
: ID. NAME>STRING TYPE ;
the implementation of NAME>STRING depends on the header layout that is defined during the configuration of the forth system.
: NAME>STRING COUNT 31 AND ; ( for fig-like names ) : NAME>STRING COUNT ; ( default, name is a simple counted string ) : NAME>STRING @ ZCOUNT ; ( name-token is a pointer to a C-level string ) : NAME>STRING COUNT 31 AND ( hybrid of fig-like and zero-terminated ) DUP 31 = IF DROP 1+ ZCOUNT THEN ; : NAME>STRING HEAD:: COUNT CODE:: PAD PLACE PAD ; ( different i86 segments )
needs-environment:environ — ordinary primitive
FORTH
NEEDS
( name -- )(
)
;
p4:"needs-environment";
A self-parsing variant of an environment-query check. It is similar to a simulation like
: NEEDS PARSE-WORD 2DUP ENVIRONMENT? IF DROP ( extra value ) 2DROP ( success - be silent ) ELSE TYPE ." not available " CR THEN ;
however that would only match those worset-envqueries which return a single extra item under the uppermost TRUE flag in the success case. Instead it works more like
: NEEDS PARSE-WORD 2DUP ENVIRONMENT-WORDLIST SEARCH-WORDLIST IF 2DROP ( success - be silent and just drop the parsed word ) ELSE TYPE ." not available " CR THEN ;
however we add the same extension as in ENVIRONMENT? as that it can automatically load a wordset module to fullfil a query that looks like "[wordsetname]-ext". Therefore, the following two lines are pretty much identical:
LOADM floating NEEDS floating-ext
the difference between the two: if somebody did provide a forth level implementation of floating-ext then that implementation might have registered a hint "floating-ext" in the environment-wordlist. This extra-hint will inhibit loading of the binary module even if it exists and not been loaded so far. The LOADM however will not check the ENVIRONMENT-WORDLIST and only check its loadlist of binary wordset modules in the system.
It is therefore recommended to use NEEDS instead of LOADM unless you know you want the binary module, quickly and uncondtionally.
negate:core — ordinary primitive
FORTH
NEGATE
( value -- value' )(
)
;
p4:"negate";
return the arithmetic negative of the (signed) cell
simulate: : NEGATE -1 * ;
new-chain:chain — definining primitive
EXTENSIONS
new-chain
( "name" -- )(
)
;
p4:"new-chain";
create a new chain and register in chain-link
: new-chain create: 0 , ['] noop , chain-link link, ;
layout of a chain: /cell field ->chain.link /cell field ->chain.exec /cell field ->chain.next
new-minus-sys-minus-chain:chain.1 — forthword synonym
EXTENSIONS
new-sys-chain
( .. )( | ) ; |
; |
forthword synonym new-sys-chain
is doing the same as new-chain
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
new-wordlist:chainlist — ordinary primitive
EXTENSIONS
NEW-WORDLIST
( "name" -- )( | ) ; |
; |
create a new WORDLIST and a "name" with a runtime of ( -- wordlist* )
: NEW-WORDLIST WORDLIST VALUE ; : NEW-WORDLIST CREATE: WORDLIST ;
usually used for DO-ALL-WORDS / DO-SYNONYM
next-minus-exception:exception.1 — threadstate variable
EXTENSIONS
NEXT-EXCEPTION
( .. )( | ) ; |
; |
threadstate variable NEXT-EXCEPTION
next_exception (no special usage info)
next-word:toolbelt — ordinary primitive
FORTH
NEXT-WORD
( -- str len )(
)
;
p4:"next-word";
Get the next word across line breaks as a character string. _len_ will be 0 at end of file.
: NEXT-WORD BEGIN BL WORD COUNT ( str len ) DUP IF EXIT THEN REFILL WHILE 2DROP ( ) REPEAT ;
str-nip:dstrings — ordinary primitive
FORTH
$NIP
($: a$ b$ -- b$ )(
)
;
p4:"str-nip";
Drop the next to top item from the string stack. <ansref>"string-nip"</ansref>
NOTE: Because of essential string space bookkeeping, the system level implementation can be little more efficient than the high-level definition:
: $NIP $SWAP $DROP ;
two-nip:toolbelt — ordinary primitive
FORTH
2NIP
( w x y z -- y z )(
)
;
p4:"two-nip";
Drop the third and fourth elements from the stack.
: 2NIP 2SWAP 2DROP ;
store-no:useful.1 — forthword synonym
EXTENSIONS
!NO
( .. )(
)
;
as:"store-no";
forthword synonym !NO
is doing the same as FALSE
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
no-debug:debug — ordinary primitive
FORTH
NO-DEBUG
( 'word' -- )(
)
;
p4:"no-debug";
the inverse of " DEBUG word "
noop:forth_usual.1 — ordinary primitive
FORTH
NOOP
( .. )(
)
;
as:"noop";
ordinary primitive NOOP
an executable word (no special usage info)
or wrapper call around p4_noop
dot-normal:term.1 — ordinary primitive
EXTENSIONS
.NORMAL
( .. )(
)
;
as:"dot-normal";
ordinary primitive .NORMAL
an executable word (no special usage info)
or wrapper call around p4_dot_normal
not:forth_83.1 — compiling primitive
FORTH
NOT
( .. )(
)
;
as:"not";
compiling primitive NOT
an executable word (no special usage info)
or wrapper call around p4_not
not:toolbelt.1 — ordinary primitive
FORTH
NOT
( .. )(
)
;
as:"not";
ordinary primitive NOT
an executable word (no special usage info)
or wrapper call around p4_zero_equal
bracket-not:useful — immediate primitive
EXTENSIONS
[NOT]
( a -- a' )(
)
;
p4:"bracket-not";
executes 0= but this word is immediate so that it does affect the cs-stack while compiling rather than compiling anything. This is useful just before words like [IF] to provide semantics of an
[IFNOT]
. It is most useful in conjunction with "[DEFINED] word" as it the sequence "
[DEFINED] word [NOT] [IF]
" can simulate "
[IFNOTDEF] word
"
to-number:core — ordinary primitive
FORTH
>NUMBER
( a,a str-adr str-len -- a,a' str-adr' str-len)( | ) ; |
; |
try to convert a string into a number, and place that number at a,a respeciting BASE
number-question:forth_usual — ordinary primitive
FORTH
NUMBER?
( addr -- d flag )( | ) ; |
; |
convert counted string to number - used in inner interpreter ( INTERPRET ), flags if conversion was successful
example: BL WORD HERE NUMBER? 0= IF ." not a number " THEN .
and-of:your.1 — immediate synonym
EXTENSIONS
&OF
( .. )(
)
;
as:"and-of";
immediate synonym &OF
is doing the same as INTO
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
of:core — compiling primitive
FORTH
OF
( comp-value case-value -- comp-value ).. ENDOF( | ) ; |
; |
off-store:forth_usual.1 — ordinary primitive
FORTH
OFF!
( .. )(
)
;
as:"off-store";
ordinary primitive OFF!
an executable word (no special usage info)
or wrapper call around p4_off_store
offset-colon:useful.1 — forthword synonym
EXTENSIONS
OFFSET:
( .. )(
)
;
as:"offset-colon";
forthword synonym OFFSET:
is doing the same as +CONSTANT
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
of-magic:tools_misc.1 — ordinary constant
EXTENSIONS
OF_MAGIC
( .. )(
)
;
as:"of-magic";
( P4_OF_MAGIC ) constant OF_MAGIC
an ordinary constant (no special usage info)
ok:misc.1 — ordinary primitive
FORTH
ok
( .. )(
)
;
as:"ok";
ordinary primitive ok
an executable word (no special usage info)
or wrapper call around p4_ok
on:forth_usual.1 — forthword synonym
FORTH
ON
( .. )(
)
;
as:"on";
forthword synonym ON
is doing the same as ON!
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
on:toolbelt.1 — ordinary primitive
FORTH
ON
( .. )(
)
;
as:"on";
ordinary primitive ON
an executable word (no special usage info)
or wrapper call around p4_on_store
open-blockfile:block_misc — ordinary primitive
FORTH
OPEN-BLOCKFILE
( "filename" -- )w32for( | ) ; |
; |
w32for-implementation: close-blockfile parse-word r/w open-file abort" failed to open block-file" set-blockfile empty-buffers
gforth-open-dir:gforth — ordinary primitive
gforth'
open-dir
( c_addr u -- wdirid wior )gforth open_dir( | ) ; |
; |
will vanish without warning. see gforth documentation.
open-file:file — ordinary primitive
FORTH
OPEN-FILE
( str-adr str-len mode -- file code )( | ) ; |
; |
open the named file with mode. returns the file id and a status code. A code of zero means success.
open-terminal-logfile:host_k12 — ordinary primitive
EXTENSIONS
OPEN-TERMINAL-LOGFILE
( s-buf s-len -- )( | ) ; |
; |
open terminal logfile named by the string-buffer all further output to the terminal window is also logged into this file. This is especially useful in embedded environments where the terminal connection is often not used or it is directed to a different location that does not easily allow to redirect the forth output to a file for further examination.
option-minus-ext:option::environment — ordinary constant
ENVIRONMENT
OPTION-EXT
( .. )(
)
;
as:"option-minus-ext";
( 2001 ) constant OPTION-EXT
an ordinary constant (no special usage info)
or:core — ordinary primitive
FORTH
OR
( a b -- ab )(
)
;
p4:"or";
return the bitwise OR of a and b - unlike AND this is usually safe to use on logical values
order:search — ordinary primitive
FORTH
ORDER
( -- )(
)
;
p4:"order";
show the current search-order, followed by the CURRENT DEFINITIONS vocabulary and the ONLY base vocabulary
orif:toolbelt — compiling primitive
FORTH
ORIF
( p ... -- flag )(
)
;
p4:"orif";
Given `p ORIF q THEN`, _q_ will not be performed if _p_ is true.
: ORIF S" DUP 0= IF DROP " EVALUATE ; IMMEDIATE
orig-magic:tools_misc.1 — ordinary constant
EXTENSIONS
ORIG_MAGIC
( .. )(
)
;
as:"orig-magic";
( P4_ORIG_MAGIC ) constant ORIG_MAGIC
an ordinary constant (no special usage info)
out:misc.1 — threadstate variable
FORTH
OUT
( .. )(
)
;
as:"out";
threadstate variable OUT
out (no special usage info)
out:toolbelt.1 — threadstate variable
FORTH
OUT
( .. )(
)
;
as:"out";
threadstate variable OUT
out (no special usage info)
over:core — ordinary primitive
FORTH
OVER
( a b -- a b a )(
)
;
p4:"over";
get the value from under the top of stack. The inverse operation would be TUCK
str-over:dstrings — ordinary primitive
FORTH
$OVER
( $: a$ b$ -- a$ b$ a$ )( | ) ; |
; |
Leave a copy of the next most accessible string stack entry on top of the string stack. The string value is not copied. <ansref>"string-over"</ansref>
slash-pad:core::environment — ordinary constant
ENVIRONMENT
/PAD
( .. )(
)
;
as:"slash-pad";
( MIN_PAD ) constant /PAD
an ordinary constant (no special usage info)
pad:core — ordinary primitive
FORTH
PAD
( -- addr )(
)
;
p4:"pad";
transient buffer region
page:facility.1 — ordinary primitive
FORTH
PAGE
( .. )(
)
;
as:"page";
ordinary primitive PAGE
an executable word (no special usage info)
or wrapper call around p4_dot_clrscr
Q-pairs:tools_misc — ordinary primitive
FORTH
?PAIRS
( a b -- )(
)
;
p4:"Q-pairs";
if compiling, check that the two magics on the CS-STACK are identical, otherwise throw <br> used in control-words
parse:core — ordinary primitive
FORTH
PARSE
( delim-char -- buffer-start buffer-count )( | ) ; |
; |
parse a piece of input (not much unlike WORD) and place it into the given buffer. The difference with word is also that WORD would first skip any delim-char while PARSE does not and thus may yield that one. In a newer version, PARSE will not copy but just return the word-span being seen in the input-buffer - therefore a transient space.
parse-comma:core_misc — ordinary primitive
FORTH
PARSE,
( "chars<">" -- )( | ) ; |
; |
Store a char-delimited string in data space as a counted string. As seen in Bawd's
: ," [CHAR] " PARSE STRING, ; IMMEDIATE
this implementation is much different from Bawd's
: PARSE, PARSE STRING, ;
parse-comma-quote:core_misc — immediate primitive
FORTH
PARSE,"
( "chars<">" -- )( | ) ; |
; |
Store a quote-delimited string in data space as a counted string.
: ," [CHAR] " PARSE STRING, ; IMMEDIATE
implemented here as
: PARSE," [CHAR] " PARSE, ; IMMEDIATE
parse-word:core — ordinary primitive
FORTH
PARSE-WORD
( "chars" -- c-addr u )( | ) ; |
; |
the ANS'94 standard describes this word in a comment under PARSE, section A.6.2.2008 - quote:
Skip leading spaces and parse name delimited by a space. c-addr is the address within the input buffer and u is the length of the selected string. If the parse area is empty, the resulting string has a zero length.
If both PARSE and PARSE-WORD are present, the need for WORD is largely eliminated.
perform:forth_usual.1 — obsolete forthword
EXTENSIONS
PERFORM
( .. )(
)
;
as:"perform";
obsolete forthword PERFORM
is doing the same as @EXECUTE
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
dot-pfe-minus-date:core_misc.1 — forthword synonym
FORTH
.PFE-DATE
( .. )(
)
;
as:"dot-pfe-minus-date";
forthword synonym .PFE-DATE
is doing the same as .CVERSION
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
pfe-minus-debug:debug::environment — threadstate valueGET
ENVIRONMENT
PFE-DEBUG
( .. )(
)
;
as:"pfe-minus-debug";
threadstate valueGET PFE-DEBUG
maxlevel (no special usage info)
sprintf:useful — ordinary primitive
EXTENSIONS
PFE-SPRINTF
( args ... format$ dest$ -- len-dest )( | ) ; |
; |
just like the standard sprintf() function in C, but the format is a counted string and accepts %#s to be the format-symbol for a forth-counted string. The result is a zeroterminated string at dest$ having a length being returned. To create a forth-counted string, you could use:
variable A 256 ALLOT 15 " example" " the %#s value is %i" A 1+ SPRINTF A C! A COUNT TYPE
pick:core — ordinary primitive
FORTH
PICK
( n -- value )(
)
;
p4:"pick";
pick the nth value from under the top of stack and push it note that
0 PICK -> DUP 1 PICK -> OVER
str-pick:dstrings — ordinary primitive
FORTH
$PICK
( u $: au$ ... a0$ -- au$ ... a0$ au$ )( | ) ; |
; |
Copy the u-th string stack entry to the top of the string stack. The string value is not copied. Throw an error if the input string stack does not have at least u+1 items. <ansref>"string-pick"</ansref>
getpid:shell — ordinary primitive
EXTENSIONS
$PID
( -- pid )(
)
;
p4:"getpid";
calls system's
getpid
plus-place:forth_usual.1 — ordinary primitive
FORTH
+PLACE
( .. )(
)
;
as:"plus-place";
ordinary primitive +PLACE
an executable word (no special usage info)
or wrapper call around p4_append
place:forth_usual — ordinary primitive
FORTH
PLACE
( str len addr -- )(
)
;
p4:"place";
Place the string _str len_ at _addr_, formatting it as a counted string.
: PLACE 2DUP 2>R 1+ SWAP MOVE 2R> C! ; : PLACE 2DUP C! 1+ SWAP CMOVE ;
place:toolbelt — ordinary primitive
FORTH
PLACE
( str len addr -- )(
)
;
p4:"place";
Place the string _str len_ at _addr_, formatting it as a counted string.
: PLACE 2DUP 2>R 1+ SWAP MOVE 2R> C! ; : PLACE 2DUP C! 1+ SWAP CMOVE ;
pocket-pad:misc — ordinary primitive
FORTH
POCKET-PAD
( -- addr )(
)
;
p4:"pocket-pad";
Returns the next pocket. A pocket has usually the size of a maxstring, see ENVIRONMENT /STRING (but can be configured to be different, mostly when MAXPATH > /STRING ) Note that a pocket is a temporary and forth internal functions do sometimes call POCKET-PAD too, especially when building filenames and getting a literal (but temporary) string from the keyboard. Functions are not expected to hold references to this transient area any longer than building a name and calling another word with it.
Usage of a pocket pad is a good way to make local temporary buffers superfluous that are only used to construct a temporary string that usually gets swallowed by another function.
depracated code: create temp-buffer 255 allot : make-temp ( str buf ) temp-buffer place " .tmp" count temp-buffer append temp-buffer count make-file ; replace with this: : make-temp ( str buf ) pocket-pad >r r place " .tmp" count r append r> count make-file ;
pointer-colon:structs.1 — ordinary primitive
EXTENSIONS
POINTER:
( .. )(
)
;
as:"pointer-colon";
ordinary primitive POINTER:
an executable word (no special usage info)
or wrapper call around p4_cell_colon
bracket-possibly:useful — immediate primitive
EXTENSIONS
[POSSIBLY]
( [name] -- ?? )( | ) ; |
; |
check if the name exists, and execute it immediatly if found. Derived from POSSIBLY as seen in other forth systems.
: [POSSIBLY] (') ?DUP IF EXECUTE THEN ; IMMEDIATE
postpone:core — compiling primitive
FORTH
POSTPONE
( [word] -- )(
)
;
p4:"postpone";
will compile the following word at the run-time of the current-word which is a compiling-word. The point is that POSTPONE takes care of the fact that word may be an IMMEDIATE-word that flags for a compiling word, so it must be executed (and not pushed directly) to compile sth. later. Choose this word in favour of COMPILE (for non-immediate words) and [COMPILE] (for immediate words)
sharp-pragma:cdecl.1 — ordinary primitive
FORTH
#PRAGMA
( .. )(
)
;
as:"sharp-pragma";
ordinary primitive #PRAGMA
an executable word (no special usage info)
or wrapper call around p4_sh_pragma
precision:floating.1 — - loader type P4_DVaL
FORTH
PRECISION
( .. )(
)
;
as:"precision";
- loader type P4_DVaL PRECISION
precision (no special usage info)
precision:fpnostack.1 — - loader type P4_DVaL
EXTENSIONS
PRECISION
( .. )(
)
;
as:"precision";
- loader type P4_DVaL PRECISION
precision (no special usage info)
printf:useful.1 — obsolete forthword
EXTENSIONS
PRINTF
( .. )(
)
;
as:"printf";
obsolete forthword PRINTF
is doing the same as PFE-PRINTF
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
prompt-minus-wordlist:chainlist.1 — - loader type P4_DVaL
EXTENSIONS
PROMPT-WORDLIST
( .. )( | ) ; |
; |
- loader type P4_DVaL PROMPT-WORDLIST
prompt_wl (no special usage info)
pwd:shell — ordinary primitive
EXTENSIONS
PWD
( -- )(
)
;
p4:"pwd";
calls system's
getcwd
and prints it to the screen
: PWD $CWD TYPE ;
quit:core — ordinary primitive
FORTH
QUIT
( -- )no-return(
)
;
p4:"quit";
this will throw and lead back to the outer-interpreter. traditionally, the outer-interpreter is called QUIT in forth itself where the first part of the QUIT-word had been to clean the stacks (and some other variables) and then turn to an endless loop containing QUERY and EVALUATE (otherwise known as INTERPRET ) - in pfe it is defined as a THROW ,
: QUIT -56 THROW ;
quoted-minus-parse-question:misc.1 — - loader type P4_DVaL
FORTH
QUOTED-PARSE?
( .. )( | ) ; |
; |
- loader type P4_DVaL QUOTED-PARSE?
quoted_parse (no special usage info)
dot-r:core — ordinary primitive
FORTH
.R
( val prec -- )(
)
;
p4:"dot-r";
print with precision - that is to fill a field of the give prec-with with right-aligned number from the converted value
two-to-r:core — compiling primitive
FORTH
2>R
( a,a -- R: a,a )(
)
;
p4:"two-to-r";
save a double-cell value onto the return-stack, see >R
r-slash-o:file.1 — ordinary constant
FORTH
R/O
( .. )(
)
;
as:"r-slash-o";
( FMODE_RO ) constant R/O
an ordinary constant (no special usage info)
r-slash-w:file.1 — ordinary constant
FORTH
R/W
( .. )(
)
;
as:"r-slash-w";
( FMODE_RW ) constant R/W
an ordinary constant (no special usage info)
r-zero:misc.1 — threadstate variable
FORTH
R0
( .. )(
)
;
as:"r-zero";
threadstate variable R0
r0 (no special usage info)
r-from:core — compiling primitive
FORTH
R>
( R: a -- a R: )(
)
;
p4:"r-from";
get back a value from the return-stack that had been saved there using >R . This is the traditional form of a local var space that could be accessed with R@ later. If you need more local variables you should have a look at LOCALS| which does grab some space from the return-stack too, but names them the way you like.
r-from-drop:misc — compiling primitive
FORTH
R>DROP
( -- )(
)
;
p4:"r-from-drop";
shortcut (e.g. in CSI-Forth) <br> note that the access to R is configuration dependent - only in a traditional fig-forth each NEST will be one cell wide - in case that there are no LOCALS| of course. And remember, the word above reads like the sequence R> and DROP but that is not quite true.
: R>DROP R> DROP ; ( is bad - correct might be ) : R>DROP R> R> DROP >R ;
r-fetch:core — compiling primitive
FORTH
R@
( R: a -- a R: a )(
)
;
p4:"r-fetch";
fetch the (upper-most) value from the return-stack that had been saved there using >R - This is the traditional form of a local var space. If you need more local variables you should have a look at LOCALS| , see also >R and R> . Without LOCALS-EXT there are useful words like 2R@ R'@ R"@ R!
raise:misc — ordinary primitive
FORTH
RAISE
( n -- )(
)
;
p4:"raise";
send a SIGNAL to self
random:misc — ordinary primitive
FORTH
RANDOM
( n1 -- n2 )(
)
;
p4:"random";
returns random number with 0 <= n2 < n1)
: RANDOM ?DUP IF _random SWAP MOD ELSE _random THEN ;
rand-max:misc::environment — ordinary constant
ENVIRONMENT
RAND_MAX
( .. )(
)
;
as:"rand-max";
( RAND_MAX ) constant RAND_MAX
an ordinary constant (no special usage info)
gforth-read-dir:gforth — ordinary primitive
gforth'
read-dir
( c_addr u1 wdirid -- u2 flag wior )gforth read_dir( | ) ; |
; |
will vanish without warning. see gforth documentation.
read-file:file — ordinary primitive
FORTH
READ-FILE
( str-adr str-len file -- count code )( | ) ; |
; |
fill the given string buffer with characters from the buffer. A status code of zero means success and the returned count gives the number of bytes actually read. If an error occurs the number of already transferred bytes is returned.
read-line:file — ordinary primitive
FORTH
READ-LINE
( str-adr str-len file -- count flag code )( | ) ; |
; |
fill the given string buffer with one line from the file. A line termination character (or character sequence under WIN/DOS) may also be placed in the buffer but is not included in the final count. In other respects this function performs a READ-FILE
recurse:core — immediate primitive
FORTH
RECURSE
( ? -- ? )(
)
;
p4:"recurse";
when creating a colon word the name of the currently-created word is smudged, so that you can redefine a previous word of the same name simply by using its name. Sometimes however one wants to recurse into the current definition instead of calling the older defintion. The RECURSE word does it exactly this.
traditionally the following code had been in use: : GREAT-WORD [ UNSMUDGE ] DUP . 1- ?DUP IF GREAT-WORD THEN ; now use : GREAT-WORD DUP . 1- ?DUP IF RECURSE THEN ;
recursive:header.1 — immediate primitive
EXTENSIONS
RECURSIVE
( .. )(
)
;
as:"recursive";
immediate primitive RECURSIVE
an executable word (no special usage info)
or wrapper call around p4_reveal
redefined-minus-msg:misc.1 — threadstate variable
FORTH
REDEFINED-MSG
( .. )( | ) ; |
; |
threadstate variable REDEFINED-MSG
redefined_msg (no special usage info)
redefined-minus-msg-question:misc.1 — - loader type P4_DVaL
FORTH
REDEFINED-MSG?
( .. )( | ) ; |
; |
- loader type P4_DVaL REDEFINED-MSG?
redefined_msg (no special usage info)
redo-all-words:chainlist — ordinary primitive
EXTENSIONS
REDO-ALL-WORDS
( wordlist* -- )( | ) ; |
; |
EXECUTE each entry in the wordlist in the original order defined
: REDO-ALL-WORDS 0 FIRST-NAME 0 SWAP ( under ) BEGIN ?DUP WHILE DUP NAME> SWAP ( under ) NAME-NEXT REPEAT BEGIN ?DUP WHILE EXECUTE REPEAT ;
to run the NEW-WORDLIST in last-run-first order, use DO-ALL-WORDS
rename-file:file — ordinary primitive
FORTH
RENAME-FILE
( str-adr1 str-len1 str-adr2 str-len2 -- code )( | ) ; |
; |
rename the file named by string1 to the name of string2. returns a status-code
repeat:core — compiling primitive
FORTH
REPEAT
( -- )(
)
;
p4:"repeat";
ends an unconditional loop, see BEGIN
replace-in:useful — ordinary primitive
EXTENSIONS
REPLACE-IN
( to-xt from-xt n "name" -- )( | ) ; |
; |
will handle the body of the named word as a sequence of cells (or tokens) and replaces the n'th occurences of from-xt into to-xt. A negative value will change all occurences. A zero value will not change any.
reposition-file:file — ordinary primitive
FORTH
REPOSITION-FILE
( o.offset file -- code )( | ) ; |
; |
reposition the file offset - the next FILE-POSITION would return o.offset then. returns a status code.
represent:floating.1 — ordinary primitive
FORTH
REPRESENT
( .. )(
)
;
as:"represent";
ordinary primitive REPRESENT
an executable word (no special usage info)
or wrapper call around p4_represent
represent:fpnostack.1 — ordinary primitive
EXTENSIONS
REPRESENT
( .. )(
)
;
as:"represent";
ordinary primitive REPRESENT
an executable word (no special usage info)
or wrapper call around p4_nofp_represent
required:environ — ordinary primitive
FORTH
REQUIRED
( ... str-ptr str-len -- ??? )( | ) ; |
; |
the filename argument is loaded via INCLUDED as an extension package to the current system. The filename is registered in the current ENVIRONMENT so that it is only INCLUDED once (!!) if called multiple times via REQUIRED or REQUIRES
reset-order:search — ordinary primitive
FORTH
RESET-ORDER
( -- )(
)
;
p4:"reset-order";
load the DEFAULT-ORDER into the current search ORDER - this is implicitly done when a trap is encountered.
reset-minus-order-minus-is:search.1 — threadstate variable
FORTH
RESET-ORDER-IS
( .. )( | ) ; |
; |
threadstate variable RESET-ORDER-IS
reset_order (no special usage info)
resize:memory — ordinary primitive
FORTH
RESIZE
( ptr newsize -- ptr' code )( | ) ; |
; |
resize the system memory chunk. a code of zero means success.
resize-file:file — ordinary primitive
FORTH
RESIZE-FILE
( s.size file -- code )( | ) ; |
; |
resize the give file, returns a status code.
backward-resolve:system — ordinary primitive
FORTH
<RESOLVE
( DP-mark -- )compile-only( | ) ; |
; |
forward-resolve:system — ordinary primitive
FORTH
RESOLVE>
( DP-mark -- )compile-only( | ) ; |
; |
restore-input:core — ordinary primitive
FORTH
RESTORE-INPUT
( xn ... x1 -- )( | ) ; |
; |
inverse of SAVE-INPUT
return-minus-stack-minus-cells:core::environment — ordinary primitive
ENVIRONMENT
RETURN-STACK-CELLS
( .. )( | ) ; |
; |
ordinary primitive RETURN-STACK-CELLS
an executable word (no special usage info)
or wrapper call around p__return_stack_cells
dot-reverse:term.1 — ordinary primitive
EXTENSIONS
.REVERSE
( .. )(
)
;
as:"dot-reverse";
ordinary primitive .REVERSE
an executable word (no special usage info)
or wrapper call around p4_dot_reverse
dot-reverse-dot-off:term.1 — ordinary primitive
EXTENSIONS
.REVERSE.OFF
( .. )( | ) ; |
; |
ordinary primitive .REVERSE.OFF
an executable word (no special usage info)
or wrapper call around p4_dot_reverse_off
rewind-file:toolbelt — ordinary primitive
FORTH
REWIND-FILE
( file-id -- ior )( | ) ; |
; |
Rewind the file.
: REWIND-FILE ( file-id -- ior ) 0 0 ROT REPOSITION-FILE ;
rm:shell.1 — compiling primitive
EXTENSIONS
RM
( .. )(
)
;
as:"rm";
compiling primitive RM
an executable word (no special usage info)
or wrapper call around p4_remove
rmdir:shell.1 — compiling primitive
EXTENSIONS
RMDIR
( .. )(
)
;
as:"rmdir";
compiling primitive RMDIR
an executable word (no special usage info)
or wrapper call around p4_rmdir
dash-roll:misc — ordinary primitive
FORTH
-ROLL
( xn ... x2 x1 n -- x1 xn ... x2 )( | ) ; |
; |
the inverse of ROLL
two-rot:double_misc — ordinary primitive
FORTH
2ROT
( d1,d1 d2,d2 d3,d3 -- d2,d2 d3,d3 d1,d1 )( | ) ; |
; |
the double-cell ROT operation. actively moves six cells, i.e.
( x1 x2 x3 x4 x5 x6 -- x3 x4 x5 x6 x1 x2 )
dash-rot:forth_usual — ordinary primitive
FORTH
-ROT
( a b c -- c a b )(
)
;
p4:"dash-rot";
inverse of ROT
rows:term.1 — threadstate variable
EXTENSIONS
ROWS
( .. )(
)
;
as:"rows";
threadstate variable ROWS
rows (no special usage info)
r-p-store:forth_usual — ordinary primitive
FORTH
RP!
( addr -- )(
)
;
p4:"r-p-store";
sets the return stack pointer, reverse of RP@
r-p-fetch:forth_usual — compiling primitive
FORTH
RP@
( -- addr )(
)
;
p4:"r-p-fetch";
returns the return stack pointer
example: : R@ RP@ @ ;
r-shift:core — ordinary primitive
FORTH
RSHIFT
( value shift-val -- value' )( | ) ; |
; |
does a bitwise logical right-shift on value (ie. the value is considered to be unsigned)
to-str-s:dstrings — ordinary primitive
FORTH
>$S
( a.str -- $: a$ )(
)
;
p4:"to-str-s";
Push the external Forth string a.str onto the string stack, without copying the string value into the string buffer. It is an unchecked error if the Forth string a.str is not stored as an external measured string. <ansref>"to-string-s"</ansref>
WARNING: If the string value of a.str is actually in the string buffer and not external, the push operation may generate a garbage collection that invalidates its MSA.
dot-s:tools — ordinary primitive
FORTH
.S
( -- )(
)
;
p4:"dot-s";
print the stack content in vertical nice format. tries to show cell-stack and float-stack side-by-side,
Depending on configuration, there are two parameter stacks: for integers and for floating point operations. If both stacks are empty, .S will display the message <code><stacks empty></code>.
If only the floating point stack is empty, .S displays the integer stack items in one column, one item per line, both in hex and in decimal like this (the first item is topmost):
12345 HEX 67890 .S 424080 [00067890] 12345 [00003039] ok
If both stacks ar not empty, .S displays both stacks, in two columns, one item per line
HEX 123456.78E90 ok DECIMAL 123456.78E90 .S 291 [00000123] 1.234568E+95 1164414608 [45678E90] ok
Confusing example? Remember that floating point input only works when the BASE number is DECIMAL. The first number looks like a floating point but it is a goodhex double integer too - the number base is HEX. Thus it is accepted as a hex number. Second try with a decimal base will input the floating point number.
If only the integer stack is empty, .S shows two columns, but he first columns is called <tt><stack empty></tt>, and the second column is the floating point stack, topmost item first.
s-quote:core — compiling primitive
FORTH
S"
( [string<">] -- string-address string-length)( | ) ; |
; |
s-comma:dstrings — ordinary primitive
FORTH
S,
( addr len -- addr' len )( | ) ; |
; |
ALLOT room and store the Forth string into data space as an mstring, leaving data space aligned; and leave the length and new body address. It is assumed that len is unsigned. An error is thrown if len is larger than the system parameter MAX_DATA_STR. <ansref>"s-comma"</ansref>
NOTE: MAX_DATA_STR is returned by
S" /SCOPY" ENVIRONMENT?
Perhaps this restriction should be removed in favor of a normal data space overflow error.
NOTE: S, is the same as STRING, in Wil Baden's Tool Belt, except it stores a measured string instead of a counted string.
s-cat:dstrings — ordinary primitive
FORTH
S-CAT
( a.str -- )(
)
;
p4:"s-cat";
Append the Forth string body to the end of the string currently being concatenated as the last string in the string buffer, and update its count field. If there is no concatenating string, start one. An error is thrown if the size of the combined string would be larger than MAX_MCOUNT or if there is not enough room in string space even after a garbage collection.
S-CAT is most commonly used on external strings, not assumed to exist as mstrings. In contrast to CAT, garbage collection could invalidate a.str if it is a dynamic string in the string buffer. S-CAT can be used in that situation if garbage collection is turned off with $GC-OFF.
When there is a concatenating string, concatenation is the only basic string operation that can copy a string into the string buffer. <ansref>"s-cat"</ansref>
to-str-s-copy:dstrings — ordinary primitive
FORTH
>$S-COPY
( a.str -- $: a$ )( | ) ; |
; |
Copy the external string value whose body address and count are on the parameter stack into the string buffer and push it onto the string stack. Errors are thrown if the count is larger than MAX_MCOUNT, if there is not enough room in string space, even after garbage collection, or if there is an unterminated string concatenation. The input external string need not exist as a measured string. <ansref>"to-string-s-copy"</ansref>
NOTE: MAX_MCOUNT is the largest size the count field of a measured string can hold, e.g., 255, 64K-1, or 4,096M-1. It is returned by: S" /DYNAMIC-STRING" ENVIRONMENT?
WARNING: This word should not be used when the input string is a bound string because the copy operation may generate a garbage collection which invalidates its MSA.
s-minus-k-one:term.1 — ordinary constant
EXTENSIONS
S-K1
( .. )(
)
;
as:"s-minus-k-one";
( P4_KEY_F1 ) constant S-K1
an ordinary constant (no special usage info)
s-minus-k-ten:term.1 — ordinary constant
EXTENSIONS
S-K10
( .. )(
)
;
as:"s-minus-k-ten";
( P4_KEY_FA ) constant S-K10
an ordinary constant (no special usage info)
s-minus-k-two:term.1 — ordinary constant
EXTENSIONS
S-K2
( .. )(
)
;
as:"s-minus-k-two";
( P4_KEY_F2 ) constant S-K2
an ordinary constant (no special usage info)
s-minus-k-three:term.1 — ordinary constant
EXTENSIONS
S-K3
( .. )(
)
;
as:"s-minus-k-three";
( P4_KEY_F3 ) constant S-K3
an ordinary constant (no special usage info)
s-minus-k-four:term.1 — ordinary constant
EXTENSIONS
S-K4
( .. )(
)
;
as:"s-minus-k-four";
( P4_KEY_F4 ) constant S-K4
an ordinary constant (no special usage info)
s-minus-k-five:term.1 — ordinary constant
EXTENSIONS
S-K5
( .. )(
)
;
as:"s-minus-k-five";
( P4_KEY_F5 ) constant S-K5
an ordinary constant (no special usage info)
s-minus-k-six:term.1 — ordinary constant
EXTENSIONS
S-K6
( .. )(
)
;
as:"s-minus-k-six";
( P4_KEY_F6 ) constant S-K6
an ordinary constant (no special usage info)
s-minus-k-seven:term.1 — ordinary constant
EXTENSIONS
S-K7
( .. )(
)
;
as:"s-minus-k-seven";
( P4_KEY_F7 ) constant S-K7
an ordinary constant (no special usage info)
s-minus-k-eight:term.1 — ordinary constant
EXTENSIONS
S-K8
( .. )(
)
;
as:"s-minus-k-eight";
( P4_KEY_F8 ) constant S-K8
an ordinary constant (no special usage info)
s-minus-k-nine:term.1 — ordinary constant
EXTENSIONS
S-K9
( .. )(
)
;
as:"s-minus-k-nine";
( P4_KEY_F9 ) constant S-K9
an ordinary constant (no special usage info)
s-zero:misc.1 — threadstate variable
FORTH
S0
( .. )(
)
;
as:"s-zero";
threadstate variable S0
s0 (no special usage info)
str-s-from:dstrings — ordinary primitive
FORTH
$S>
( $: a$ -- S: a.str )( | ) ; |
; |
Drop a$ from the string stack and leave it as a Forth string a.str, without copying. <ansref>"string-s-from"</ansref>
WARNING: If a$ is a bound string, it may move or disappear at the next garbage collection, making a.str invalid. This can be avoided by sandwiching sections of code where this could occur between $GC-OFF and $GC-ON.
str-s-from-copy:dstrings — ordinary primitive
FORTH
$S>-COPY
( $: a$ -- S: a.str )( | ) ; |
; |
Drop a$ from the string stack, copy it into data space as a measured string, and leave it as a Forth string a.str. An error is thrown if the string length is larger than the system parameter MAX_DATA_STR (see S,). <ansref>"string-s-from-copy"</ansref>
s-to-d:core — ordinary primitive
FORTH
S>D
( a -- a,a' )(
)
;
p4:"s-to-d";
signed extension of a single-cell value to a double-cell value
str-s-fetch:dstrings — ordinary primitive
FORTH
$S@
( $: a$ -- a$ S: a.str )( | ) ; |
; |
Leave the string stack unchanged, and leave the string body address and length on the data stack. <ansref>"string-s-fetch"</ansref>
NOTE: In earlier versions this was call $S@S. The trailing "S" is superfluous if it is understood that the only string format that usually appears on the data stack is the Forth string format.
WARNING: If a$ is a bound string, it may move at the next garbage collection, making a.str invalid. This can be avoided by sandwiching sections of code where this could occur between $GC-OFF and $GC-ON.
save-input:core — ordinary primitive
FORTH
SAVE-INPUT
( -- xn .. x1 )( | ) ; |
; |
fetch the current state of the input-channel which may be restored with RESTORE-INPUT later
scan:toolbelt — ordinary primitive
FORTH
SCAN
( str len char -- str+i len-i )( | ) ; |
; |
Look for a particular character in the specified string.
: SCAN >R BEGIN DUP WHILE OVER C@ R@ - WHILE 1 /STRING REPEAT THEN R> DROP ;
ie. scan for first occurence of c in string
: SCAN >R BEGIN DUP OVER C@ R@ = 0= OR WHILE 1- SWAP 1- SWAP REPEAT R> DROP ;
slash-scopy:dstrings::environment — ordinary constant
ENVIRONMENT
/SCOPY
( .. )(
)
;
as:"slash-scopy";
( MAX_DATA_STR ) constant /SCOPY
an ordinary constant (no special usage info)
scr:block.1 — threadstate variable
FORTH
SCR
( .. )(
)
;
as:"scr";
threadstate variable SCR
scr (no special usage info)
sdl-allocrw:lib_sdl.1 — ordinary primitive
[SDL]
SDL_AllocRW
( .. )(
)
;
as:"sdl-allocrw";
ordinary primitive SDL_AllocRW
an executable word (no special usage info)
or wrapper call around SDL_AllocRW
slash-sdl-audiocvt:lib_sdl.1 — ordinary constant
[SDL]
/SDL_AudioCVT
( .. )( | ) ; |
; |
( sizeof(SDL_AudioCVT) ) constant /SDL_AudioCVT
an ordinary constant (no special usage info)
minus-back-sdl-audiocvt-dot-buf:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.buf
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.buf
offsetof(SDL_AudioCVT,buf) (no special usage info)
minus-back-sdl-audiocvt-dot-dst-format:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.dst_format
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.dst_format
offsetof(SDL_AudioCVT,dst_format) (no special usage info)
minus-back-sdl-audiocvt-dot-len:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.len
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.len
offsetof(SDL_AudioCVT,len) (no special usage info)
minus-back-sdl-audiocvt-dot-len-cvt:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.len_cvt
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.len_cvt
offsetof(SDL_AudioCVT,len_cvt) (no special usage info)
minus-back-sdl-audiocvt-dot-len-mult:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.len_mult
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.len_mult
offsetof(SDL_AudioCVT,len_mult) (no special usage info)
minus-back-sdl-audiocvt-dot-len-ratio:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.len_ratio
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.len_ratio
offsetof(SDL_AudioCVT,ratio) (no special usage info)
minus-back-sdl-audiocvt-dot-needed:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.needed
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.needed
offsetof(SDL_AudioCVT,needed) (no special usage info)
minus-back-sdl-audiocvt-dot-rate-incr:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.rate_incr
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.rate_incr
offsetof(SDL_AudioCVT,rate_incr) (no special usage info)
minus-back-sdl-audiocvt-dot-src-format:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioCVT.src_format
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioCVT.src_format
offsetof(SDL_AudioCVT,scr_format) (no special usage info)
sdl-audiodrivername:lib_sdl.1 — ordinary primitive
[SDL]
SDL_AudioDriverName
( .. )( | ) ; |
; |
ordinary primitive SDL_AudioDriverName
an executable word (no special usage info)
or wrapper call around SDL_AudioDriverName
sdl-audioinit:lib_sdl.1 — ordinary primitive
[SDL]
SDL_AudioInit
( .. )(
)
;
as:"sdl-audioinit";
ordinary primitive SDL_AudioInit
an executable word (no special usage info)
or wrapper call around SDL_AudioInit
sdl-audioquit:lib_sdl.1 — ordinary primitive
[SDL]
SDL_AudioQuit
( .. )(
)
;
as:"sdl-audioquit";
ordinary primitive SDL_AudioQuit
an executable word (no special usage info)
or wrapper call around SDL_AudioQuit
slash-sdl-audiospec:lib_sdl.1 — ordinary constant
[SDL]
/SDL_AudioSpec
( .. )( | ) ; |
; |
( sizeof(SDL_AudioSpec) ) constant /SDL_AudioSpec
an ordinary constant (no special usage info)
minus-back-sdl-audiospec-dot-channels:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioSpec.channels
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioSpec.channels
offsetof(SDL_AudioSpec,channels) (no special usage info)
minus-back-sdl-audiospec-dot-format:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioSpec.format
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioSpec.format
offsetof(SDL_AudioSpec,format) (no special usage info)
minus-back-sdl-audiospec-dot-freq:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioSpec.freq
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioSpec.freq
offsetof(SDL_AudioSpec,freq) (no special usage info)
minus-back-sdl-audiospec-dot-samples:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioSpec.samples
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioSpec.samples
offsetof(SDL_AudioSpec,samples) (no special usage info)
minus-back-sdl-audiospec-dot-silence:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioSpec.silence
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioSpec.silence
offsetof(SDL_AudioSpec,silence) (no special usage info)
minus-back-sdl-audiospec-dot-size:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_AudioSpec.size
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_AudioSpec.size
offsetof(SDL_AudioSpec,size) (no special usage info)
sdl-audio-paused:lib_sdl.1 — ordinary constant
[SDL]
SDL_AUDIO_PAUSED
( .. )( | ) ; |
; |
( SDL_AUDIO_PAUSED ) constant SDL_AUDIO_PAUSED
an ordinary constant (no special usage info)
sdl-audio-playing:lib_sdl.1 — ordinary constant
[SDL]
SDL_AUDIO_PLAYING
( .. )( | ) ; |
; |
( SDL_AUDIO_PLAYING ) constant SDL_AUDIO_PLAYING
an ordinary constant (no special usage info)
sdl-audio-stopped:lib_sdl.1 — ordinary constant
[SDL]
SDL_AUDIO_STOPPED
( .. )( | ) ; |
; |
( SDL_AUDIO_STOPPED ) constant SDL_AUDIO_STOPPED
an ordinary constant (no special usage info)
sdl-buildaudiocvt:lib_sdl.1 — ordinary primitive
[SDL]
SDL_BuildAudioCVT
( .. )( | ) ; |
; |
ordinary primitive SDL_BuildAudioCVT
an executable word (no special usage info)
or wrapper call around SDL_BuildAudioCVT
sdl-clearerror:lib_sdl.1 — ordinary primitive
[SDL]
SDL_ClearError
( .. )( | ) ; |
; |
ordinary primitive SDL_ClearError
an executable word (no special usage info)
or wrapper call around SDL_ClearError
CompiledVersion:lib_sdl — ordinary primitive
[SDL]
SDL_CompiledVersion
( -- SDL_versionnum )( | ) ; |
; |
This function gets the version of the SDL library headers the PFE has been linked with. It returns the compact code from SDL_VERSIONNUM macro
sdl-convertcvt:lib_sdl.1 — ordinary primitive
[SDL]
SDL_ConvertCVT
( .. )( | ) ; |
; |
ordinary primitive SDL_ConvertCVT
an executable word (no special usage info)
or wrapper call around SDL_ConvertCVT
sdl-delay:lib_sdl.1 — ordinary primitive
[SDL]
SDL_Delay
( .. )(
)
;
as:"sdl-delay";
ordinary primitive SDL_Delay
an executable word (no special usage info)
or wrapper call around SDL_Delay
sdl-false:lib_sdl.1 — ordinary constant
[SDL]
SDL_FALSE
( .. )(
)
;
as:"sdl-false";
( SDL_FALSE ) constant SDL_FALSE
an ordinary constant (no special usage info)
sdl-freerw:lib_sdl.1 — ordinary primitive
[SDL]
SDL_FreeRW
( .. )(
)
;
as:"sdl-freerw";
ordinary primitive SDL_FreeRW
an executable word (no special usage info)
or wrapper call around SDL_FreeRW
sdl-freewav:lib_sdl.1 — ordinary primitive
[SDL]
SDL_FreeWAV
( .. )(
)
;
as:"sdl-freewav";
ordinary primitive SDL_FreeWAV
an executable word (no special usage info)
or wrapper call around SDL_FreeWAV
sdl-getaudiostatus:lib_sdl.1 — ordinary primitive
[SDL]
SDL_GetAudioStatus
( .. )( | ) ; |
; |
ordinary primitive SDL_GetAudioStatus
an executable word (no special usage info)
or wrapper call around SDL_GetAudioStatus
GetError:lib_sdl — ordinary primitive
[SDL]
SDL_GetError
( -- str-ptr str-len )( | ) ; |
; |
get it, based on
char * SDL_GetError(void);
sdl-gettick:lib_sdl.1 — ordinary primitive
[SDL]
SDL_GetTick
( .. )(
)
;
as:"sdl-gettick";
ordinary primitive SDL_GetTick
an executable word (no special usage info)
or wrapper call around SDL_GetTick
sdl-init:lib_sdl.1 — ordinary primitive
[SDL]
SDL_init
( .. )(
)
;
as:"sdl-init";
ordinary primitive SDL_init
an executable word (no special usage info)
or wrapper call around SDL_init
sdl-initsubsystem:lib_sdl.1 — ordinary primitive
[SDL]
SDL_InitSubSystem
( .. )( | ) ; |
; |
ordinary primitive SDL_InitSubSystem
an executable word (no special usage info)
or wrapper call around SDL_InitSubSystem
sdl-init-audio:lib_sdl.1 — ordinary constant
[SDL]
SDL_INIT_AUDIO
( .. )( | ) ; |
; |
( SDL_INIT_AUDIO ) constant SDL_INIT_AUDIO
an ordinary constant (no special usage info)
sdl-init-cdrom:lib_sdl.1 — ordinary constant
[SDL]
SDL_INIT_CDROM
( .. )( | ) ; |
; |
( SDL_INIT_CDROM ) constant SDL_INIT_CDROM
an ordinary constant (no special usage info)
sdl-init-eventthread:lib_sdl.1 — ordinary constant
[SDL]
SDL_INIT_EVENTTHREAD
( .. )( | ) ; |
; |
( SDL_INIT_EVENTTHREAD ) constant SDL_INIT_EVENTTHREAD
an ordinary constant (no special usage info)
sdl-init-everything:lib_sdl.1 — ordinary constant
[SDL]
SDL_INIT_EVERYTHING
( .. )( | ) ; |
; |
( SDL_INIT_EVERYTHING ) constant SDL_INIT_EVERYTHING
an ordinary constant (no special usage info)
sdl-init-joystick:lib_sdl.1 — ordinary constant
[SDL]
SDL_INIT_JOYSTICK
( .. )( | ) ; |
; |
( SDL_INIT_JOYSTICK ) constant SDL_INIT_JOYSTICK
an ordinary constant (no special usage info)
sdl-init-noparachute:lib_sdl.1 — ordinary constant
[SDL]
SDL_INIT_NOPARACHUTE
( .. )( | ) ; |
; |
( SDL_INIT_NOPARACHUTE ) constant SDL_INIT_NOPARACHUTE
an ordinary constant (no special usage info)
sdl-init-timer:lib_sdl.1 — ordinary constant
[SDL]
SDL_INIT_TIMER
( .. )( | ) ; |
; |
( SDL_INIT_TIMER ) constant SDL_INIT_TIMER
an ordinary constant (no special usage info)
sdl-init-video:lib_sdl.1 — ordinary constant
[SDL]
SDL_INIT_VIDEO
( .. )( | ) ; |
; |
( SDL_INIT_VIDEO ) constant SDL_INIT_VIDEO
an ordinary constant (no special usage info)
LinkedVersion:lib_sdl — ordinary primitive
[SDL]
SDL_LinkedVersion
( -- SDL_versionnum )( | ) ; |
; |
This function gets the version of the dynamically linked SDL library. it should NOT be used to fill a version structure, instead you should use the SDL_Version() macro. see SDL_LinkedVersion
implementation applies the SDL_VERSIONNUM macro to extern DECLSPEC const SDL_version * SDL_Linked_Version(void);
sdl-linked-version:lib_sdl.1 — ordinary primitive
[SDL]
SDL_Linked_Version
( .. )( | ) ; |
; |
ordinary primitive SDL_Linked_Version
an executable word (no special usage info)
or wrapper call around SDL_Linked_Version
sdl-loadwav:lib_sdl.1 — ordinary primitive
[SDL]
SDL_LoadWAV
( .. )(
)
;
as:"sdl-loadwav";
ordinary primitive SDL_LoadWAV
an executable word (no special usage info)
or wrapper call around SDL_LoadWAV
sdl-loadwav-rw:lib_sdl.1 — ordinary primitive
[SDL]
SDL_LoadWAV_RW
( .. )( | ) ; |
; |
ordinary primitive SDL_LoadWAV_RW
an executable word (no special usage info)
or wrapper call around SDL_LoadWAV_RW
sdl-lockaudio:lib_sdl.1 — ordinary primitive
[SDL]
SDL_LockAudio
( .. )(
)
;
as:"sdl-lockaudio";
ordinary primitive SDL_LockAudio
an executable word (no special usage info)
or wrapper call around SDL_LockAudio
sdl-lockaudio:lib_sdl.2 — ordinary primitive
[SDL]
SDL_LockAudio
( .. )(
)
;
as:"sdl-lockaudio";
ordinary primitive SDL_LockAudio
an executable word (no special usage info)
or wrapper call around SDL_LockAudio
sdl-mixaudio:lib_sdl.1 — ordinary primitive
[SDL]
SDL_MixAudio
( .. )(
)
;
as:"sdl-mixaudio";
ordinary primitive SDL_MixAudio
an executable word (no special usage info)
or wrapper call around SDL_MixAudio
sdl-openaudio:lib_sdl.1 — ordinary primitive
[SDL]
SDL_OpenAudio
( .. )(
)
;
as:"sdl-openaudio";
ordinary primitive SDL_OpenAudio
an executable word (no special usage info)
or wrapper call around SDL_OpenAudio
sdl-pressed:lib_sdl.1 — ordinary constant
[SDL]
SDL_PRESSED
( .. )(
)
;
as:"sdl-pressed";
( SDL_PRESSED ) constant SDL_PRESSED
an ordinary constant (no special usage info)
sdl-quit:lib_sdl.1 — ordinary primitive
[SDL]
SDL_Quit
( .. )(
)
;
as:"sdl-quit";
ordinary primitive SDL_Quit
an executable word (no special usage info)
or wrapper call around SDL_Quit
sdl-quitsubsystem:lib_sdl.1 — ordinary primitive
[SDL]
SDL_QuitSubSystem
( .. )( | ) ; |
; |
ordinary primitive SDL_QuitSubSystem
an executable word (no special usage info)
or wrapper call around SDL_QuitSubSystem
sdl-released:lib_sdl.1 — ordinary constant
[SDL]
SDL_RELEASED
( .. )(
)
;
as:"sdl-released";
( SDL_RELEASED ) constant SDL_RELEASED
an ordinary constant (no special usage info)
sdl-rwclose:lib_sdl.1 — ordinary primitive
[SDL]
SDL_RWclose
( .. )(
)
;
as:"sdl-rwclose";
ordinary primitive SDL_RWclose
an executable word (no special usage info)
or wrapper call around SDL_RWclose
sdl-rwfromfile:lib_sdl.1 — ordinary primitive
[SDL]
SDL_RWFromFile
( .. )( | ) ; |
; |
ordinary primitive SDL_RWFromFile
an executable word (no special usage info)
or wrapper call around SDL_RWFromFile
sdl-rwfromfp:lib_sdl.1 — ordinary primitive
[SDL]
SDL_RWFromFP
( .. )(
)
;
as:"sdl-rwfromfp";
ordinary primitive SDL_RWFromFP
an executable word (no special usage info)
or wrapper call around SDL_RWFromFP
sdl-rwfrommem:lib_sdl.1 — ordinary primitive
[SDL]
SDL_RWFromMem
( .. )(
)
;
as:"sdl-rwfrommem";
ordinary primitive SDL_RWFromMem
an executable word (no special usage info)
or wrapper call around SDL_RWFromMem
sdl-rwread:lib_sdl.1 — ordinary primitive
[SDL]
SDL_RWread
( .. )(
)
;
as:"sdl-rwread";
ordinary primitive SDL_RWread
an executable word (no special usage info)
or wrapper call around SDL_RWread
sdl-rwseek:lib_sdl.1 — ordinary primitive
[SDL]
SDL_RWseek
( .. )(
)
;
as:"sdl-rwseek";
ordinary primitive SDL_RWseek
an executable word (no special usage info)
or wrapper call around SDL_RWseek
sdl-rwtell:lib_sdl.1 — ordinary primitive
[SDL]
SDL_RWtell
( .. )(
)
;
as:"sdl-rwtell";
ordinary primitive SDL_RWtell
an executable word (no special usage info)
or wrapper call around SDL_RWtell
sdl-rwwrite:lib_sdl.1 — ordinary primitive
[SDL]
SDL_RWwrite
( .. )(
)
;
as:"sdl-rwwrite";
ordinary primitive SDL_RWwrite
an executable word (no special usage info)
or wrapper call around SDL_RWwrite
SetError:lib_sdl — ordinary primitive
[SDL]
SDL_SetError
( str-ptr str-len -- )( | ) ; |
; |
set it, based on
void SDL_SetError(const char *fmt, ...);
sdl-true:lib_sdl.1 — ordinary constant
[SDL]
SDL_TRUE
( .. )(
)
;
as:"sdl-true";
( SDL_TRUE ) constant SDL_TRUE
an ordinary constant (no special usage info)
sdl-unlockaudio:lib_sdl.1 — ordinary primitive
[SDL]
SDL_UnLockAudio
( .. )( | ) ; |
; |
ordinary primitive SDL_UnLockAudio
an executable word (no special usage info)
or wrapper call around SDL_UnLockAudio
sdl-unlockaudio:lib_sdl.2 — ordinary primitive
[SDL]
SDL_UnlockAudio
( .. )( | ) ; |
; |
ordinary primitive SDL_UnlockAudio
an executable word (no special usage info)
or wrapper call around SDL_UnlockAudio
minus-back-sdl-version-dot-major:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_version.major
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_version.major
offsetof(SDL_version,major) (no special usage info)
minus-back-sdl-version-dot-minor:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_version.minor
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_version.minor
offsetof(SDL_version,minor) (no special usage info)
minus-back-sdl-version-dot-patch:lib_sdl.1 — ordinary offsetval
[SDL]
->SDL_version.patch
( .. )( | ) ; |
; |
ordinary offsetval ->SDL_version.patch
offsetof(SDL_version,patch) (no special usage info)
sdl-wasinit:lib_sdl.1 — ordinary primitive
[SDL]
SDL_WasInit
( .. )(
)
;
as:"sdl-wasinit";
ordinary primitive SDL_WasInit
an executable word (no special usage info)
or wrapper call around SDL_WasInit
seal:forth_83 — ordinary primitive
FORTH
SEAL
( -- )(
)
;
p4:"seal";
looks through the search-order and kills the ONLY wordset - hence you can't access the primary vocabularies from there.
search:string — ordinary primitive
FORTH
SEARCH
( str-ptr1 str-len1 str-ptr2 str-len2 -- str-ptr1' str-len1' flag )( | ) ; |
; |
search the str-buffer1 for the text of str-buffer2, if it is contained return TRUE and return buffer-values that point to the contained string, otherwise return FALSE and leave the original str-buffer1.
search-minus-also-minus-voc:useful.1 — obsolete forthword
EXTENSIONS
SEARCH-ALSO-VOC
( .. )( | ) ; |
; |
obsolete forthword SEARCH-ALSO-VOC
is doing the same as DEFS-ARE-SEARCHED-ALSO
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
search-minus-loaded:search::environment — constructor primitive
ENVIRONMENT
SEARCH-LOADED
( .. )( | ) ; |
; |
constructor primitive SEARCH-LOADED
an executable word (no special usage info)
or wrapper call around p4_search_init
search-minus-order-minus-ext:search::environment — ordinary constant
ENVIRONMENT
SEARCH-ORDER-EXT
( .. )( | ) ; |
; |
( 1994 ) constant SEARCH-ORDER-EXT
an ordinary constant (no special usage info)
search-wordlist:search — ordinary primitive
FORTH
SEARCH-WORDLIST
( str-ptr str-len voc -- 0 | xt 1 | xt -1 )( | ) ; |
; |
see:tools.1 — ordinary primitive
FORTH
SEE
( .. )(
)
;
as:"see";
ordinary primitive SEE
an executable word (no special usage info)
or wrapper call around p4_see
paren-see:debug.1 — ordinary primitive
FORTH
(SEE)
( .. )(
)
;
as:"paren-see";
ordinary primitive (SEE)
an executable word (no special usage info)
or wrapper call around p4_paren_see
set-blockfile:block_misc — ordinary primitive
EXTENSIONS
SET-BLOCKFILE
( fid -- )win32for( | ) ; |
; |
win32forth uses a system-filedescriptor where -1 means unused in the BLOCKHANDLE, but we use a "FILE*"-like structure, so NULL means NOT-IN-USE. Here we set it.
set-current:search — ordinary primitive
FORTH
SET-CURRENT
( voc -- )(
)
;
p4:"set-current";
set the definition-vocabulary. see DEFINITIONS
set-order:search — ordinary primitive
FORTH
SET-ORDER
( vocn ... voc1 n -- )( | ) ; |
; |
set the search-order -- probably saved beforehand using GET-ORDER
set-minus-precision:floating.1 — ordinary primitive
FORTH
SET-PRECISION
( .. )( | ) ; |
; |
ordinary primitive SET-PRECISION
an executable word (no special usage info)
or wrapper call around p4_set_precision
set-minus-precision:fpnostack.1 — ordinary primitive
EXTENSIONS
SET-PRECISION
( .. )( | ) ; |
; |
ordinary primitive SET-PRECISION
an executable word (no special usage info)
or wrapper call around p4_nofp_set_precision
sf-store:floating.1 — ordinary primitive
FORTH
SF!
( .. )(
)
;
as:"sf-store";
ordinary primitive SF!
an executable word (no special usage info)
or wrapper call around p4_s_f_store
sf-store:fpnostack.1 — ordinary primitive
EXTENSIONS
SF!
( .. )(
)
;
as:"sf-store";
ordinary primitive SF!
an executable word (no special usage info)
or wrapper call around p4_nofp_s_f_store
sf-fetch:floating.1 — ordinary primitive
FORTH
SF@
( .. )(
)
;
as:"sf-fetch";
ordinary primitive SF@
an executable word (no special usage info)
or wrapper call around p4_s_f_fetch
sf-fetch:fpnostack.1 — ordinary primitive
EXTENSIONS
SF@
( .. )(
)
;
as:"sf-fetch";
ordinary primitive SF@
an executable word (no special usage info)
or wrapper call around p4_nofp_s_f_fetch
sfalign:floating.1 — ordinary primitive
FORTH
SFALIGN
( .. )(
)
;
as:"sfalign";
ordinary primitive SFALIGN
an executable word (no special usage info)
or wrapper call around p4_align
sfalign:fpnostack.1 — ordinary primitive
EXTENSIONS
SFALIGN
( .. )(
)
;
as:"sfalign";
ordinary primitive SFALIGN
an executable word (no special usage info)
or wrapper call around p4_align
sfaligned:floating.1 — ordinary primitive
FORTH
SFALIGNED
( .. )(
)
;
as:"sfaligned";
ordinary primitive SFALIGNED
an executable word (no special usage info)
or wrapper call around p4_aligned
sfaligned:fpnostack.1 — ordinary primitive
EXTENSIONS
SFALIGNED
( .. )(
)
;
as:"sfaligned";
ordinary primitive SFALIGNED
an executable word (no special usage info)
or wrapper call around p4_aligned
sfloat-percent:struct.1 — ordinary primitive
EXTENSIONS
SFLOAT%
( .. )(
)
;
as:"sfloat-percent";
ordinary primitive SFLOAT%
an executable word (no special usage info)
or wrapper call around p4_sfloat_mod
sfloat-plus:floating.1 — ordinary primitive
FORTH
SFLOAT+
( .. )(
)
;
as:"sfloat-plus";
ordinary primitive SFLOAT+
an executable word (no special usage info)
or wrapper call around p4_s_float_plus
sfloat-plus:fpnostack.1 — ordinary primitive
EXTENSIONS
SFLOAT+
( .. )(
)
;
as:"sfloat-plus";
ordinary primitive SFLOAT+
an executable word (no special usage info)
or wrapper call around p4_nofp_s_float_plus
sfloats:floating.1 — ordinary primitive
FORTH
SFLOATS
( .. )(
)
;
as:"sfloats";
ordinary primitive SFLOATS
an executable word (no special usage info)
or wrapper call around p4_s_floats
sfloats:fpnostack.1 — ordinary primitive
EXTENSIONS
SFLOATS
( .. )(
)
;
as:"sfloats";
ordinary primitive SFLOATS
an executable word (no special usage info)
or wrapper call around p4_nofp_s_floats
show-minus-status:misc.1 — forthword synonym
FORTH
SHOW-STATUS
( .. )( | ) ; |
; |
forthword synonym SHOW-STATUS
is doing the same as .STATUS
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
show-control-strings:term — ordinary primitive
EXTENSIONS
SHOW-TERM-CONTROLS
( -- )for debugging( | ) ; |
; |
show the current mappings for the terminal output may give hints about what is wrong if the output seems to miss some functionality
show-rawkey-strings:term — ordinary primitive
EXTENSIONS
SHOW-TERM-ESC-KEYS
( -- )for debugging( | ) ; |
; |
show the current mappings for the terminal input may give hints about what is wrong if the input seems to miss some functionality
show-termcap:term — ordinary primitive
EXTENSIONS
SHOW-TERMCAP
( -- )for debugging( | ) ; |
; |
print the termcap strings used for input and output may give hints about what is wrong if the terminal seems to miss some functionality
sign:core — ordinary primitive
FORTH
SIGN
( a -- )(
)
;
p4:"sign";
put the sign of the value into the hold-space, this is the forth-style output formatting, see HOLD
signal:misc — ordinary primitive
FORTH
SIGNAL
( xt1 n -- xt2 )(
)
;
p4:"signal";
install signal handler - return old signal handler
sizeof:struct.1 — compiling primitive
EXTENSIONS
SIZEOF
( "name" -- size )(
)
;
as:"sizeof";
get the size-value from a previous structure definition
: SIZEOF ' >BODY @ STATE @ IF [COMPILE] LITERAL THEN ; IMMEDIATEFCode_XE (p4_sizeof_XT)
skip:toolbelt — ordinary primitive
FORTH
SKIP
( str len char -- str+i len-i )( | ) ; |
; |
Advance past leading characters in the specified string.
: SKIP >R BEGIN DUP WHILE OVER C@ R@ = WHILE 1 /STRING REPEAT THEN R> DROP ;
ie. skip leading characters c
: SKIP >R BEGIN DUP OVER C@ R@ = OR WHILE 1- SWAP 1- SWAP REPEAT R> DROP ;
sliteral:string — compiling primitive
FORTH
SLITERAL
( -- string )(
)
;
p4:"sliteral";
compile-time: ( CS: str-ptr str-len -- )
this word does almost the same as LITERAL - it takes an S" string as specified in the CS-STACK at compile time and compiles into the current definition where it is returned as if there were a direct string-literal. This can be used to compute a string-literal at compile-time and hardwire it.
example: : ORIGINAL-HOME [ $HOME COUNT ] SLITERAL ; ( -- str-ptr str-len )
smart-interpret-store:smart_go — ordinary primitive
EXTENSIONS
SMART-INTERPRET!
( -- )( | ) ; |
; |
smart-interpret-init:smart_go — ordinary primitive
EXTENSIONS
SMART-INTERPRET-INIT
( -- )( | ) ; |
; |
creates a set of interpret-words that are used in the inner interpreter, so if a word is unknown to the interpreter-loop it will use the first char of that word, attach it to an "interpret-" prefix, and tries to use that IMMEDIATE-DEFER-word on the rest of the word. This SMART-INTERPRET-INIT will set up words like interpret-" so you can write <c>"hello"</c> instead of <c>" hello"</c> and it creates interpret-\ so that words like
\if-unix
are ignoring the line if the word
\if-unknown
is unknown in itself. This is usually not activated on startup.
smart-minus-interpret-minus-loaded:smart_go::environment — constructor primitive
ENVIRONMENT
SMART-INTERPRET-LOADED
( .. )( | ) ; |
; |
constructor primitive SMART-INTERPRET-LOADED
an executable word (no special usage info)
or wrapper call around smart_interpret_init
smudge:header.1 — ordinary primitive
EXTENSIONS
SMUDGE
( .. )(
)
;
as:"smudge";
ordinary primitive SMUDGE
an executable word (no special usage info)
or wrapper call around p4_smudge
paren-smudge-sharp:header.1 — obsolete forthword
EXTENSIONS
(SMUDGE#)
( .. )(
)
;
as:"paren-smudge-sharp";
obsolete forthword (SMUDGE#)
is doing the same as SMUDGE-MASK
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
smudge-minus-mask:header.1 — ordinary constant
EXTENSIONS
SMUDGE-MASK
( .. )( | ) ; |
; |
( P4xSMUDGED ) constant SMUDGE-MASK
an ordinary constant (no special usage info)
source:core — ordinary primitive
FORTH
SOURCE
( -- buffer IN-offset )( | ) ; |
; |
the current point of interpret can be gotten through SOURCE. The buffer may flag out TIB or BLK or a FILE and IN gives you the offset therein. Traditionally, if the current SOURCE buffer is used up, REFILL is called that asks for another input-line or input-block. This scheme would have made it impossible to stretch an [IF] ... [THEN] over different blocks, unless [IF] does call REFILL
source-minus-id:core.1 — - loader type P4_DVaL
FORTH
SOURCE-ID
( .. )(
)
;
as:"source-minus-id";
- loader type P4_DVaL SOURCE-ID
input.source_id (no special usage info)
str-sp:dstrings.1 — ordinary primitive
FORTH
$SP
( .. )(
)
;
as:"str-sp";
ordinary primitive $SP
an executable word (no special usage info)
or wrapper call around str_sp
s-p-store:forth_usual — ordinary primitive
FORTH
SP!
( ... addr -- )(
)
;
p4:"s-p-store";
sets the stack pointer, reverse of SP@
str-sp-zero:dstrings.1 — ordinary primitive
FORTH
$SP0
( .. )(
)
;
as:"str-sp-zero";
ordinary primitive $SP0
an executable word (no special usage info)
or wrapper call around str_sp0
s-p-fetch:forth_83 — ordinary primitive
FORTH
SP@
( -- )(
)
;
p4:"s-p-fetch";
the address of the top of stack. Does save it onto the stack. You could do
: DUP SP@ @ ;
slash-str-space:dstrings.1 — ordinary primitive
FORTH
/$SPACE
( .. )(
)
;
as:"slash-str-space";
ordinary primitive /$SPACE
an executable word (no special usage info)
or wrapper call around per_str_space
zero-str-space:dstrings.1 — ordinary primitive
FORTH
0$SPACE
( .. )(
)
;
as:"zero-str-space";
ordinary primitive 0$SPACE
an executable word (no special usage info)
or wrapper call around zero_str_space
slash-str-space-minus-header:dstrings.1 — ordinary primitive
FORTH
/$SPACE-HEADER
( .. )( | ) ; |
; |
ordinary primitive /$SPACE-HEADER
an executable word (no special usage info)
or wrapper call around per_str_space_header
spaces:core — ordinary primitive
FORTH
SPACES
( n -- )(
)
;
p4:"spaces";
print n space to stdout, actually a loop over n calling SPACE , but the implemenation may take advantage of printing chunks of spaces to speed up the operation.
span:core.1 — threadstate variable
FORTH
SPAN
( .. )(
)
;
as:"span";
threadstate variable SPAN
span (no special usage info)
div-split:toolbelt — ordinary primitive
FORTH
/SPLIT
( a m a+i m-i -- a+i m-i a i )( | ) ; |
; |
Split a character string _a m_ at place given by _a+i m-i_. Called "cut-split" because "slash-split" is a tongue twister.
: /SPLIT DUP >R 2SWAP R> - ;
split-next-line:toolbelt — ordinary primitive
FORTH
SPLIT-NEXT-LINE
( src . -- src' . str len )( | ) ; |
; |
Split the next line from the string.
: SPLIT-NEXT-LINE 2DUP #EOL-CHAR SCAN DUP >R 1 /STRING 2SWAP R> - ;
FIXME: inform Neil Bawd that this is probably not what he wanted. replace /STRING with /SPLIT here.
sprintf:useful.1 — obsolete forthword
EXTENSIONS
SPRINTF
( .. )(
)
;
as:"sprintf";
obsolete forthword SPRINTF
is doing the same as PFE-SPRINTF
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
spy-minus-enter:with_spy.1 — - loader type P4_DVaL
EXTENSIONS
SPY-ENTER
( .. )(
)
;
as:"spy-minus-enter";
- loader type P4_DVaL SPY-ENTER
spy_enter (no special usage info)
spy-minus-leave:with_spy.1 — - loader type P4_DVaL
EXTENSIONS
SPY-LEAVE
( .. )(
)
;
as:"spy-minus-leave";
- loader type P4_DVaL SPY-LEAVE
spy_leave (no special usage info)
spy-off:with_spy — ordinary primitive
EXTENSIONS
SPY_OFF
( -- )(
)
;
p4:"spy-off";
disable SPY_ON nest-trace.
Q-stack:tools_misc — ordinary primitive
FORTH
?STACK
( -- )(
)
;
p4:"Q-stack";
check all stacks for underflow and overflow conditions, and if such an error condition is detected THROW
stack-minus-cells:core::environment — ordinary primitive
ENVIRONMENT
STACK-CELLS
( .. )( | ) ; |
; |
ordinary primitive STACK-CELLS
an executable word (no special usage info)
or wrapper call around p__stack_cells
start-Q-cr:misc — ordinary primitive
FORTH
START?CR
( -- )(
)
;
p4:"start-Q-cr";
initialized for more-like effect - see ?CR
starts-Q:toolbelt — ordinary primitive
FORTH
STARTS?
( str len pattern len2 -- str len flag )( | ) ; |
; |
Check start of string.
: STARTS? DUP >R 2OVER R> MIN COMPARE 0= ;
state:core.1 — threadstate variable
FORTH
STATE
( .. )(
)
;
as:"state";
threadstate variable STATE
state (no special usage info)
dot-status:misc — ordinary primitive
FORTH
.STATUS
( -- )(
)
;
p4:"dot-status";
display internal variables
: .STATUS .VERSION .CVERSION .MEMORY .SEARCHPATHS .DICTVARS .REGSUSED ;
stderr:misc.1 — - loader type P4_DVaL
FORTH
STDERR
( .. )(
)
;
as:"stderr";
- loader type P4_DVaL STDERR
stdErr (no special usage info)
stdin:misc.1 — - loader type P4_DVaL
FORTH
STDIN
( .. )(
)
;
as:"stdin";
- loader type P4_DVaL STDIN
stdIn (no special usage info)
stdout:misc.1 — - loader type P4_DVaL
FORTH
STDOUT
( .. )(
)
;
as:"stdout";
- loader type P4_DVaL STDOUT
stdOut (no special usage info)
Q-stop:misc — ordinary primitive
FORTH
?STOP
( -- flag )(
)
;
p4:"Q-stop";
check for 'q' pressed - see ?CR
slash-string:string — ordinary primitive
FORTH
/STRING
( str-ptr str-len n -- str-ptr' str-len' )( | ) ; |
; |
shorten the buffer from the beginning by n characters, i.e.
str-ptr += n ; str-len -= n;
string-comma:core_misc — ordinary primitive
FORTH
STRING,
( str len -- )(
)
;
p4:"string-comma";
Store a string in data space as a counted string.
: STRING, HERE OVER 1+ ALLOT PLACE ;
string-comma:toolbelt — ordinary primitive
FORTH
STRING,
( str len -- )(
)
;
p4:"string-comma";
Store a string in data space as a counted string.
: STRING, HERE OVER 1+ ALLOT PLACE ;
string-minus-ext:string::environment — ordinary constant
ENVIRONMENT
STRING-EXT
( .. )(
)
;
as:"string-minus-ext";
( 1994 ) constant STRING-EXT
an ordinary constant (no special usage info)
zero-strings:dstrings — ordinary primitive
FORTH
0STRINGS
( -- )(
)
;
p4:"zero-strings";
Set all string variables holding bound string values in string space to the empty string, and clear string space, including the string buffer, string stack, and string stack frames. <ansref>"zero-strings"</ansref>
NOTE: If used for under the hood development, this word must be executed only when string space is in a valid state.
struct:struct — ordinary primitive
EXTENSIONS
STRUCT
( "name" -- here zero-offset )( | ) ; |
; |
begin definition of a new structure (mpe.000)
: STRUCT CREATE !CSP HERE 0 DUP , DOES> @ ;
struct-colon:structs.1 — ordinary primitive
EXTENSIONS
STRUCT:
( .. )(
)
;
as:"struct-colon";
ordinary primitive STRUCT:
an executable word (no special usage info)
or wrapper call around p4_field
structure:struct.1 — definining primitive
EXTENSIONS
STRUCTURE
( "name" -- here zero-offset )exec( | ) ; |
; |
start a structure definition
: STRUCTURE: CREATE !CSP HERE 0 DUP , DOES> CREATE @ ALLOT ;FCode_RT (p4_structure_RT)
semicolon-structure:structs.1 — ordinary primitive
EXTENSIONS
;STRUCTURE
( .. )( | ) ; |
; |
ordinary primitive ;STRUCTURE
an executable word (no special usage info)
or wrapper call around p4_endstructure
structure-colon:structs.1 — ordinary primitive
EXTENSIONS
STRUCTURE:
( .. )(
)
;
as:"structure-colon";
ordinary primitive STRUCTURE:
an executable word (no special usage info)
or wrapper call around p4_structure
subrecord:struct — ordinary primitive
EXTENSIONS
SUBRECORD
( outer-offset "name" -- outer-offset here zero-offset )( | ) ; |
; |
begin definition of a subrecord (mpe.000)
: STRUCT CREATE HERE 0 DUP , DOES> @ ;
str-swap:dstrings.1 — ordinary primitive
FORTH
$SWAP
( .. )(
)
;
as:"str-swap";
ordinary primitive $SWAP
an executable word (no special usage info)
or wrapper call around p4_str_swap
swap:core — ordinary primitive
FORTH
SWAP
( a b -- b a )(
)
;
p4:"swap";
exchanges the value on top of the stack with the value beneath it
synonym:header — definining primitive
EXTENSIONS
SYNONYM
( "newname" "oldname" -- )( | ) ; |
; |
make an name-alias for a word - this is very different from a DEFER since a DEFER will resolve at runtime. Changing the target of a DEFER via IS will result in changing the BEHAVIOR of all words defined earlier and containing the name of the DEFER.
A SYNONYM however does not have any data field (theoretically not even an execution token), instead it gets resolved at compile time. In theory, you can try to FIND the name of the SYNONYM but as soon as you apply NAME> the execution token of the end-point is returned. This has also the effect that using the inverse ">NAME" operation will result in the name-token of the other name.
SYNONYM CREATE <BUILDS ( like it is in ANS Forth ) : FOO CREATE DOES> @ ; SEE FOO : foo <builds does> @ ; SYNONYM CREATE CREATE: : BAR CREATE 10 ALLOT ; SEE BAR : bar create: 10 allot ;
synonym-minus-obsoleted:header.1 — definining primitive
EXTENSIONS
SYNONYM-OBSOLETED
( .. )( | ) ; |
; |
definining primitive SYNONYM-OBSOLETED
an executable word (no special usage info)
or wrapper call around p4_obsoleted
system:misc — ordinary primitive
FORTH
SYSTEM
( addr u -- ret-val )(
)
;
p4:"system";
run a shell command (note: embedded systems have no shell)
system-quote:misc — compiling primitive
FORTH
SYSTEM"
( [commandline<">] -- ret-val )obsolete( | ) ; |
; |
system-minus-ext:system::environment — ordinary constant
ENVIRONMENT
SYSTEM-EXT
( .. )(
)
;
as:"system-minus-ext";
( 1983 ) constant SYSTEM-EXT
an ordinary constant (no special usage info)
s-backslash-quote:zchar.1 — compiling primitive
FORTH
S\"
( .. )(
)
;
as:"s-backslash-quote";
compiling primitive S\"
an executable word (no special usage info)
or wrapper call around p4_s_backslash_quote
tab:misc — ordinary primitive
FORTH
TAB
( n -- )(
)
;
p4:"tab";
jump to next column divisible by n
sharp-tab-minus-char:toolbelt.1 — ordinary constant
FORTH
#TAB-CHAR
( .. )( | ) ; |
; |
( '\t' ) constant #TAB-CHAR
an ordinary constant (no special usage info)
question-terminal:forth_83.1 — ordinary primitive
FORTH
?TERMINAL
( .. )(
)
;
as:"question-terminal";
ordinary primitive ?TERMINAL
an executable word (no special usage info)
or wrapper call around p4_key_question
terminal-answer-link:host_k12 — ordinary primitive
EXTENSIONS
TERMINAL-ANSWER-LINK
( -- sap#* )( | ) ; |
; |
send terminal-output as a data-message to the specified link sap. Unlike TERMINAL-OUTPUT-LINE the data-messages are in line-mode. The flushed characters are buffered until a non-printable character is seen. This is somewhat more useful when treating pfe as a print service and testing machine, but can not provide for interactivity.
60 TERMINAL-ANSWER-LINK ! ... TERMINAL-ANSWER-LINK OFF
terminal-emulation-state:host_k12 — ordinary primitive
EXTENSIONS
TERMINAL-EMULATION-STATE
( -- state* )( | ) ; |
; |
returns the address of the emulations state variable so it can be read and explicitly changed to another value from forth text. This is a very questionable thing to do as the emulation-state is actually an enumerated value, the ESE will just show question-marks setting this variable to something not understood.
terminal-input-link:host_k12 — ordinary primitive
EXTENSIONS
TERMINAL-INPUT-LINK
( -- sap#* )( | ) ; |
; |
let the forth stdin-handling look for data-messages on this link too. These will be interpreted like messages that come from the interactive forth terminal. This can be used in an embedded systems for a terminal session simulation. setting zero-sap will disable interpreting these incoming data-frames as keyboard-strings (so that the zero sap is therefore not usable for an input-link!). The startup default is zero.
60 TERMINAL-INPUT-LINK ! ... TERMINAL-INPUT-LINK OFF
terminal-output-link:host_k12 — ordinary primitive
EXTENSIONS
TERMINAL-OUTPUT-LINK
( -- sap#* )( | ) ; |
; |
send terminal-output as a data-message to the specified link sap. This can be used in an embedded systems for a terminal session simulation. setting zero-sap will disable sending message-frames (the zero sap is therefore not usable for output-to-link). The startup default is zero.
60 TERMINAL-OUTPUT-LINK ! ... TERMINAL-OUTPUT-LINK OFF
tick-th:toolbelt — compiling primitive
FORTH
'th
( n "addr" -- &addr[n] )( | ) ; |
; |
Address `n CELLS addr +`.
: 'th ( n "addr" -- &addr[n] ) S" 2 LSHIFT " EVALUATE BL WORD COUNT EVALUATE S" + " EVALUATE ; IMMEDIATE
th-pocket:misc — ordinary primitive
FORTH
TH'POCKET
( n -- addr u )(
)
;
p4:"th-pocket";
returns the specified pocket as a S" string reference
bracket-then:tools.1 — immediate primitive
FORTH
[THEN]
( .. )(
)
;
as:"bracket-then";
immediate primitive [THEN]
an executable word (no special usage info)
or wrapper call around p4_noop
third:toolbelt — ordinary primitive
FORTH
THIRD
( x y z -- x y z x )(
)
;
p4:"third";
Copy third element on the stack onto top of stack.
: THIRD 2 PICK ;
throw:exception — ordinary primitive
FORTH
THROW
( n -- )(
)
;
p4:"throw";
raise an exception - it will adjust the depth of all stacks and start interpreting at the point of the latest CATCH <br> if n is null nothing happens, the -1 (ie. FALSE ) is the raise-code of ABORT - the other codes are implementation dependent and will result in something quite like ABORT
thru:block — ordinary primitive
FORTH
THRU
( u1 u2 -- )(
)
;
p4:"thru";
LOAD a number of block in sequence.
tib:core.1 — - loader type P4_DVaL
FORTH
TIB
( .. )(
)
;
as:"tib";
- loader type P4_DVaL TIB
input.tib (no special usage info)
sharp-tib:core.1 — threadstate variable
FORTH
#TIB
( .. )(
)
;
as:"sharp-tib";
threadstate variable #TIB
input.number_tib (no special usage info)
time-and-date:facility.1 — ordinary primitive
FORTH
TIME&DATE
( .. )(
)
;
as:"time-and-date";
ordinary primitive TIME&DATE
an executable word (no special usage info)
or wrapper call around p4_time_and_date
toggle:forth_usual — ordinary primitive
FORTH
TOGGLE
( c-addr charmask -- )( | ) ; |
; |
toggle the bits given in charmask, see also SMUDGE and = UNSMUDGE
example: the fig-style SMUDGE had been defined such : FIG-SMUDGE LATEST >FFA (SMUDGE#) TOGGLE ;
toolbelt-minus-ext:toolbelt::environment — ordinary constant
ENVIRONMENT
TOOLBELT-EXT
( .. )( | ) ; |
; |
( 1999 ) constant TOOLBELT-EXT
an ordinary constant (no special usage info)
tools-minus-ext:tools::environment — ordinary constant
ENVIRONMENT
TOOLS-EXT
( .. )(
)
;
as:"tools-minus-ext";
( 1994 ) constant TOOLS-EXT
an ordinary constant (no special usage info)
topmost:misc — ordinary primitive
FORTH
TOPMOST
( wid -- a-addr )(
)
;
p4:"topmost";
that last valid word in the specified vocabulary
touch:shell.1 — compiling primitive
EXTENSIONS
TOUCH
( .. )(
)
;
as:"touch";
compiling primitive TOUCH
an executable word (no special usage info)
or wrapper call around p4_touch
toupper:forth_usual — ordinary primitive
FORTH
TOUPPER
( c1 -- c2 )(
)
;
p4:"toupper";
convert a single character to upper case
: TOUPPER >R _toupper ;
dash-trailing:string — ordinary primitive
FORTH
-TRAILING
( str-ptr str-len -- str-ptr str-len' )( | ) ; |
; |
check the given buffer if it contains whitespace at its end. If so, shorten str-len to meet the last non-whitespace character in the buffer.
trim:toolbelt — ordinary primitive
FORTH
TRIM
( str len -- str len-i )(
)
;
p4:"trim";
Trim white space from end of string.
: TRIM BEGIN DUP WHILE 1- 2DUP + C@ IS-WHITE NOT UNTIL 1+ THEN ;
true:core.1 — ordinary constant
FORTH
TRUE
( .. )(
)
;
as:"true";
( P4_TRUE ) constant TRUE
an ordinary constant (no special usage info)
str-tuck:dstrings — ordinary primitive
FORTH
$TUCK
($: a$ b$ -- b$ a$ b$ )( | ) ; |
; |
Copy the top string stack item just below the second item. The string value is not copied. <ansref>"string-tuck"</ansref>
NOTE: Because of essential string space bookkeeping, the system level implementation can be little more efficient than the high-level definition:
: $TUCK $SWAP $OVER ;
str-type:dstrings.1 — ordinary primitive
FORTH
$TYPE
( .. )(
)
;
as:"str-type";
ordinary primitive $TYPE
an executable word (no special usage info)
or wrapper call around p4_str_dot
paren-type:misc.1 — ordinary primitive
FORTH
(TYPE)
( .. )(
)
;
as:"paren-type";
ordinary primitive (TYPE)
an executable word (no special usage info)
or wrapper call around p4_paren_type
star-type-star:misc.1 — threadstate variable
FORTH
*TYPE*
( .. )(
)
;
as:"star-type-star";
threadstate variable *TYPE*
type (no special usage info)
u-dot:core.1 — ordinary primitive
FORTH
U.
( .. )(
)
;
as:"u-dot";
ordinary primitive U.
an executable word (no special usage info)
or wrapper call around p4_u_dot
u-dot-r:core — ordinary primitive
FORTH
U.R
( value prec -- )(
)
;
p4:"u-dot-r";
print right-aligned in a prec-field, treat value to be unsigned as opposed to .R
u-less-than:core — ordinary primitive
FORTH
U<
( a b -- cond )(
)
;
p4:"u-less-than";
unsigned comparison, see <
u-less-equal:core_misc — ordinary primitive
FORTH
U<=
( a b -- flag )(
)
;
p4:"u-less-equal";
simulate : U<= U> 0= ;
u-greater-than:core — ordinary primitive
FORTH
U>
( a b -- ab )(
)
;
p4:"u-greater-than";
unsigned comparison of a and b, see >
u-greater-equal:core_misc — ordinary primitive
FORTH
U>=
( a b -- flag )(
)
;
p4:"u-greater-equal";
simulate : U>= U< 0= ;
u-d-dot:misc — ordinary primitive
FORTH
UD.
( 2val -- )(
)
;
p4:"u-d-dot";
see also UD.R
getuid:shell — ordinary primitive
EXTENSIONS
$UID
( -- val )(
)
;
p4:"getuid";
calls system's
getuid
u-m-star:core — ordinary primitive
FORTH
UM*
( a b -- c,c )(
)
;
p4:"u-m-star";
unsigned multiply returning double-cell value
umask:shell — ordinary primitive
EXTENSIONS
UMASK
( val -- ret )(
)
;
p4:"umask";
calls system's
umask
u-max:core_misc — ordinary primitive
FORTH
UMAX
( a b -- max )(
)
;
p4:"u-max";
see MAX
undefined:core_misc — immediate primitive
FORTH
[UNDEFINED]
( [name] -- flag )( | ) ; |
; |
Search the dictionary for _name_. If _name_ is found, return FALSE; otherwise return TRUE. Immediate for use in definitions.
see [DEFINED]
: [UNDEFINED] DEFINED 0= ; IMMEDIATE
undefined:toolbelt — immediate primitive
FORTH
[UNDEFINED]
( [name] -- flag )( | ) ; |
; |
Search the dictionary for _name_. If _name_ is found, return FALSE; otherwise return TRUE. Immediate for use in definitions.
see [DEFINED]
: [UNDEFINED] DEFINED 0= ; IMMEDIATE
undefined:tools_misc — immediate primitive
FORTH
[UNDEFINED]
( [name] -- flag )( | ) ; |
; |
Search the dictionary for _name_. If _name_ is found, return FALSE; otherwise return TRUE. Immediate for use in definitions.
see [DEFINED]
: [UNDEFINED] DEFINED 0= ; IMMEDIATE
under-plus:misc — ordinary primitive
FORTH
UNDER+
( n1 n2 -- n1+n2 n2 )( | ) ; |
; |
quicker than
: UNDER+ TUCK + SWAP ;
dot-underline:term.1 — ordinary primitive
EXTENSIONS
.UNDERLINE
( .. )(
)
;
as:"dot-underline";
ordinary primitive .UNDERLINE
an executable word (no special usage info)
or wrapper call around p4_dot_underline
dot-underline-dot-off:term.1 — ordinary primitive
EXTENSIONS
.UNDERLINE.OFF
( .. )( | ) ; |
; |
ordinary primitive .UNDERLINE.OFF
an executable word (no special usage info)
or wrapper call around p4_dot_underline_off
unsmudge:header.1 — obsolete forthword
EXTENSIONS
UNSMUDGE
( .. )(
)
;
as:"unsmudge";
obsolete forthword UNSMUDGE
is doing the same as REVEAL
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
str-unused:dstrings.1 — ordinary primitive
FORTH
$UNUSED
( .. )(
)
;
as:"str-unused";
ordinary primitive $UNUSED
an executable word (no special usage info)
or wrapper call around p4_str_unused
unused:core — ordinary primitive
FORTH
UNUSED
( -- val )(
)
;
p4:"unused";
return the number of cells that are left to be used above HERE
upc:forth_usual.1 — obsolete forthword
EXTENSIONS
UPC
( .. )(
)
;
as:"upc";
obsolete forthword UPC
is doing the same as TOUPPER
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
update:block — ordinary primitive
FORTH
UPDATE
( -- )(
)
;
p4:"update";
mark the current block buffer as modified, see FLUSH
upper:forth_usual — ordinary primitive
FORTH
UPPER
( addr cnt -- )(
)
;
p4:"upper";
convert string to upper case
simulate: : UPPER 0 DO DUP I + DUP C@ UPC SWAP C! LOOP DROP ;
upper-minus-case-question:misc.1 — - loader type P4_DVaL
FORTH
UPPER-CASE?
( .. )( | ) ; |
; |
- loader type P4_DVaL UPPER-CASE?
wordl_flag (no special usage info)
store-use:useful.1 — forthword synonym
EXTENSIONS
!USE
( .. )(
)
;
as:"store-use";
forthword synonym !USE
is doing the same as TRUE
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
uselibrary:dlfcn.1 — ordinary primitive
EXTENSIONS
USELIBRARY
( .. )(
)
;
as:"uselibrary";
ordinary primitive USELIBRARY
an executable word (no special usage info)
or wrapper call around p4_uselibrary
user:shell — ordinary primitive
EXTENSIONS
$USER
( -- str-ptr str-len )(
)
;
p4:"user";
calls system's
getenv(USER)
using:block_misc — ordinary primitive
EXTENSIONS
USING
( 'filename' -- )obsolete( | ) ; |
; |
use filename as a block file OBSOLETE!! use OPEN-BLOCKFILE
using-new:block_misc — ordinary primitive
EXTENSIONS
USING-NEW
( 'filename' -- )obsolete( | ) ; |
; |
like USING but can create the file OBSOLETE!! use CREATE-BLOCKFILE
str-variable:dstrings — ordinary primitive
FORTH
$VARIABLE
( "name" -- )( | ) ; |
; |
"name" execution: ( -- dfa )
Create an ordinary Forth variable and initialize it to the address of a fixed, external, measured representation of the empty string, such as that pushed onto the string stack by EMPTY$. <ansref>"string-variable"</ansref>"
variant:struct — ordinary primitive
EXTENSIONS
VARIANT
( outer-offset "name" -- outer-offset here zero-offset )( | ) ; |
; |
Variant records describe an alternative view of the current record or subrecord from the start to the current point. The variant need not be of the same length, but the larger is taken
: VARIANT SUBRECORD ;
dot-version:core_misc — ordinary primitive
FORTH
.VERSION
( -- )(
)
;
p4:"dot-version";
show the version of the current PFE system
: .VERSION [ ENVIRONMENT ] FORTH-NAME TYPE FORTH-VERSION TYPE ;
view-next-line:toolbelt — ordinary primitive
FORTH
VIEW-NEXT-LINE
( src . str len -- src . str len str2 len2 )( | ) ; |
; |
Copy next line above current line.
: VIEW-NEXT-LINE 2OVER 2DUP #EOL-CHAR SCAN NIP - ;
vlist:tools_misc — ordinary primitive
FORTH
VLIST
( -- )(
)
;
p4:"vlist";
The VLIST command had been present in FIG and other forth implementations. It has to list all accessible words. In PFE it list all words in the search order. Well, the point is, that we do really just look into the search order and are then calling WORDS on that Wordl. That way you can see all accessible words in the order they might be found. Uses ?CR
vocabulary:forth_83 — ordinary primitive
FORTH
VOCABULARY
( 'name' -- )(
)
;
p4:"vocabulary";
create a vocabulary of that name. If the named vocabulary is called later, it will run ((VOCABULARY)) , thereby putting it into the current search order. Special pfe-extensions are accessible via CASE-SENSITIVE-VOC and SEARCH-ALSO-VOC
simulate: : VOCABULARY CREATE ALLOT-WORDLIST DOES> ( the ((VOCABULARY)) runtime ) CONTEXT ! ; IMMEDIATE
vocabulary:forth_usual — ordinary primitive
FORTH
VOCABULARY
( 'name' -- )(
)
;
p4:"vocabulary";
create a vocabulary of that name. If the named vocabulary is called later, it will run ((VOCABULARY)) , thereby putting it into the current search order. Special pfe-extensions are accessible via CASE-SENSITIVE-VOC and SEARCH-ALSO-VOC
simulate: : VOCABULARY CREATE ALLOT-WORDLIST DOES> ( the ((VOCABULARY)) runtime ) CONTEXT ! ; IMMEDIATE
vocabulary:toolbelt — ordinary primitive
FORTH
VOCABULARY
( 'name' -- )(
)
;
p4:"vocabulary";
create a vocabulary of that name. If the named vocabulary is called later, it will run ((VOCABULARY)) , thereby putting it into the current search order. Special pfe-extensions are accessible via CASE-SENSITIVE-VOC and SEARCH-ALSO-VOC
simulate: : VOCABULARY CREATE ALLOT-WORDLIST DOES> ( the ((VOCABULARY)) runtime ) CONTEXT ! ; IMMEDIATE
vocabulary-tick:useful.1 — obsolete forthword
EXTENSIONS
VOCABULARY'
( .. )(
)
;
as:"vocabulary-tick";
obsolete forthword VOCABULARY'
is doing the same as [VOCABULARY]
This word should be replaced. It will be deleted in the near future. Instead use the (newer) synonym word given above.
bracket-vocabulary:useful — ordinary primitive
EXTENSIONS
[VOCABULARY]
( "name" -- )( | ) ; |
; |
create an immediate vocabulary. Provides for basic modularization.
: [VOCABULARY] VOCABULARY IMMEDIATE ;
vocs:forth_usual — ordinary primitive
FORTH
VOCS
( -- )(
)
;
p4:"vocs";
list all vocabularies in the system
simulate: : VOCS VOC-LINK @ BEGIN DUP WHILE DUP ->WORDLIST.NAME @ ID. ->WORDLIST.LINK @ REPEAT DROP ;
bracket-void:core_misc.1 — immediate constant
FORTH
[VOID]
( .. )(
)
;
as:"bracket-void";
( 0 ) constant [VOID]
an immediate constant (no special usage info)
bracket-void:toolbelt.1 — immediate constant
FORTH
[VOID]
( .. )(
)
;
as:"bracket-void";
( 0 ) constant [VOID]
an immediate constant (no special usage info)
bracket-void:tools_misc.1 — immediate constant
FORTH
[VOID]
( .. )(
)
;
as:"bracket-void";
( 0 ) constant [VOID]
an immediate constant (no special usage info)
w-store:misc — ordinary primitive
FORTH
W!
( w-val addr -- )(
)
;
p4:"w-store";
store a 2byte-val at addressed 2byte-value
w-plus-store:misc — ordinary primitive
FORTH
W+!
( w-val addr -- )(
)
;
p4:"w-plus-store";
add a 2byte-val to addressed 2byte-value
w-slash-o:file.1 — ordinary constant
FORTH
W/O
( .. )(
)
;
as:"w-slash-o";
( FMODE_WO ) constant W/O
an ordinary constant (no special usage info)
w-fetch:misc — ordinary primitive
FORTH
W@
( addr -- w-val )(
)
;
p4:"w-fetch";
fetch a 2byte-val from address
warranty:core_misc — ordinary primitive
FORTH
WARRANTY
( -- )(
)
;
p4:"warranty";
show a warranty info - the basic PFE system is licensed under the terms of the LGPL (Lesser GNU Public License) - which exludes almost any liabilities whatsoever - however loadable binary modules may hook into the system and their functionality may have different WARRANTY infos.
slash-wchar:useful.1 — ordinary constant
EXTENSIONS
/WCHAR
( .. )(
)
;
as:"slash-wchar";
( sizeof(short) ) constant /WCHAR
an ordinary constant (no special usage info)
wchar-percent:struct.1 — ordinary primitive
EXTENSIONS
WCHAR%
( .. )(
)
;
as:"wchar-percent";
ordinary primitive WCHAR%
an executable word (no special usage info)
or wrapper call around p4_wchar_mod
wchar-colon:structs.1 — ordinary primitive
EXTENSIONS
WCHAR:
( .. )(
)
;
as:"wchar-colon";
ordinary primitive WCHAR:
an executable word (no special usage info)
or wrapper call around p4_wchar_colon
wchars-colon:structs.1 — ordinary primitive
EXTENSIONS
WCHARS:
( .. )(
)
;
as:"wchars-colon";
ordinary primitive WCHARS:
an executable word (no special usage info)
or wrapper call around p4_wchars_colon
sharp-with-minus-fig:useful.1 — ordinary constant
EXTENSIONS
#WITH-FIG
( .. )( | ) ; |
; |
( PFE_WITH_FIG+100 ) constant #WITH-FIG
an ordinary constant (no special usage info)
sharp-with-minus-no-minus-ffa:useful.1 — ordinary constant
EXTENSIONS
#WITH-NO-FFA
( .. )( | ) ; |
; |
( WITH_NO_FFA+100 ) constant #WITH-NO-FFA
an ordinary constant (no special usage info)
within:core — ordinary primitive
FORTH
WITHIN
( a b c -- cond )(
)
;
p4:"within";
a widely used word, returns ( b <= a && a < c ) so that is very useful to check an index a of an array to be within range b to c
wl-hash:misc — ordinary primitive
FORTH
WL-HASH
( c-addr n1 -- n2 )(
)
;
p4:"wl-hash";
calc hash-code for selection of thread in a threaded-vocabulary
to-wordlist:forth_usual — ordinary primitive
EXTENSIONS
>WORDLIST
( xt -- wordl* )( | ) ; |
; |
convert a VOCABULARY-xt into its wordlist reference (as in win32forth)
wordlist:search — ordinary primitive
FORTH
WORDLIST
( -- voc )(
)
;
p4:"wordlist";
return a new vocabulary-body for private definitions.
dot-words:chainlist — ordinary primitive
EXTENSIONS
.WORDS
( wordlist* -- )(
)
;
p4:"dot-words";
print the WORDLIST interactivly to the user
: .WORDS ALSO SET-CONTEXT WORDS PREVIOUS ;
WORDS / ORDER / NEW-WORDLIST / DO-ALL-WORDS
words:tools — ordinary primitive
FORTH
WORDS
( -- )(
)
;
p4:"words";
uses CONTEXT and lists the words defined in that vocabulary. usually the vocabulary to list is named directly in before.
example: FORTH WORDS or LOADED WORDS
write-file:file — ordinary primitive
FORTH
WRITE-FILE
( str-adr str-len file -- code )( | ) ; |
; |
write characters from the string buffer to a file, returns a status code.
write-line:file — ordinary primitive
FORTH
WRITE-LINE
( str-adr str-len file -- code )( | ) ; |
; |
write characters from the string buffer to a file, and add the line-terminator to the end of it. returns a status code.
wsize:misc.1 — forthword synonym
FORTH
WSIZE
( .. )(
)
;
as:"wsize";
forthword synonym WSIZE
is doing the same as /CELL
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
x-quote:useful — compiling primitive
EXTENSIONS
X"
( "hex-q" -- bstring )(
)
;
p4:"x-quote";
places a counted string on stack containing bytes specified by hex-string - the hex string may contain spaces which will delimit the bytes
example: X" 41 42 4344" COUNT TYPE ( shows ABCD )
xdo-minus-chain:chain.1 — forthword synonym
EXTENSIONS
xdo-chain
( .. )(
)
;
as:"xdo-minus-chain";
forthword synonym xdo-chain
is doing the same as do-chain
this word is provided only for compatibility with common forth usage in programs. Thegiven synonym should be preferred however.
xmax:term.1 — threadstate variable
EXTENSIONS
XMAX
( .. )(
)
;
as:"xmax";
threadstate variable XMAX
xmax (no special usage info)
xor:core — ordinary primitive
FORTH
XOR
( a b -- ab )(
)
;
p4:"xor";
return the bitwise-or of the two arguments - it may be unsafe use it on logical values. beware.
question-xy:term — ordinary primitive
EXTENSIONS
?XY
( -- x y )(
)
;
p4:"question-xy";
returns the cursor position on screen, on a real unix system this includes a special call to the screen driver, in remote systems this can be the expected position as seen on the client side's terminal driver.
ymax:term.1 — threadstate variable
EXTENSIONS
YMAX
( .. )(
)
;
as:"ymax";
threadstate variable YMAX
ymax (no special usage info)
zchar-minus-ext:zchar::environment — ordinary constant
ENVIRONMENT
ZCHAR-EXT
( .. )(
)
;
as:"zchar-minus-ext";
( 2000 ) constant ZCHAR-EXT
an ordinary constant (no special usage info)
plus-zplace:zchar.1 — ordinary primitive
FORTH
+ZPLACE
( .. )(
)
;
as:"plus-zplace";
ordinary primitive +ZPLACE
an executable word (no special usage info)
or wrapper call around p4_appendz