[gforth] / gforth / kernel / main.fs  

gforth: gforth/kernel/main.fs


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

CVS Admin

Powered by ViewCVS 1.0-dev
(Powered by ViewCVS)

ViewCVS and CVS Help