-
Notifications
You must be signed in to change notification settings - Fork 3
/
IKForth-test.4th
136 lines (98 loc) · 1.68 KB
/
IKForth-test.4th
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
: TEST-LOCALS requires" lib/~ik/locals-test.4th" ;
: TEST-DUMP
CR
['] DUMP CODE>NAME
DUP 64 DUMP
0 DUMP/LINE !
DUP 64 DUMP
32 DUMP/LINE !
DUP 64 DUMP
DROP
;
: TEST-STRING requires" test/string-test.4th" ;
: TEST-HOSTENV requires" test/hostenv-test.4th" ;
CODE A
POP EAX
INC EAX
PUSH EAX
NEXT
END-CODE
\ : a ['] ST RUSH ." test" ;
\ : a create , does> ? ;
\ 123 a b
: NOP : POSTPONE ; R> >R ;
: c3
[ CR H.S ] [: [ CR H.S ] ;] DROP
;
: a 2 LOCALS-FRAME l0! l1! cr .s cr ." a " l1@ . l0@ . LOCALS-UNFRAME ;
: b 3 LOCALS-FRAME l0! l1! l2! 1 l1@ 10 + a cr ." b " l2@ . l1@ . l0@ . LOCALS-UNFRAME ;
1 2 3 b
: c {: local0 local1 :}
local0 H.8 local1 H.8
{: local2 local3 :}
;
: c1 {: local0 local1 :}
123 TO LOCAL0
;
: c2 {: local0 local1 :}
123 +TO LOCAL0
;
: c3 {: local0 :}
[: {: local2 :} [: {: local3 :} ;] DROP ;] DROP
123 +TO LOCAL0
;
\ CR CR
\ see c
\ CR CR
\ see c1
\ CR CR
\ see c2
\ CR CR
\ see c3
CR
KEY? .
CR 1 MAKE-BLOCK-FILE-NAME CR DUMP
CR 2 MAKE-BLOCK-FILE-NAME CR DUMP
HEX 8000000000000000. 7FFFFFFFFFFFFFFF. CR H.S 2OVER 2OVER CR H.S CR D- D. 2OVER 2OVER D< . DU< .
: SW LOCAL B LOCAL C BEGIN FALSE LOCAL D D WHILE REPEAT B C ;
1 2
CR .S
SW
CR .S
CR
SEE SW
DECIMAL
: test-ekey
begin
CR ." -------------------------------------------" CR
ekey
dup ekey>char swap 'q' = and if bye then
cr h.8
again
;
\ test-ekey
: t2 postpone throw ; immediate
: t3 t2 ;
: t4 exit ;
cr
see t2
cr
see t3
cr
see t4
DEPTH NDROP
CR .( 2PICK )
cr .s
1. 2. 3. 2 2pick
cr .s
1. d=
cr .
DEPTH NDROP
CR .( 2ROLL )
cr .s
1. 2. 3. 1 2ROLL
cr .s
CR
2. d= . 3. d= . 1. d= .
CR
S" test/literal-ext-test.4th" INCLUDED