File:
[gforth] /
gforth /
Attic /
main.fs
Revision
1.21:
download - view:
text,
annotated -
select for diffs
Wed Apr 17 16:39:42 1996 UTC (28 years ago) by
anton
Branches:
MAIN
CVS tags:
HEAD
changed image file format:
now every stack has its own size spec in the image
size changes through the command line are passed to the image (and
saved with savesystem)
added a checksum to protect against incompatible binary/image combinations
(e.g., direct threaded binary with indirect threaded image)
the preamble specifies an interpreter and is propagated by save-system
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: [IFUNDEF] vocabulary include search-order.fs [THEN]
29: \ include etags.fs
30:
31: include cross.fs \ include cross-compiler
32:
33: decimal
34:
35: cell 2 = [IF] 32 [ELSE] 256 [THEN] KB makekernal ( size )
36: \ create image-header
37: 0 A, \ base address
38: 0 , \ checksum
39: 0 , \ image size (without tags)
40: , \ dict size
41: 16 KB , \ data stack size
42: 16 KB , \ FP stack size
43: 16 KB , \ return stack size
44: 16 KB , \ locals stack size
45: 0 A, \ code entry point
46: 0 A, \ throw entry point
47: 16 KB , \ unused (possibly tib stack size)
48: 0 , \ unused
49:
50: UNLOCK ghost - drop \ ghost must exist because - would be treated as number
51: LOCK
52:
53: 0 AConstant forthstart
54:
55: include aliases.fs \ include primitive aliases
56: \ include cond.fs \ conditional compile
57: \ include patches.fs \ include primitive patches
58:
59: include vars.fs \ variables and other stuff
60: include add.fs \ additional things
61: include errore.fs
62: include kernal.fs \ load kernal
63: include version.fs
64: include extend.fs \ load core-extended
65: include tools.fs \ load tools ( .s dump )
66: \ include words.fs
67: \ include wordinfo.fs
68: \ include see.fs \ load see
69: include toolsext.fs
70: \ include search-order.fs
71:
72: \ Setup 13feb93py
73:
74: here normal-dp !
75: tudp H @ minimal udp !
76: decimal
77:
78: here 2 cells ! \ image size
79: ' boot >body 8 cells ! \ Entry point
80:
81: UNLOCK Tlast @
82: LOCK
83: 1 cells - dup forth-wordlist ! Last !
84: .unresolved
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>