FORTH
FORTH ok
no special info, see general notes
misc ordinary primitive
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 ;
|
misc ordinary primitive
FORTH LIT
no special info, see general notes
misc ordinary primitive
misc ordinary primitive
Promiscuous variable.
VARIABLE OUT
|
misc threadstate variable
FORTH DP
no special info, see general notes
misc threadstate variable
FORTH HLD
no special info, see general notes
misc threadstate variable
FORTH R0
no special info, see general notes
misc threadstate variable
FORTH S0
no special info, see general notes
misc threadstate variable
misc ordinary primitive
misc ordinary primitive
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
|
misc ordinary primitive
misc forthword synonym
misc ordinary primitive
returns random number with 0 <= n2 < n1)
: RANDOM ?DUP IF _random SWAP MOD ELSE _random THEN ;
|
misc ordinary primitive
misc ordinary primitive
quicker than
: UNDER+ TUCK + SWAP ;
|
misc ordinary primitive
misc compiling primitive
writes X, n1, ... nX into the dictionary -
returns product n1 * n2 * ... * nX
|
misc ordinary primitive
misc ordinary primitive
display internal variables
: .STATUS .VERSION .CVERSION .MEMORY .SEARCHPATHS .DICTVARS .REGSUSED ;
|
misc ordinary primitive
FORTH SHOW-STATUS
no special info, see general notes
misc forthword synonym
FORTH LOWER-CASE@
no special info, see general notes
misc loader code P4_DVaL
Call to enable lower-case symbols as input, supersedes the plain
variable LOWER-CASE
: LOWER-CASE! LOWER-CASE ! ;
: LOWER-CASE! TO LOWER-CASE@ ;
|
misc threadstate valueSET
FORTH LOWER-CASE
no special info, see general notes
misc threadstate variable
FORTH LOWER-CASE-FN@
no special info, see general notes
misc loader code P4_DVaL
Call to enable lower-case symbols as input, supersedes the plain
variable LOWER-CASE-FN
: LOWER-CASE-FN! LOWER-CASE-FN ! ;
: LOWER-CASE-FN! TO LOWER-CASE-FN@ ;
|
misc threadstate valueSET
FORTH LOWER-CASE-FN
no special info, see general notes
misc threadstate variable
FORTH REDEFINED-MSG@
no special info, see general notes
misc loader code P4_DVaL
Call to enable warnings if creating symbols being in the ORDER
- supersedes the plain variable REDEFINED-MSG
: REDEFINED-MSG! REDEFINED-MSG ! ;
: REDEFINED-MSG! TO REDEFINED-MSG@ ;
|
misc threadstate valueSET
FORTH REDEFINED-MSG
no special info, see general notes
misc threadstate variable
FORTH QUOTED-PARSE*
no special info, see general notes
misc threadstate variable
FORTH QUOTED-PARSE@
no special info, see general notes
misc loader code P4_DVaL
FORTH QUOTED-PARSE!
no special info, see general notes
misc threadstate valueSET
misc ordinary primitive
returns the specified pocket as a S" string reference
|
misc ordinary primitive
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
;
|
misc ordinary primitive
P4_OCoN ("/CELL"
, sizeof (p4cell)),
FORTH WSIZE
no special info, see general notes
misc forthword synonym
fetch a 2byte-val from address
|
misc ordinary primitive
store a 2byte-val at addressed 2byte-value
|
misc ordinary primitive
add a 2byte-val to addressed 2byte-value
|
misc ordinary primitive
calc hash-code for selection of thread
in a threaded-vocabulary
|
misc ordinary primitive
that last valid word in the specified vocabulary
|
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
jump to next column divisible by n
|
misc ordinary primitive
misc ordinary primitive
check for 'q' pressed
- see ?CR
|
misc ordinary primitive
initialized for more-like effect
- see ?CR
|
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
misc ordinary primitive
FORTH *EMIT*
no special info, see general notes
misc threadstate variable
FORTH *EXPECT*
no special info, see general notes
misc threadstate variable
FORTH *KEY*
no special info, see general notes
misc threadstate variable
FORTH *TYPE*
no special info, see general notes
misc threadstate variable
like EMIT and always to screen
- the routine to be put into *EMIT*
|
misc ordinary primitive
like EXPECT and always from screen
- the routine to be put into *EXPECT*
|
misc ordinary primitive
like KEY and always from screen
- the routine to be put into *KEY*
|
misc ordinary primitive
like TYPE and always to screen
- the routine to be put into *TYPE*
|
misc ordinary primitive
misc ordinary primitive
will load the help module in the background and hand over the
parsed name to (HELP) to be resolved. If no (HELP) word
can be loaded, nothing will happen.
|
misc ordinary primitive
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.
|
misc ordinary primitive
FORTH APPLICATION
no special info, see general notes
misc threadstate variable
misc ordinary primitive
misc ordinary primitive
FORTH EXITCODE
no special info, see general notes
misc threadstate variable
FORTH STDIN
no special info, see general notes
misc loader code P4_DVaL
FORTH STDOUT
no special info, see general notes
misc loader code P4_DVaL
FORTH STDERR
no special info, see general notes
misc loader code P4_DVaL
misc ordinary primitive
FORTH LOAD"
no special info, see general notes
misc compiling primitive
#ifndef NO_SYSTEM
run a shell command (note: embedded systems have no shell)
|
misc ordinary primitive
FORTH SYSTEM"
no special info, see general notes
misc compiling primitive
#endif
misc ordinary primitive
install signal handler
- return old signal handler
|
misc ordinary primitive
this creates a name with the VARIABLE runtime.
Note that this is the FIG-implemenation of CREATE whereas in
ANS-Forth mode we have a CREATE identical to FIG-style <BUILDS
: CREATE: BL WORD $HEADER DOVAR A, ;
|
misc ordinary primitive
this creates a name with the VARIABLE runtime and ALLOT s memory
: BUFFER: BL WORD $HEADER DOVAR A, ALLOT ;
|
misc ordinary primitive
The second element on the return stack.
: R'@ S" 2R@ DROP " EVALUATE ; IMMEDIATE
|
misc ordinary primitive
store the value into the next-under value in the returnstack.
used to interpret the returnstack to hold two LOCALS| values.
see R'@ for inverse operation
|
misc ordinary primitive
FORTH R"@
no special info, see general notes
misc ordinary primitive
FORTH R"!
no special info, see general notes
misc ordinary primitive
store the value as the topmost value in the returnstack.
see R@ for inverse operation ( R'@ / R"@ / 2R@ / 2R! )
|
misc ordinary primitive
store the value as the topmost value in the returnstack.
see R@ for inverse operation ( R'@ / R"@ / 2R@ / 2R! )
|
misc ordinary primitive
shortcut, see R>DROP
note again that the following will fail:
: DUP>R DUP >R ;
|
misc ordinary primitive
shortcut (e.g. in CSI-Forth)
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 ;
|
misc ordinary primitive
this is two times R>DROP but a bit quicker.
it is however really quick compared to the sequence 2R> and 2DROP
|
misc ordinary primitive
reset the parameter stack to be empty
: CLEARSTACK S0 SP! ;
|
misc ordinary primitive
stores the execution token of following word into
the callback pointer for the specified function-key
|
misc ordinary primitive
ENVIRONMENT
ENVIRONMENT RAND_MAX
no special info, see general notes
misc ordinary constant