home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / CLIPPER / MISC / FFB.ZIP / FFHLP.ARC / KERNEL3.HLP < prev    next >
Encoding:
Text File  |  1987-12-23  |  9.2 KB  |  217 lines

  1.  
  2.  
  3. >TYPE
  4.    TYPE for multitasking systems.
  5. .(     Type the following string on the terminal.
  6. (    The Forth Comment Character.  The input stream is skipped
  7.   until a ) is encountered.
  8. \S  comment to end of screen.
  9.  
  10. TRAVERSE
  11.    Run through a name field in the specified direction.
  12.    Terminate when a byte whose high order bit is on is detected.
  13. DONE?
  14.    True if the input stream is exhaused or state doesn't match
  15. FORTH-83   Let's hope so.
  16.  
  17. CNHASH  given CFA, get pointer into >NAME hash table in YSEG.
  18.  
  19. CNSRCH  search for CFA between YA and MAXYA in YSEG.  Return
  20.    NFA and failure flag.
  21.  
  22. N>LINK       Go from name field to link field.
  23. L>NAME       Go from link field to name field.
  24. BODY>        Go from body to code field.
  25. NAME>        Go from name field to code field.
  26. LINK>        Go from link field to code field.
  27. >BODY        Go from code field to body.
  28. >NAME        Go from code field to name field.
  29. >LINK        Go from code field to link field.
  30. >VIEW        Go from code field to view field.
  31. VIEW>        Go from view field to code field.
  32. HASH   Given a string address and a pointer to a set of
  33.    vocabulary chains, returns the actual thread.  Uses the
  34.    first character of the string to determine which thread.
  35.  
  36. (FIND)
  37.    Does a search of the dictionary based on a pointer to a
  38.    vocabulary thread and a string.   If it finds the string
  39.    in the chain, it returns a pointer to the CFA field
  40.    inside the header.  This field contains the code field
  41.    address of the body.  If it was an immediate word the
  42.    flag returned is a 1.  If it is non-immediate the flag
  43.    returned is a -1.
  44.    If the name was not found, the string address is returned
  45.    along with a flag of zero. Note that links point to
  46.    links, and are absolute addresses.
  47.  
  48. #THREADS   The number of seperate linked lists per vocabulary.
  49. FIND
  50.    Run through the vocabulary list searching for the name whose
  51.    address is supplied on the stack.  If the name is found,
  52.    return the code field address of the name and a non-zero
  53.    flag.  The flag is -1 if the word is non-immediate and 1 if
  54.    it is immediate.  If the name is not found, the string
  55.    address is returned along with a false flag.
  56.  
  57. ?UPPERCASE
  58.   Convert the given string to upper case if CAPS is true.
  59. DEFINED    Look up the next word in the input stream.  Return
  60.    true if it exists, otherwise false. Maybe ignore case.
  61.  
  62. ?STACK
  63.    Check for parameter stack underflow or overflow and issue
  64.    appropriate error message if detected.
  65. STATUS   Indicate the current status of the system.
  66. INTERPRET
  67.    The Forth Interpret Loop.  If the next word is defined,
  68.    execute it, otherwise convert it to a number and push it
  69.    onto the stack.
  70.  
  71. ALLOT    Allocate more space in the dictionary
  72. ,        Set the contents of the dictionary value on the stack
  73. C,       Same as , except uses an 8 bit value
  74. ALIGN    Used to force even addresses.
  75. EVEN     Makes the top of the stack an EVEN number.
  76. COMPILE     Compile the following word when this def. executes
  77. IMMEDIATE   Mark the last Header as an Immediate word.
  78. LITERAL  Compile the single integer from the stack as a literal
  79. DLITERAL
  80.    Compile the double integer from the stack as a literal.
  81. ASCII    Compile the next character in the input stream as a
  82.    literal Ascii integer.
  83. CONTROL  Compile the next character in the input stream as a
  84.    literal Ascii Control Character.
  85.  
  86. CRASH   Default routine called by execution vectors.
  87.  
  88. ?MISSING  Tell user the word does not exist.
  89.  
  90. '        Return the code field address of the next word
  91. [']      Like ' only used while compiling
  92. [COMPILE]   Force compilation of an immediate word
  93. (")    Return the address and length of the inline string
  94. (.")   Type the inline string.  Skip over it.
  95. ,"     Add the following text till a " to the dictionary.
  96. ."     Compile the string to be typed out later.
  97. "      Compile the string, return pointer later.
  98.  
  99. FENCE   Limit address for forgetting.
  100. TRIM   (S faddr voc-addr -- )
  101.    Change the 4 hash pointers in a vocabulary so that they are
  102.    all less than a specified value, faddr.
  103.  
  104. (FORGET)   (S code-addr relative-link-addr -- )
  105.    Forgets part of the dictionary.  Both the code address and
  106.    the header address are specified, and may be independant.
  107.    (FORGET) resets all of the links and releases the space.
  108.  
  109. FORGET   (S -- )
  110.    Forget all of the code and headers before the next word.
  111.  
  112. WHERE  Locates the screen and position following an error.
  113. ?ERROR  Maybe indicate an error. Change this to alter ABORT"
  114. (?ERROR)
  115.    Default for ?ERROR. Conditionally execute WHERE and type
  116.    message.
  117.  
  118. (ABORT")
  119.    The Runtime code compiled by ABORT". Uses ERROR, and
  120.    updates return stack.
  121. ABORT"
  122.    If the flag is true, issue an error message and quit.
  123. ABORT
  124.        Stop the system and indicate an error.
  125.  
  126. ?CONDITION
  127.    Simple compile time error checking.  Usually adequate
  128. >MARK        Set up for a Forward Branch
  129. >RESOLVE     Resolve a Forward Branch
  130. <MARK        Set up for a Backwards Branch
  131. <RESOLVE     Resolve a Backwards Branch
  132.  
  133. ?>MARK       Set up a forward Branch with Error Checking
  134. ?>RESOLVE    Resolve a forward Branch with Error Checking
  135. ?<MARK       Set up for a Backwards Branch with Error Checking
  136. ?<RESOLVE    Resolve a backwards Branch with Error Checking
  137.  
  138. LEAVE and ?LEAVE could be non-immediate in this system,
  139.   but the 83 standard specifies an immediate LEAVE, so they
  140.   both are for uniformity.
  141. These are the compiling words needed to properly compile
  142. the Forth Conditional Structures.  Each of them is immediate
  143. and they must compile their runtime routines along with
  144. whatever addresses they need.  A modest amount of error
  145. checking is done.  If you want to rip out the error checking
  146. change the ?> and ?< words to > and < words, and
  147. all of the 2DUPs to DUPs and the 2SWAPs to SWAPs.  The rest
  148. should stay the same.
  149.  
  150. ,VIEW   Calculate and compile the VIEW field of the header.
  151. "CREATE   Use the string at str to make a header, and initialize
  152.   the code field.  First we check for duplicates.  Then we make
  153.   entry in >NAME hash table if appropriate.  Next lay down the
  154.   view field. Then we hook in to the correct thread an make the
  155.   link field.  We set up LAST so that it points to our name
  156.   field.  Then we copy the name to YSEG and delimit the name
  157.   field bits.  Then we make the pointer in the YSEG to the CFA.
  158.   Then we add a stopper entry to >NAME hash table in case of a
  159.   large ALLOT or end of dictionary. Finally we lay down the
  160.   code field.
  161.  
  162. CREATE   Make a header for the next word in the input stream.
  163.  
  164. !CSP        Save the current stack level for error checking.
  165. ?CSP        Issue error message if stack has changed.
  166. HIDE        Removes the Last definition from the Header
  167.             Dictionary.
  168. REVEAL      Replaces the Last definition in the Header
  169.             Dictionary.
  170. (;USES)     Set the code field to the contents of following cell
  171. ASSEMBLER   Define the vocabulary to be filled later.
  172. ;USES       Similar to the traditional ;CODE except used when
  173.             run time code has been previously defined.
  174. (;CODE)     Set the code field to the address of the following.
  175. ;CODE       Used for defining the run time portion of a defining
  176.             word in low level code.
  177. DOES>       Specifies the run time of a defining word in high
  178.             level Forth.
  179. [     Stop compiling and start interpreting
  180. ]     The Compiling Loop.  First sets Compile State.  Looks up
  181.    the next word in the input stream and either executes it
  182.    or compiles it depending upon whether or not it is immediate.
  183.    If the word is not in the dictionary, it converts it to a
  184.    number, either single or double precision depending on
  185.    whether or not any punctuation was present.  Continues until
  186.    input stream is empty or state changes.
  187. :    Defines a colon definition. The definition is hidden until
  188.    it is completed, or the user desires recursion.  The runtime
  189.    for : adds a nesting level.
  190. ;     Terminates a colon definition.  Compiles the runtime code
  191.    to remove a nesting level, and changes STATE so that
  192.    compilation will terminate.
  193.  
  194. RECURSIVE   Allow the current definition to be self referencing
  195. CONSTANT    A defining word that creates constants.  At runtime
  196.    the value of the constant is placed on the stack.
  197. VARIABLE    A defining word to create variables.  At runtime
  198.    the address of the variable is placed on the stack.
  199. DEFER    Defining word for execution vectors.  These are
  200.    initially set to display an error message.  They are
  201.    initialized with IS. DEFERS, installs the contents of a
  202. defered word in the current definition being defined. This is
  203. used to make a new word the defered word also, sort of a list.
  204. VOCABULARY
  205.    Defines a new Forth vocabulary.  VOC-LINK is a chain in
  206.    temporal order and used by FORGET.  At runtime a vocabulary
  207.    changes the search order by setting CONTEXT.
  208. DEFINITIONS Subsequent definitions will be placed into CURRENT.
  209. 2CONSTANT
  210.    Create a double number constant.  This is defined for
  211.    completeness, but never used, so the code field is discarded.
  212. 2VARIABLE
  213.    Create a double length variable.  This is defined for
  214.    completeness, but never used, so the code field is discarded.
  215.    as appropriate.
  216.  
  217.