-
Notifications
You must be signed in to change notification settings - Fork 1
/
MAKECONS
65 lines (47 loc) · 1.63 KB
/
MAKECONS
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
\ extend the kernel for the console FCONS
\
fload primutil \ primitive utilities
fload dump
fload forget
fload dthread
2 to #threads \ default number of dictionary threads
fload order
fload assert
fload primhash \ primitive hash functions for OOP later
fload see
fload interpif \ interpretive conditionals
fload debug
fload build \ experimental version of BUILD DO: defining wordset
fload words
fload pasm
fload disarm
fload utils \ load other misc utility words
fload args
fload OS
cr cr .( Extensions Loaded, ) count-words . .( words in dictionary) cr
variable seed
: initiate-seed ( -- ) 74755 seed ! ;
: random ( -- n ) seed @ 1309 * 13849 + 65535 and dup seed ! ;
: rnd ( n -- n ) random swap mod ;
\ ****************************
\ do something at boot time
create hello$ 0 c, 260 allot
: hello+" ( -<text">- ) \ append to hello string
'"' word count hello$ +place ;
hello+" Forth for Risc OS"
: hello ( -- ) \ startup stuff
?loading off \ we aren't loading initially
only forth also definitions
decimal
initiate-seed
0 to source-id \ not loading from a file yet
initialization-chain do-chain
4 bcolour cls hello$ count type
cr .words ." words in the dictionary" ;
' hello is boot
mark empty
here fence !
source-id close-file drop
cur-file off \ clear the default file
cur-line off \ clear the current line
fsave FCONS