File:  [gforth] / gforth / kernel / main.fs
Revision 1.3: download - view: text, annotated - select for diffs
Sun Jul 6 16:11:02 1997 UTC (26 years, 9 months ago) by jwilke
Branches: MAIN
CVS tags: HEAD
requrie is better
jens

    1: \ MAIN.FS      Kernal main load file                   20may93jaw
    2: 
    3: \ Copyright (C) 1995 Free Software Foundation, Inc.
    4: 
    5: \ This file is part of Gforth.
    6: 
    7: \ Gforth is free software; you can redistribute it and/or
    8: \ modify it under the terms of the GNU General Public License
    9: \ as published by the Free Software Foundation; either version 2
   10: \ of the License, or (at your option) any later version.
   11: 
   12: \ This program is distributed in the hope that it will be useful,
   13: \ but WITHOUT ANY WARRANTY; without even the implied warranty of
   14: \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15: \ GNU General Public License for more details.
   16: 
   17: \ You should have received a copy of the GNU General Public License
   18: \ along with this program; if not, write to the Free Software
   19: \ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
   20: 
   21: \ : include bl word count included ;
   22: \ we want write include...
   23: 
   24: \ : : ( -- colon-sys )  Header [ ' : @ ] ALiteral cfa, 0 ] ;
   25: \ : ; ( colon-sys -- )  ?struc postpone exit reveal postpone [ ; immediate
   26: \ : :noname ( -- xt colon-sys )  here [ ' : @ ] ALiteral cfa, 0 ] ;
   27: 
   28: Create mach-file here over 1+ allot place
   29: 
   30: require errors.fs
   31: require extend.fs
   32: require search.fs
   33: 
   34: \ include etags.fs
   35: 
   36: include cross.fs               \ include cross-compiler
   37: 
   38: decimal
   39: 
   40: cell 2 = [IF] 32 [ELSE] 256 [THEN] KB makekernel ( size )
   41: \ create image-header
   42: has-header [IF]
   43: 0 A,	\ base address
   44: 0 ,	\ checksum
   45: 0 ,	\ image size (without tags)
   46: ,	\ dict size
   47: 16 KB ,	\ data stack size
   48: 15 KB 512 + ,	\ FP stack size
   49: 15 KB ,	\ return stack size
   50: 14 KB 512 + ,	\ locals stack size
   51: 0 A,	\ code entry point
   52: 0 A,	\ throw entry point
   53: 16 KB ,	\ unused (possibly tib stack size)
   54: 0 ,	\ unused
   55: 0 ,	\ data stack base
   56: 0 ,	\ fp stack base
   57: 0 ,	\ return stack base
   58: 0 ,	\ locals stack base
   59: [THEN]
   60: 
   61: UNLOCK ghost - drop \ ghost must exist because - would be treated as number
   62: LOCK
   63: 
   64: doc-off
   65: has-prims [IF]
   66:     include kernel/aliases.fs             \ include primitive aliases
   67: [ELSE]
   68:     prims-include
   69:     undef-words
   70:     include kernel/prim.fs
   71:     all-words  UNLOCK LOCK
   72: [THEN]
   73: doc-on
   74: 
   75: 0 AConstant forthstart
   76: 
   77: include kernel/vars.fs                \ variables and other stuff
   78: include kernel/errore.fs
   79: include kernel/version.fs
   80: include kernel/kernel.fs              \ load kernel
   81: has-files [IF]
   82: include kernel/args.fs
   83: include kernel/files.fs               \ load file words
   84: include kernel/paths.fs
   85: include kernel/require.fs
   86: [THEN]
   87: has-locals [IF]
   88: include kernel/cond.fs                \ load IF and co
   89: [ELSE]
   90: include kernel/cond-old.fs            \ load IF and co w/o locals
   91: [THEN]
   92: include kernel/tools.fs               \ load tools ( .s dump )
   93: include kernel/toolsext.fs
   94: \ include arch/misc/tt.fs
   95: \ include arch/misc/sokoban.fs
   96: include kernel/special.fs             \ special must be last!
   97: 
   98: \ Setup                                                13feb93py
   99: 
  100: here normal-dp !
  101: tudp H @ minimal udp !
  102: decimal
  103: 
  104: has-header [IF]
  105:   here         2 cells !  \ image size
  106:   ' boot >body 8 cells !  \ Entry point
  107: [ELSE]
  108:   >boot
  109: [THEN]
  110: 
  111: UNLOCK Tlast @
  112: LOCK
  113: 1 cells - dup forth-wordlist ! Last !
  114: .unresolved

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>