-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathturnkey_fs
71 lines (57 loc) · 2.04 KB
/
turnkey_fs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
\ turnkey_fs
\ This file is part of Sfera, a library for SuperForth
\ http://programandala.net/en.program.sfera.html
\ Author: Gerry Jackson, 1985.
\ Modified by Marcos Cruz (programandala.net), 2016.
\ XXX UNDER DEVELOPMENT -- not usable yet
\ ==============================================================
\ License
\ You may do whatever you want with this work, so long as you
\ retain the copyright/authorship/acknowledgment/credit
\ notice(s) and this license in all redistributed copies and
\ derived works. There is no warranty.
\ ==============================================================
\ History
\ 2016-01-12: Code copied from SuperForth 2.0. Layout changes.
\ Renamed words. Did some changes after Sfera. Added stack
\ comments. Fixed `map`.
\
\ 2016-01-15: First tries. Some notes.
\
\ 2016-01-23: Check. Note.
\
\ 2016-02-08: Removed `end-of-file`.
\ ==============================================================
: map ( -- )
here 8 + 32856 ! 1550 allot \ block buffer and stack
here 32834 !
here 32838 !
latest ['] cold 4 + !
fence 2+ @ 32840 ! ; \ voc-link
\ XXX OLD
\ : dename ( -- )
\ forth latest
\ begin
\ dup link>name dup c@ /name and erase
\ link>link? 0=
\ until ;
: turnkey ( cfa -- )
[ ' cold 62 + ] literal ! cls
." How much data space? " query bl-word number d->s cr cr
." Return to SuperBASIC with CTRL C, then type:" cr cr
." sexec <filename>," 32776 2@ 4096. d- d.
." ," here 32768 - 4096 + u. ." ," u. cr cr ;
\ XXX TODO save the file here, not in SuperBASIC
: save-application ( "name" -- )
map ' turnkey
\ dename \ XXX OLD
." Then remove SuperForth since it cannot be re-entered." cr cr
sleep ;
\ XXX FIXME -- this works, but the new program,
\ after executing "name", tries to boot as usual, and the
\ patched boot device was not preserved, so BLK1 is not found.
: save-system ( -- )
['] empty-buffers turnkey ;
\ XXX FIXME -- the system is saved, but only words of the
\ original system are preserved, even after setting `fence`.
\ vim: filetype=superforthsfera