Annotation of gforth/kernel/main.fs, revision 1.13
1.1 anton 1: \ MAIN.FS Kernal main load file 20may93jaw
2:
1.10 anton 3: \ Copyright (C) 1995,1996,1997,1998 Free Software Foundation, Inc.
1.1 anton 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:
1.7 anton 30: require ../errors.fs
31: require ../search.fs
32: require ../extend.fs
1.1 anton 33:
34: \ include etags.fs
35:
1.7 anton 36: include ../cross.fs \ include cross-compiler
1.1 anton 37:
38: decimal
39:
1.11 pazsan 40: has? kernel-size makekernel ( size )
1.1 anton 41: \ create image-header
1.4 jwilke 42: has? header [IF]
1.1 anton 43: 0 A, \ base address
44: 0 , \ checksum
45: 0 , \ image size (without tags)
1.11 pazsan 46: >address , \ dict size
47: has? stack-size , \ data stack size
48: has? fstack-size , \ FP stack size
49: has? rstack-size , \ return stack size
50: has? lstack-size , \ locals stack size
1.1 anton 51: 0 A, \ code entry point
52: 0 A, \ throw entry point
1.11 pazsan 53: has? stack-size , \ unused (possibly tib stack size)
1.1 anton 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
1.4 jwilke 65: has? prims [IF]
1.7 anton 66: include aliases.fs \ include primitive aliases
1.1 anton 67: [ELSE]
68: prims-include
69: undef-words
1.7 anton 70: include prim.fs
1.1 anton 71: all-words UNLOCK LOCK
72: [THEN]
73: doc-on
74:
75: 0 AConstant forthstart
76:
1.13 ! jwilke 77: include ./vars.fs \ variables and other stuff
1.12 anton 78: include kernel/version.fs \ is in $(build)/kernel
1.13 ! jwilke 79: include ./kernel.fs \ load kernel
! 80: include ./errore.fs
! 81: include ./doers.fs
1.4 jwilke 82: has? file [IF]
1.13 ! jwilke 83: include ./args.fs
! 84: include ./files.fs \ load file words
! 85: include ./paths.fs
! 86: include ./require.fs
1.1 anton 87: [THEN]
1.6 pazsan 88:
89: has? compiler [IF]
1.4 jwilke 90: has? glocals [IF]
1.13 ! jwilke 91: include ./cond.fs \ load IF and co
1.1 anton 92: [ELSE]
1.13 ! jwilke 93: include ./cond-old.fs \ load IF and co w/o locals
1.1 anton 94: [THEN]
1.2 pazsan 95: \ include arch/misc/tt.fs
96: \ include arch/misc/sokoban.fs
1.6 pazsan 97: [THEN]
1.13 ! jwilke 98: include ./toolsext.fs
! 99: include ./tools.fs \ load tools ( .s dump )
! 100: include ./getdoers.fs
! 101: include ./special.fs \ special must be last!
1.1 anton 102:
103: \ Setup 13feb93py
104:
105: here normal-dp !
106: tudp H @ minimal udp !
107: decimal
108:
1.4 jwilke 109: has? header [IF]
1.11 pazsan 110: \ UNLOCK
111: here >address 2 cells ! \ image size
112: ' boot >body 8 cells A! \ Entry point
113: \ LOCK
1.1 anton 114: [ELSE]
115: >boot
116: [THEN]
117:
118: UNLOCK Tlast @
119: LOCK
1.9 pazsan 120: 1 cells - dup forth-wordlist cell+ ! Last !
1.1 anton 121: .unresolved
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>