"TOOLS-Misc Compatibility words"

tools_misc
Compatiblity with former standards, miscellaneous useful words.
... for TOOLS-EXT
Tektronix CTE %version: 1.11 % GNU LGPL
FORTH
* 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

tools_misc ordinary primitive

* see !CSP and ?CSP
FORTH CSP

no special info, see general notes

tools_misc threadstate variable

* !CSP ( -- )

put SP into CSP

used in control-words

tools_misc ordinary primitive

* ?CSP ( -- )

check that SP == CSP otherwise THROW

used in control-words

tools_misc ordinary primitive

FORTH CS-SWAP

no special info, see general notes

tools_misc ordinary primitive

FORTH CS-DROP

no special info, see general notes

tools_misc ordinary primitive

state checks
* ?COMP ( -- )

check that the current STATE is compiling
otherwise THROW

often used in control-words

tools_misc ordinary primitive

* ?EXEC ( -- )

check that the current STATE is executing
otherwise THROW

often used in control-words

tools_misc ordinary primitive

* ?FILE ( file-id -- )

check the file-id otherwise (fixme)

tools_misc ordinary primitive

* ?LOADING ( -- )

check that the currently interpreted text is
from a file/block, otherwise THROW

tools_misc ordinary primitive

* ?PAIRS ( a b -- )

if compiling, check that the two magics on
the CS-STACK are identical, otherwise throw

used in control-words

tools_misc ordinary primitive

* ?STACK ( -- )

check all stacks for underflow and overflow conditions,
and if such an error condition is detected THROW

tools_misc ordinary primitive

definition checks
* [VOID] ( -- flag )

Immediate FALSE. Used to comment out sections of code.
IMMEDIATE so it can be inside definitions.

tools_misc immediate constant

* 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 BL WORD COUNT (FIND-NFA) ; 

tools_misc ordinary primitive

* [DEFINED] ( "name" -- flag )

Search the dictionary for _name_. If _name_ is found,
return TRUE; otherwise return FALSE. Immediate for use in
definitions.
  
[DEFINED] word ( -- nfa|0 ) immediate
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] BL WORD FIND NIP ; IMMEDIATE

tools_misc immediate primitive

* [UNDEFINED] ( "name" -- flag )

Search the dictionary for _name_. If _name_ is found,
return FALSE; otherwise return TRUE. Immediate for use in
definitions.

see [DEFINED]

tools_misc immediate primitive

EXTENSIONS
* dictionary area dividers
* (FORGET) ( addr -- )

forget everything above addr
- used by FORGET

tools_misc ordinary primitive

* FENCE ( -- var* )

a forth system variable - (FORGET) will not work below
this address and any FORGET on a header below this mark
will THROW

tools_misc threadstate variable

* DICTLIMIT ( -- var* )

the lower end of usable area - the forth memory block minus the
forth-related DICTALLOCS at the upper end (e.g. POCKET-PAD )
Note that this is a variable by tradition but you should not move it.

tools_misc threadstate variable

* DICTFENCE ( -- var* )

the lower end of usable area - the forth memory block minus the
forth-VM backstore. Note that this is a variable by tradition but
you should not move it.

tools_misc threadstate variable

* (DICTLIMIT) ( -- constvalue )

the upper limit of the forth writeable memory space,
the variable DICTLIMIT must be below this line.
stack-space and other space-areas are often allocated
above DICTLIMIT upto this constant.

DICTFENCE is the lower end of the writeable dictionary

tools_misc ordinary primitive

* (DICTFENCE) ( -- constvalue )

the lower limit of the forth writeable memory space,
the variable DICTFENCE must be above this line.
Some code-areas are often moved in between DICTFENCE and
this constant. To guard normal Forth code from deletion
the usual practice goes with the FENCE variable

DICTLIMIT is the upper end of the writeable dictionary

tools_misc ordinary primitive

* implementation specific magic - used by control words
EXTENSIONS EXCEPTION_MAGIC

no special info, see general notes

tools_misc ordinary constant

EXTENSIONS INPUT_MAGIC

no special info, see general notes

tools_misc ordinary constant

EXTENSIONS DEST_MAGIC

no special info, see general notes

tools_misc ordinary constant

EXTENSIONS ORIG_MAGIC

no special info, see general notes

tools_misc ordinary constant

EXTENSIONS LOOP_MAGIC

no special info, see general notes

tools_misc ordinary constant

EXTENSIONS CASE_MAGIC

no special info, see general notes

tools_misc ordinary constant

EXTENSIONS OF_MAGIC

no special info, see general notes

tools_misc ordinary constant