File:
[gforth] /
gforth /
Attic /
dumpimage.fs
Revision
1.7:
download - view:
text,
annotated -
select for diffs
Wed Aug 21 14:58:39 1996 UTC (27 years, 7 months ago) by
anton
Branches:
MAIN
CVS tags:
v0-2-1,
v0-2-0,
HEAD
a little cleanup in 386.h
renamed special: to interpret/compile:
renamed save-string to save-mem
added extend-mem
replaced (name>) with ((name>))
replaced name> with name>int and name>comp
renamed compile-only to compile-only-error
replaced xt>i with name>int
replaced xt>c with name>comp
removed xt>s
removed found
search-wordlist now delivers interpretation-xt
replaced (sfind) with find-name
replaced C' with COMP' and [C'] with [COMP']
removed S' and [S']
added hex.
added some helper words
adapted other words to the changes
started documenting the intergration of Gforth in applications
1: \ image dump 15nov94py
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: : save-string-dict { addr1 u -- addr2 u }
22: here { addr2 }
23: u allot
24: addr1 addr2 u move
25: addr2 u ;
26:
27: : update-image-included-files ( -- )
28: included-files 2@ { addr cnt }
29: image-included-files 2@ { old-addr old-cnt }
30: align here { new-addr }
31: cnt 2* cells allot
32: new-addr cnt image-included-files 2!
33: old-addr new-addr old-cnt 2* cells move
34: cnt old-cnt
35: U+DO
36: addr i 2* cells + 2@ save-string-dict
37: new-addr i 2* cells + 2!
38: LOOP ;
39:
40:
41: : dump-fi ( addr u -- )
42: w/o bin create-file throw >r
43: update-image-included-files
44: here forthstart - forthstart 2 cells + !
45: forthstart
46: begin \ search for start of file ("#! " at a multiple of 8)
47: 8 -
48: dup 3 s" #! " compare 0=
49: until ( imagestart )
50: here over - r@ write-file throw
51: r> close-file throw ;
52:
53: : savesystem ( "name" -- ) \ gforth
54: name dump-fi ;
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>