home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / forth / compiler / fpc / tcom.doc < prev    next >
Text File  |  1990-04-26  |  29KB  |  617 lines

  1. TCOM.TXT         Welcome to the F-PC Target Compiler   by Tom Zimmer
  2. °Features         What is the TCOM compiler??     (advertisement)
  3.  
  4.   The files in this archive build a compiler that has the following
  5. features:
  6.  
  7.         Creates stand-alone applications (.COM files, tiny model).
  8.  
  9.         Space efficient. Only those definitions required by the
  10.         application are included (Space optimizing). The smallest
  11.         creatable application ("Hello world!") is about 400 bytes.
  12.  
  13.         TCOM generates subroutine (CALL) threaded code (pure
  14.         assembly, no Forth or NEXT in the application). The top of
  15.         stack is kept in the BX register to maximize performance.
  16.  
  17.         A set of user enablable (/OPT) optimizers looks for machine
  18.         compiled instruction sequences that often occur between library
  19.         macros. The optimizers then adjust the compiler output to
  20.         produce more efficient code. The optimizers can save up to
  21.         twenty percent in code space, with significant improvements in
  22.         execution performance as well.
  23.  
  24.         Additional user libraries can easily be added to the basic
  25.         system which currently includes over 500 functions.
  26.  
  27.         Automatic forward reference resolution for functions.
  28.  
  29.         Small code routines are expanded in-line as MACROS.
  30.  
  31.         Handles and files supported.
  32.  
  33.         Spawn DOS shell supported.
  34.  
  35.         Direct video memory output of text supported.
  36.  
  37.         Color output with direct video writes are supported.
  38.  
  39.         Defered word support, defered words must be initialized at
  40.         program startup time before use (no default initialization).
  41.  
  42.         VALUE support, with pre-initialized values.
  43.  
  44.         Simple graphics support for plotting, line, arc and circle
  45.         drawing. Color (CGA/EGA/VGA) and Hercules is supported. With
  46.         auto-switch capability.
  47.  
  48.         Menu support, you can add pull down menus to your applications.
  49.  
  50.         Virtual BLOCK mass storage support.
  51.  
  52.         The FPC line editor is available in the target.
  53.  
  54.         Debugging symbol support for the brand X debugger (BXDEBUG).
  55.  
  56.         Window file selection tool supported in the target application.
  57.  
  58.         Added the ability to create ROMable code. (currently UNTESTED!!)
  59.  
  60.         Branches are normally limited to +/- 127 bytes, but the command
  61.         LONG_BRANCH will switch the compiler to eliminate the limit.
  62.  
  63.         LINEREAD support
  64.  
  65.         Floating point support
  66.  
  67.         User create defining words supported in a limited form.
  68.  
  69.         A TCOM created symbolic dis-assembler is included for examining
  70.         the compilers output with imbeded labels and source code.
  71.  
  72.         Application programs can now include an interpretive Forth
  73.         system as part of their target image. A disassembler and
  74.         debugger are also available.
  75.  
  76. °Limits         This compiler does have a few limitations, as follows:
  77.  
  78.         The current version of the compiler supports nested DO ..
  79.         LOOPs, but not nested ?DO .. LOOPs.
  80.  
  81.         64k total on Code and Static Data together, about 48k of code
  82.         and 16k of data.
  83.  
  84.         No USER variables and no multi-tasking.
  85.  
  86.         No VOCABULARY support.
  87.  
  88. °Why?           Why was TCOM written??
  89.  
  90.           F-PC the Forth system I use, has continued to evolve into my
  91.         "IDEAL Forth system", but as it evolved, it became larger. This
  92.         made it more difficult to create small applications, the
  93.         information needed by the programmer to be able to create small
  94.         applications increased as well. It seemed to me that most users
  95.         would find it very difficult to use this FULL Forth system for
  96.         anything but the largest projects. Sooo, the idea of a forth
  97.         compiler that would create applications containing only the
  98.         needed words for the application occured to me, as it no doubt
  99.         has for many others. As with all relatively large projects, it
  100.         was some time before I could find time to work on the compiler,
  101.         and that time was often spent thinking of ways to solve its
  102.         various problems.  When the project was finally undertaken, it
  103.         was only a few weeks from no-code to functional prototype. The
  104.         current version of TCOM works well for developing small to
  105.         medium size programs. The performance of the code generated is
  106.         quite good. Since the output of the compiler is direct machine
  107.         code, you will rarely need assembly subroutines. The SZ editor,
  108.         CLOCK, CARD, BANNER, LINES and MIDNIGHT included with TCOM are
  109.         examples of small to medium size projects that use many of the
  110.         features of the compiler. They also illustrate how to dynamically
  111.         allocate arrays at runtime keeping them from taking up .COM file
  112.         space.
  113.  
  114.  
  115. °Files?         File descriptions:
  116.  
  117.         MAKETCOM.BAT    Builds the target compiler called TCOM.EXE.
  118.                         F-PC must have been previously installed, and
  119.                         the F-PC directory must be included in your
  120.                         system PATH statment.
  121.                         Type: MAKETCOM <enter>
  122.  
  123.         TARGET.SEQ      The file that loads COMPILER.SEQ, LIBRARY.SEQ,
  124.                         and other libraries on top of F-PC Forth. It
  125.                         then creates TCOM.EXE the compiler.
  126.  
  127.         COMPILER.SEQ    The source for the target compiler.
  128.  
  129.         HYPER.NDX       The index file for the hypertext help system.
  130.  
  131.         LIBRARY.SEQ     The source for the function library used by
  132.                         the target compiler to build your
  133.                         application. This library is for the 80x86
  134.                         family of processors.
  135.  
  136.         TBLOCK.SEQ      The library source for VERY simple BLOCK support.
  137.  
  138.         TBOX.SEQ        The library source for the box drawing
  139.                         functions.
  140.  
  141.         TCOLOR.SEQ      The library source for the color support
  142.                         functions.
  143.  
  144.         TEXEC.SEQ       The library source for the spawn DOS shell
  145.                         function.
  146.  
  147.         TENVIRON.SEQ    The library source for DOS environment access.
  148.                         Requires THANDLES.SEQ, and TSEARCH.SEQ.
  149.  
  150.         FLOAT4TH.SEQ
  151.         TFLOAT.SEQ      The library source for the floating point
  152.                         functions. You will need to FLOAD this at the
  153.                         start of your program to make it available.
  154.                         FLOAT4TH.SEQ is a support file that provides
  155.                         the same floating point support to FPC as
  156.                         TFLOAT, it is also needed to allow TFLOAT to
  157.                         handle floating point number input while target
  158.                         compiling in interpret mode.
  159.  
  160.         TGRAPH.SEQ      The library source for SIMPLE graphics support
  161.                         for TCOM. Only PLOT, POINT, LINE, LINETO and
  162.                         COLOR are supported. All use the BIOS.
  163.  
  164.         THANDLES.SEQ    The library source for the functions that
  165.                         interface to the DOS file system.
  166.  
  167.         THERC.SEQ       Simple hercules graphics plot support.
  168.  
  169.         TLEDIT.SEQ      The library source for the LINEEDITOR function.
  170.                         Added about 4k to any application that uses it.
  171.  
  172.         TMENU.SEQ       The library source for application pull down
  173.                         menu support. See CARD.SEQ for a usage example.
  174.  
  175.         TPATH.SEQ       The library source for the prepend current path
  176.                         functions.
  177.  
  178.         TSAVESCR.SEQ    The library source for the screen save and
  179.                         restore functions.
  180.  
  181.         TSEARCH.SEQ     The library source for a text search word.
  182.  
  183.         TSHAPES.SEQ     The library source for the ISIN and ICOS
  184.                         functions. Also contains ARC and CIRCLE drawing
  185.                         routines.
  186.  
  187.         TSREAD.SEQ      Support for LINEREAD.
  188.  
  189.         TTIMER.SEQ      Time date support.
  190.  
  191.         TTIMSTUF.SEQ    Elapsed time and delay support.
  192.  
  193.         TVIDEO.SEQ      The library source for direct video write
  194.                         functions. Initialized with VMODE.SET
  195.  
  196.         TWFL.SEQ        The library source for the window file selection
  197.                         tool. Using this tool adds about 11k to an
  198.                         application.
  199.  
  200.         LIBRARY.DOC     The supported word list for the target compiler.
  201.                         About 500 functions are currently provided.
  202.  
  203.         SMALTCOM.ZIP    If you ABSOLUTELY MUST have a smaller compiler
  204.                         (because your computer is short on memory or your
  205.                         floppy disks are too small), here is a set of
  206.                         files that will allow you to build a version of
  207.                         TCOM that is about 100k smaller than normal and
  208.                         uses 100k less memory. Of course you won't have
  209.                         the editor, debugger, or disassembler available.
  210.  
  211.         TCOM.TXT        This file.
  212.  
  213.         TCOMHELP.TXT    The hypertext help system for TCOM.
  214.  
  215.  
  216. °Examples       Example programs included with TCOM
  217.  
  218.  
  219.         BANNER.SEQ      The BANNER program from F-PC, slightly modified
  220.                         to allow it to be compile with TCOM.
  221.                         Type: TCOM BANNER <enter> to compile
  222.  
  223.         CARD.SEQ        A sample cardfile database, uses BLOCKs of 1k
  224.                         bytes for records.
  225.                         Type: TCOM CARD <enter> to compile
  226.  
  227.         CLOCK.SEQ       A sample application source file that builds
  228.                         a small screen clock.
  229.                         Type: TCOM CLOCK <enter> to compile
  230.  
  231.         FILTER.SEQ      A sample application that processes an input
  232.                         file, and writes it to an output file using
  233.                         standard I/O.
  234.                         Type: TCOM FILTER /OPT /NOINIT <enter>
  235.  
  236.         LINES.SEQ       A sample application to draw lines on either
  237.                         a CGA or a HERCULES graphics card.
  238.                         Type: TCOM LINES /OPT /NOINIT <enter> to compile
  239.  
  240.         LOOK.SEQ        An example of how to use the LINEREAD functions.
  241.                         Performs a string search across a set of file
  242.                         specs. Processes text files at 40000 bytes per
  243.                         second on a 6 MHz PC-AT clone system.
  244.                         Type: TCOM LOOK /OPT /NOINIT <enter>
  245.  
  246.         MIDNIGHT.SEQ    A sample Towers of Hanoi solution from Peter
  247.                         Midnight, modified very slightly to allow
  248.                         target compilation.
  249.                         Type: TCOM MIDNIGHT <enter> to compile
  250.  
  251.         PROMPTER.SEQ    A program that prompts for user input, and
  252.                         passes that input off to another program. Shows
  253.                         how to get user input, and how to shell out to
  254.                         perform a DOS command.
  255.                         Type: TCOM PROMPTER /OPT /NOINIT <enter>
  256.  
  257.         RS232IB.SEQ     A VERY simple teminal program, including
  258.                         interrupt driven buffered receive serial port
  259.                         driver. This file is setup to be compiled
  260.                         either with F-PC, or TCOM, it uses compile
  261.                         time words to select the proper lines for the
  262.                         compiler environment.
  263.                         Type: TCOM RS232IB /OPT /NOINIT <enter>
  264.  
  265.         SAMPLE.SEQ      An application source file for the "Hello
  266.                         world!" program.
  267.                         Type: TCOM SAMPLE <enter> to compile
  268.  
  269.         SHELL.SEQ       An simple file shell application, allows .BAT,
  270.                         .EXE and .COM file to be executed, and various
  271.                         text files to be edited. Uses less than 30k of
  272.                         memory at runtime.
  273.                         Type: TCOM SHELL /OPT /NOINIT <enter> to compile
  274.  
  275.         SZ.SEQ          A sample application source file that builds
  276.                         a small version of my Z editor. Only about
  277.                         20k bytes.
  278.                         Type: TCOM SZ /OPT /NOINIT <enter> to compile
  279.  
  280.         TIMEIT.SEQ      A sample application source file that times
  281.                         DOS commands or programs, displaying the
  282.                         execution elapes time when the program
  283.                         completes.
  284.                         Type: TCOM TIMEIT /OPT /NOINIT <enter>
  285.  
  286.  
  287. °Describe       Compiler description
  288.  
  289.           The TCOM compiler works by compiling a library of routines
  290.         into a series of MACROs that when executed (used in the target)
  291.         cause actual code to be compiled into the target image space.
  292.         In effect the entire Forth kernel is added on top of F-PC as a
  293.         set of words that compile themselves (macros) when used in the
  294.         target application.
  295.  
  296.           When compiling your application, the target compiler loads
  297.         your source files into memory, and compiles to a 64k memory
  298.         buffer. When the compile is complete, the memory buffer (your
  299.         application) is written to a file with the same name as the
  300.         file you are compiling, but with a .COM extension. Additional
  301.         files containing a symbol list (.SYM), and listing file (.LST)
  302.         can optionally be created using the /SYM and /LST command
  303.         line options. Type TCOM by itself at the DOS command-line to
  304.         see a list of compiler options.
  305.  
  306. °Def_Init       Default Initialization
  307.  
  308.           When TCOM starts compiling your application, it automatically
  309.         includes some code at the beginning of the program to
  310.         initialize some of the things Forth needs to use. Such things
  311.         as the two stacks and the DS register adjusted to their
  312.         appropriate locations. In addition to these, TCOM initializes
  313.         the execution vectors for EMIT, TYPE and SPACES to their
  314.         default BDOS functions. It also selects the DECIMAL number
  315.         base, and sets FUDGE to 50 so the MS delay word will at least
  316.         function. If you are doing your own initialization, or using
  317.         VMODE.SET to select direct screen output words, then you can
  318.         reduce the application program size by performing your own
  319.         subset of the following initialization:
  320.  
  321.                 DECIMAL                 \ always select decimal
  322.                 INIT-CURSOR             \ get intial cursor shape
  323.                 50 FUDGE !              \ init MS timer, GUESS!!
  324.                 CAPS ON                 \ ignore cAsE
  325.                 ?DS: SSEG !             \ init search segment
  326.                 DOSIO_INIT              \ init EMIT, TYPE & SPACES
  327.                 $FFF0 SET_MEMORY        \ default to about 64k DATA space
  328.                 DOS_TO_TIB              \ move command tail to TIB
  329.                 COMSPEC_INIT            \ init command specification
  330.  
  331.         The command line option /NOINIT will tell TCOM not to
  332.         perform the above initialize, which will save some code space
  333.         and require you to do any initialization needed. The complete
  334.         list of initialization functions is contained in the file
  335.         DEFINIT.SEQ, and may be more upto date than this list.
  336.  
  337.         Single Pass
  338.  
  339.           TCOM is a single pass compiler. Here is a description of the
  340.         compile process steps for building a new definition:
  341.  
  342.  
  343.                 1. Get ":" from the input stream, and execute it.
  344.                 2. ":" gets the word following and makes a target
  345.                         symbol from it. It then starts compiling.
  346.                 3. Get a word from the input file.
  347.                 4. Is the word immediate, if it is, execute it.
  348.                 5. Is the word defined?
  349.                    5.1 Is word a data item?
  350.                        5.1.1 Is item resolved?
  351.                              5.1.1.1 Resolve data item to data space.
  352.                        5.1.2 Compile data item as a literal number.
  353.                    5.2 Is word a library macro?
  354.                        5.2.1 Execute/compile the macro.
  355.                    5.3 Is word a subroutine?
  356.                        5.3.1 Is subroutined already compiled?
  357.                              5.3.1.1 If not, add to resolve stack.
  358.                        5.3.2 Compile a subroutine call.
  359.                    5.4 If word is none of the above, it is illegal.
  360.                 6. Is word a number?
  361.                    6.1 If it is, compile a literal number.
  362.                 7. If word is not defined & is not a number,
  363.                    then compile a new symbol for a subroutine to
  364.                    be resolved later. (forward reference)
  365.                 8. Repeat steps 3 through 7 until ";" reached.
  366.                 9. Execute the items on the resolve stack until
  367.                    the resolve stack is empty.(resolving forward refs)
  368.  
  369.  
  370.           TCOM uses a stack to hold references that need to be
  371.         resolved.  While compiling a COLON definition, if a word is
  372.         encountered that is not yet compiled, for example TYPE. The
  373.         word TYPE being a kernel library word, already exists, but has
  374.         not been compiled so its address is placed on the resolution
  375.         stack to be resolved after the current definition has been
  376.         compiled. The location where TYPE would have been compiled, is
  377.         filled with a CALL and is linked into the TYPE resolve chain.
  378.         After the current definition finishes compiling, the words on
  379.         the resolve stack are executed (causing them to be compiled)
  380.         one at a time until the resolution stack is empty. Using this
  381.         technique all needed words are compiled, and all forward
  382.         references are resolved. Compiling then proceeds with the next
  383.         line of the application file we are compiling.
  384.  
  385.         A similar process is used to handle user forward references.
  386.         When a user word is forward referenced, a symbol header is
  387.         created when the symbol if first encountered. An unresolved
  388.         call is installed, linked to the symbols resolve chain. When
  389.         the symbol is later defined, the resolve chain is used to link
  390.         all forward references to the actual location of the symbol in
  391.         target code space. If the symbol is never defined, then the
  392.         compiler will display the symbol as unresolved when the compile
  393.         completes. This is done by evaluating all symbols in the target
  394.         vocabulary, looking at the use count, and the resolution
  395.         address. If a symbol is used (count not zero), but does not
  396.         contain a resolution address (resolution address is minus one),
  397.         then is is printed as unresolved. If any symbols are
  398.         unresolved, then the compiler does not save the .COM file to
  399.         disk.
  400.  
  401. °Registers              Register & Memory Usage
  402.  
  403.         The 80x86 family target provided with TCOM use registers and
  404.         memory as follows:
  405.  
  406.                 Registers:
  407.  
  408.                 CS      Points to beginning of CODE space
  409.                 DS      Points to beginning of DATA space, which is
  410.                           not the same as CS.
  411.                 ES      Temorary use, should be preserved.
  412.                 SS = DS Stack segment is set to the DATA segment.
  413.                 BP      Holds a zero, must be preserved. Used to
  414.                           improve execution performance.
  415.                 SI      Data stack pointer.
  416.                 BX      Holds current top of data stack.
  417.                 AX      Temporary use.
  418.                 CX      Temporary use.
  419.                 DX      Temporary use.
  420.                 DI      Temporary use.
  421.  
  422.         The processor memory is used as follows:
  423.  
  424.               ┌──────────────────┐CS:0100  All executable code is
  425.               │ Executable Code  │         placed in this area.
  426.               │                  │
  427.               ├──────────────────┤DS:0000  All variables and data
  428.               │ Variables,       │         are placed in this area.
  429.               │ Strings &        │
  430.               │ Arrays           │
  431.               ├──────────────────┤         HERE-D at end of compile.
  432.               │ Free space       │         Use DS:ALLOC to use this
  433.               │                  │         space.
  434.               │                  │
  435.               ├──────────────────┤
  436.               │    ^^^^^^^       │
  437.               │   Data Stack     │
  438.               ├──────────────────┤SP0, TIB
  439.               │      TIB         │
  440.               │       |          │
  441.               │    vvvvvvv       │
  442.               ├──────────────────┤
  443.               │    ^^^^^^^       │
  444.               │  Return Stack    │
  445.               └──────────────────┘RP0
  446.  
  447.  
  448. Library Description
  449.  
  450.   The library included with TCOM includes all of the basic Forth words
  451. needed to create an application. Library routines do not compile
  452. immediately, but instead are like macros that compile themselves when
  453. they are used in an application. Here is the set of defining words
  454. supported in the library:
  455.  
  456.         >LIBRARY        Select the library functions for the defered
  457.                         .", ", ASCII, CODE, END-CODE, : and ;
  458.                         definitions.
  459.  
  460.         >TARGET         Select the target functions for the defered
  461.                         words listed under >LIBRARY.
  462.  
  463.         >FORTH          Select the Forth functions for the defered
  464.                         words listed under >LIBRARY.
  465.  
  466.         MACRO           Make a code definition that gets compiled
  467.                         IN-LINE.
  468.  
  469.         IMACRO          Immediately compile a MACRO definition into an
  470.                         internal object format in the library. Will be
  471.                         later moved into the target image without
  472.                         assembling at target compile time. For use in the
  473.                         LIBRARY ONLY.
  474.                         See the development note for date  ∙11/20/89
  475.  
  476.         CODE            Make a code definition that is accessed with
  477.                         a CALL, and therefore MUST end in a RET
  478.                         instruction. These definitions can be forced to
  479.                         be compiled inline if the INLINE directive
  480.                         preceeds each use of the definition.
  481.  
  482.         ICODE           Immediately compile a CODE word into an internal
  483.                         object format in the library. Will be later moved
  484.                         into the target image without assembling at
  485.                         target compile time. For use in the LIBRARY ONLY.
  486.                         See the development note for date  ∙11/20/89
  487.  
  488.         LABEL           Make a subroutine accessed from another CODE word.
  489.                         Labels return their address when used in the
  490.                         target program.
  491.  
  492.         :               Make a colon definition that causes itself to
  493.                         be included in the target application when it
  494.                         is referenced.
  495.  
  496.         M:              Like ":", but makes a colon definition that is
  497.                         compiled "inline". Not much call for this, but
  498.                         its available.
  499.  
  500.         DEFER           Make a defered function. Store a function name
  501.                         into the defered word with !>, =: or IS .
  502.  
  503.         FCONSTANT
  504.         2CONSTANT
  505.         CONSTANT        Just like a normal constant, but it is
  506.                         compiled as an inline literal register load
  507.                         in the application.
  508.  
  509.         FVARIABLE
  510.         2VARIABLE
  511.         VARIABLE        Just like a normal variable, but its space is
  512.                         only allocated in the target application if
  513.                         it is referenced.
  514.  
  515.         VALUE           Similar to a constant, but actually has a location
  516.                         in the targets memory where it resides. Think of
  517.                         it as an auto-fetching variable. Use =: or !> to
  518.                         change the contents of a VALUE.
  519.  
  520.         ARRAY           Like a variable, but you can specify how much
  521.                         space to allocate to it.
  522.  
  523.         HANDLE          Like an array with a specific number of bytes
  524.                         "B/HCB" allocated to it.
  525.  
  526.         TABLE           Used to build tables of litaral values in the
  527.                         target image. Use TABLE as shown in the following
  528.                         example:
  529.                                 TABLE <table_name>
  530.                                         1 C,    2 C,    3 C,
  531.                                         4 C,    5 C,    6 C,
  532.                                 END-TABLE
  533.  
  534.                         Tables return their address when used in a
  535.                         program, and tables DONOT start with a
  536.                         count byte.
  537.  
  538.         CREATE          Like normal CREATE, creates a symbol, that is
  539.                         resolved to the next available data byte, but
  540.                         doesn't allocate any data space. Typically
  541.                         used with ," (comma quote) or ALLOT-D which
  542.                         will immediately allocate some bytes in data
  543.                         space. May be used ONLY in the target
  544.                         application, NOT in a library file. Use ARRAY
  545.                         in libraries.
  546.  
  547.         ::              User created defining words supported in the
  548.                         form:
  549.  
  550.                         :: NEWCON ( n1 -- )   \ make defining word
  551.                                   CREATE , DOES> @ ;
  552.  
  553.                         25 NEWCON MYCON         \ define a new word
  554.  
  555.                         See note on ∙03/26/90 for more details.
  556.  
  557.         NEWMENUBAR
  558.         NEWMENU
  559.         ENDMENU
  560.         MENULINE"       Pull down menus can be added to a user
  561.                         application. See the file TMENU.SEQ at the end
  562.                         for an example of how to use menus.
  563.  
  564.         ALLOT           Like the normal ALLOT, allocates space in the
  565.                         target data space. Used after CREATE, ONLY in
  566.                         the target, may NOT be used in the LIBRARY, use
  567.                         the ARRAY word in the LIBRARY.
  568.  
  569.         ,"              Compile a string into data space. Used after
  570.                         CREATE. May be used ONLY in the target
  571.                         application, NOT in a library file.
  572.  
  573.         CSEG
  574.         DSEG            Used ONLY with cross compiled target
  575.         END-SEG         processors, creates a segment or area of memory
  576.                         starting at a particular address, and gives it
  577.                         a name. Used as follows:
  578.  
  579.                         $2000 CSEG my_code1     \ define code area1
  580.                         #FF00 CSEG start_up2    \ define code area2
  581.                         $0100 DSEG my_data      \ define where data goes
  582.  
  583.                         my_data                 \ select DATA area
  584.  
  585.                         label data_stuff        \ compile some data
  586.                                 0 , 0 ,
  587.                                 end-code
  588.  
  589.                         my_code1                \ select CODE area1
  590.  
  591.                         <your code words go here>
  592.  
  593.                         start_up2               \ select CODE area2
  594.  
  595.                         <start up code goes here>
  596.  
  597.                         END-SEG                 \ finished compiling
  598.  
  599.  
  600.                         The defined names are used to switch between
  601.                         the various areas of the target processors
  602.                         memory while compiling CODE, or DATA. Each time
  603.                         a segment is re-selected, new code or data is
  604.                         APPENDED to the selected segment.
  605.  
  606.   See the file LIBRARY.DOC for a complete list of supported functions.
  607.  
  608.   As mentioned in the description of CODE above, all CODE words MUST
  609. end with a RET instruction, since they are accessed with a CALL. You
  610. MUST NOT use NEXT, 1PUSH, or 2PUSH to end an CODE definition, as they
  611. are NOT supported.  The word NEXT is in fact matched to FOR as in
  612. the "FOR .. NEXT" looping structure.
  613.  
  614.   The inline string operators " and ." can be used in colon
  615. definitions as they are in normal Forth.
  616.  
  617.