home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / forth / pfe-0.000 / pfe-0 / pfe-0.9.13 / help / forth-83.hlp < prev    next >
Encoding:
Text File  |  1995-04-25  |  6.5 KB  |  186 lines

  1. #
  2. # forth-83.hlp ---    online help strings for FORTH-83
  3. #            compatiblity words in pfe
  4. # (duz 13Sep94)
  5. #
  6.  
  7. : 2+ ( n1 --- n2 ) [FORTH-83]
  8. increments the top of stack by two.
  9.  
  10.  
  11. : 2- ( n1 --- n2 ) [FORTH-83]
  12. decrements the top of stack by two.
  13.  
  14.  
  15. : COMPILE ( ``<spaces>name'' --- ) [FORTH-83]
  16. Using COMPILE in interpretive state is an error.
  17.  
  18. In pfe COMPILE is immediate. COMPILE actively parses the next word and
  19. adds the following compilation semantics to the current definition: To
  20. compile this next word when the current definition is later executed.
  21. The current definition is typically itself immediate and becomes
  22. executed when comiling.
  23.  
  24. In ANS-Forth COMPILE is superseded by POSTPONE.
  25.  
  26.  
  27. : VOCABULARY ( ``<spaces>name'' --- ) [FORTH-83]
  28. parses name delimited by spaces. Creates a definition for name along
  29. with an associated new words list. The execution semantics of the new
  30. word name is to replace the first word list in the search order by
  31. it's associated words list.
  32.  
  33.  
  34. : ?BRANCH ( flag --- ) [FORTH-83]
  35. low level control flow primitive. Executing this word in interpretive
  36. state is a fatal error.
  37.  
  38. ?BRANCH is the execution semantics of IF, WHILE and UNTIL. It takes
  39. the cell compiled next and uses it as offset to add to the instruction
  40. pointer conditionally. This results in a branch that takes place when
  41. flag is 0, else execution continues with the next word compiled after
  42. the offset.
  43.  
  44.  
  45. : BRANCH ( --- ) [FORTH-83]
  46. low level control flow primitive. Executing this word in interpretive
  47. state is a fatal error.
  48.  
  49. BRANCH is the execution semantics of ELSE, REPEAT and AGAIN. It takes
  50. the cell compiled next and uses it as offset to add to the instruction
  51. pointer unconditionally. This results in a branch to the location
  52. <instruction pointer after BRANCH + contents of following cell>.
  53.  
  54.  
  55. : <MARK ( --- dest ) [FORTH-83]
  56. same as HERE but can only be used compiling. Used by the first of a
  57. pair of control flow words to pass a backward branch destination to
  58. the second word. This second word typically uses <RESOLVE to compile
  59. the backward branch offset.
  60.  
  61.  
  62. : MARK> ( --- orig ) [FORTH-83]
  63. used by the first of a pair of control flow words that involve a
  64. forward branch. Compiles an empty location for a branch offset and
  65. passes this location to the second word. This second word typically
  66. uses RESOLVE> to fill in the branch destination.
  67.  
  68.  
  69. : <RESOLVE ( dest --- ) [FORTH-83]
  70. used by the second of a pair of control flow words that involve a
  71. backward branch. Compiles the branch offset to the location dest.
  72. Typically dest was provided by <MARK.
  73.  
  74.  
  75. : RESOLVE> ( orig --- ) [FORTH-83]
  76. used by the second of a pair of control flow words that involve a
  77. forward branch. orig was typically provided by MARK> and points to a
  78. location where an offset to the current location can be stored.
  79.  
  80.  
  81. : --> ( --- ) [FORTH-83]
  82. used when loading blocks. Continues interpretation or compilation with
  83. the next block ignoring any text following in the current block.
  84.  
  85.  
  86. : K ( --- n ) [FORTH-83]
  87. Using K in interpretive state is an error.
  88. When compiled, K puts the second outer loop index on the stack.
  89. Use only inside at least three nested loops.
  90.  
  91.  
  92. : OCTAL ( --- ) [FORTH-83]
  93. Sets the number conversion base to 8.
  94.  
  95.  
  96. : SP@ ( --- addr ) [FORTH-83]
  97. returns the address of the top of the stack before executed.
  98. You could define : DUP SP@ @ ;
  99.  
  100.  
  101. : !BITS ( x1 a-addr x2 --- ) [FORTH-83]
  102. stores the value of x1 masked by x2 into the equivalent masked part of
  103. the cell at a-addr, without affecting bits outside the mask.
  104.  
  105.  
  106. : @BITS ( a-addr x1 --- x2 ) [FORTH-83]
  107. returns the contents of the cell at a-addr masked by x2.
  108.  
  109.  
  110. : ** ( n1 n2 --- n3 ) [FORTH-83]
  111. n3 is the value of n1 to the power n2.
  112.  
  113.  
  114. : >< ( x1 --- x2 ) [FORTH-83]
  115. swaps the two least significant bytes in x1 giving x2.
  116.  
  117.  
  118. : >MOVE< ( addr1 addr2 u --- ) [FORTH-83]
  119. moves u bytes starting at addr1 to the memory at addr2. During this
  120. move, the order of each byte pair is reversed.
  121.  
  122.  
  123. : SEAL ( --- ) [FORTH-83]
  124. deletes all occurences of ONLY from the search order. The effect is
  125. that only specified application vocabularies will be searched and the
  126. search order cannot be changed any more.
  127.  
  128.  
  129. # : >BODY ( xt --- a-addr ) [FORTH-83]
  130. # xt is an execution token. a-addr is the address in the data space that
  131. # belongs to the execution token. Since in pfe there is one contiguous
  132. # region for definitions and data this is just the next cell and >BODY is
  133. # equivalent to CELL+.
  134.  
  135.  
  136. : >NAME ( xt --- c-addr ) [FORTH-83]
  137. xt is an execution token. c-addr is the address of the count byte of
  138. the name of the definition represented by xt. In the one contiguous
  139. region that makes up the dictionary and data space in pfe the name
  140. preceeds the execution token. Thus >NAME has to scan backward for the
  141. beginning of the name. This beginning is marked by a count byte with
  142. the most significant bit set. There is a low probability that >NAME
  143. fails to detect the beginning of the name correctly when you use
  144. characters with codes greater than 127 in the definition's name.
  145.  
  146.  
  147. : >LINK ( xt --- a-addr ) [FORTH-83]
  148. xt is an execution token. a-addr is a pointer to a cell in the header
  149. of the word xt represents. In this cell a pointer is stored to the
  150. name of another preceeding word in the dictionary. Using this pointer
  151. pfe links words to word lists. However there are multiple linked list
  152. for one word list. Thus it isn't sufficient to follow one thread of
  153. links when all words in a word list shall be visited.
  154.  
  155.  
  156. : BODY> ( a-addr --- xt ) [FORTH-83]
  157. provided a-addr is the address of the first cell in the data space of
  158. a definition then xt is the execution token of this definition. In the
  159. one contiguous region where pfe keeps definitions and data an xt
  160. preceeds the data space of the definition. Thus BODY> is equivalent to
  161. `1 CELLS -'.
  162.  
  163.  
  164. : NAME> ( c-addr --- xt ) [FORTH-83]
  165. given a pointer to the count byte of the name inside a definition in
  166. the dictionary, NAME> returns the execution token for that definition.
  167. See also >NAME.
  168.  
  169.  
  170. : LINK> ( a-addr --- xt ) [FORTH-83]
  171. given the address inside a definition where pfe keeps the pointer to
  172. the preceeding definition, LINK> returns the execution token for the
  173. definition. See also >LINK.
  174.  
  175.  
  176. : N>LINK ( c-addr --- a-addr ) [FORTH-83]
  177. given a pointer to the name inside a definition in the dictionary,
  178. N>LINK returns the address inside the definitions where pfe keeps the
  179. pointer to the preceeding definition. See also >LINK.
  180.  
  181.  
  182. : L>NAME ( a-addr --- c-addr ) [FORTH-83]
  183. given the address inside a defintion where pfe keeps the pointer to
  184. the preceeding definition, L>NAME returns the address of the count
  185. byte of the name of the definition. See also >NAME.
  186.