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

  1.  
  2.  
  3. AVOC   A variable that hold the old CONTEXT vocabulary
  4. CODE is the defining word for FORTH assembler definitions.
  5.    It saves the context vocabulary and hides the name.
  6.  
  7. END-CODE    terminates a code definition and restores vocs.
  8.  
  9. #USER     Count of how many user variables are allocated
  10. USER      Vocabulary that holds task versions of defining words
  11. ALLOT     Allocate some space in the user area for a task.
  12.    When used with CREATE, you can define arrays this way.
  13. CREATE    Define a word that returns the address of the next
  14.    available user memory location.
  15. VARIABLE  Define a task type variable.  This is similar to the
  16.    old FIG version of USER.
  17. DEFER     Defines an execution vector that is task local.
  18.  
  19. >IS   Maps a code field into a data field.  If the word is in
  20.    the USER class of words, then the data address must be
  21.    calculated relative to the current user pointer.  Otherwise
  22.    it is just the parameter field.
  23.  
  24. (IS)     The code compiled by IS.  Sets the following DEFERred
  25.    word to the address on the parameter stack.
  26. IS       Depending on STATE, either sets the following DEFERred
  27.    word immediatly or compiles the setting for later.
  28.  
  29.                                                       11Feb87TJZ
  30.  
  31. (=:)    ( N1 --- )
  32.                 Primitive used by the following definitions,
  33.                 gets compiled into colon definition, and stores
  34.                 value on the stack into the following defs
  35.                 body field.
  36.  
  37. =:    ( N1 T1 --- )
  38.                 Used to assign values into the body of the
  39.                 following definition, like variables or
  40.                 constants.
  41.  
  42.                                                       11Feb87TJZ
  43.  
  44. INCR>   ( --- )
  45.         Increment the body of the word following, used to
  46.         modify the following constant or variable.
  47.  
  48. DECR>   ( --- )
  49.         Decrement the body of the word following, used to
  50.         modify the following constant or variable.
  51.  
  52.                                                       11Feb87TJZ
  53.  
  54. +!>     ( N1 --- )
  55.         Increment the body field of the following definition
  56.         by value n1 on the stack.
  57.  
  58. RUN
  59.    Allows for multiline compilation.  Thus you may enter a :
  60.    definition that spans several lines.
  61. QUIT
  62.    The main loop in Forth.  Gets more input from the terminal
  63.    and Interprets it.  Responds with OK if healthy.
  64. BOOT   The very first high level word executed during cold start
  65. WARM   Performs a warm start, jumped to by vector at hex 104
  66.  
  67. COLD   The high level cold start code.  For ordinary forth,
  68.    BOOT should initialize and pass control to QUIT.
  69.  
  70. INITIAL   The screen number to load for an application.
  71. OK        Loads in an application from the INITIAL screen
  72. START     Used to compile from a file after meta compilation
  73.    has finished.
  74. BYE     Returns control to CP/M.  First it moves the heads
  75.    down next to the code such that the system is contiguous
  76.    when saved.  Calculates the size in pages.
  77.  
  78.  
  79. WARM   Initialize the warm start entry point in low memory
  80.    and jump immediately into hi level
  81. COLD   Initialize the cold start entry point in low memory
  82.    Then calculate how much space is consumed by CP/M and
  83.    round it down to an even HEX boundary for safety.  We
  84.    then patch FIRST and LIMIT with this value and calculate
  85.    the locations of the return stack and the Terminal Input
  86.    buffer.  We also set up the initial parameter stack and
  87.    finally call the Hi Level COLD start routine.
  88.  
  89. Finally we must initialize the user variables that were defined
  90. earlier.  User variables are relocatable, and sit on the top of
  91. the dictionary in whatever task they occur in.  They must be
  92. laid down in the exact same order as their definitions.
  93.  
  94. DEPTH      Returns the number of items on the parameter stack
  95. .S
  96.    Displays the contents of the parameter stack non
  97.    destructively.  Very useful when debugging.
  98.  
  99. .ID
  100.    Display the variable length name whose name field address
  101.    is on the stack.  If it is shorter than its count, it is
  102.    padded with underscores.  Only valid Ascii is typed.
  103.  
  104. DUMP
  105.    A primitive little dump routine to help you debug after
  106.    you have changed the system source and nothing works any
  107.    more.
  108.  
  109. These words are in the reference word sets,           29Sep83map
  110. and are only include for completeness.
  111. We prefer to use RECURSIVE rather than RECURSE.
  112. ( See RECURSIVE )
  113.  
  114. We must resolve the forward references that were required in
  115. the Meta Compiler.  These are all run time code which wasn't
  116. known at the time the meta compiling version was defined.  These
  117. are all either defining words or special case immediate words.
  118.  
  119. These are forward references that were generated in the course
  120. of compiling the system source.  Most of these are here because
  121. (DO) (?DO) and ROLL are written in high level and are defined
  122. very early in the system.  While forward references should be
  123. avoided when possible, they should not be shunned as a matter
  124. of dogma.  Since the meta compiler makes it easy to create and
  125. resolve forward references, why not take advantage of it when
  126. you need to.
  127.  
  128. In order to run, we must initialize all of the defferred words
  129. that were defined to something meaningful.  Deferred words are
  130. also known as execution vectors.  The most important execution
  131. vectors in the system are listed here.  You can certainly create
  132. your own with the defining word DEFER.  Be sure you initialize
  133. them however, or else you will surely crash.
  134.  
  135. Initialize the CURRENT vocabulary to point to FORTH
  136. Initialize the CONTEXT vocabulary to point to FORTH
  137. Initialize the Threads in the Forth vocabulary
  138. The value of DP-BODY is only now know, so we must init it here
  139. The rest of the variables that are initialize are ordinary
  140. variables, which are resident in the dictionary, and must be
  141. correct upon cold boot.  You can change some of these depending
  142. on how you want your system to come up initially.
  143.  
  144.  
  145.