home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / love / chap15.doc < prev    next >
Text File  |  1993-04-11  |  3KB  |  51 lines

  1. Chapter15               L.O.V.E. FORTH
  2.  
  3.  
  4.  
  5. 15.0  L.O.V.E. Forth Technical Note
  6.       -----------------------------
  7.  
  8.     L.O.V.E. Forth is a Forth-83 standard programming language for the
  9. IBM PC/XT/AT and compatibles.  In order to increase available memory space
  10. over the standard 64k model, it has been designed to operate over five
  11. segments.  These segments are classified by the following functions:
  12. machine code,threaded addresses, data, stacks and dictionary heads.  This
  13. modification has been performed without reducing execution speed.
  14.  
  15. L.O.V.E. Forth uses the usual 8086   'NEXT'   instruction sequence:
  16.              LODSW    MOV BX, AX   JMP [BX]
  17.  
  18.          Since 8086 fetches instructions relative to the CS segment register
  19. and the   LODSW   and   JMP   [BX] work relative to the DS segment
  20. register, the first logical division was to place threaded addresses and
  21. code addresses (parameter and code fields) into a separate segment from the
  22. machine code.  This required modification to the assembler and some
  23. compiler words (like   CREATE   DOES>   ;CODE ).
  24.  
  25.          The 8086 performs all stack operations   ( PUSH  POP instructions
  26. with [BP] ) relative to the SS segment register.  The next logical division
  27. was to assign the SS register a separate segment.  L.O.V.E. Forth uses SP
  28. and BP registers for the parameter and return stacks respectfully.  This
  29. modification was straightforward, the only changes required were to some
  30. stack operators   ( PICK   ROLL )   and to utilities such as:   .S .
  31.  
  32.          Separating dictionary heads is a valuable modification to any Forth
  33. system.  Approximately 30% of dictionary space is saved by this method.  In
  34. L.O.V.E.  Forth, dictionary heads were moved to a segment not relative to
  35. any specific 8086 segment register.  Any words that require access to the
  36. head segment WORDS   CREATE   calculate the segment value when required.
  37.  
  38.          The last division made to the standard model was to separate data.
  39. This is commonly done in other Forths to allow programming into ROM.  In
  40. L.O.V.E Forth this also further reduced the space in the kernel.  The ES
  41. segment register was used to access this segment, requiring segment
  42. override instructions in some words.
  43.  
  44.          Very few modifications were required to standard Forth source code
  45. to run under L.O.V.E Forth.  The exception was for compiler words that
  46. directly stored threaded addresses, machine code or portions of the
  47. dictionary headers.  Special words were added to the kernel for this.
  48.  
  49.      There are separate dictionary pointers for code, threads, data and
  50. head segments.  When creating a final application program, the segments may
  51. be overlapped to the nearest paragraph, and the system saved without heads.