1 \ This program is free software: you can redistribute it and/or modify
2 \ it under the terms of the GNU General Public License as published by
3 \ the Free Software Foundation, either version 3 of the License, or
4 \ (at your option) any later version.
6 \ This program is distributed in the hope that it will be useful,
7 \ but WITHOUT ANY WARRANTY; without even the implied warranty of
8 \ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
9 \ GNU General Public License for more details.
11 \ You should have received a copy of the GNU General Public License
12 \ along with this program. If not, see <http://www.gnu.org/licenses/>.
13 16500 execute WORD 16500 29 execute
14 word DEFINE 29 29 execute
15 \ word EXECUTE 12 define
18 word MODE 14336 define
19 word EXECUTE-MODE 16680 define
20 word EXECUTE-NUM 16720 define
21 word INTERPRET 16400 define
23 word WORD-START 20 define
24 word WORD-PUT 19 define
25 word WORD-END 23 define
26 word STRING-START 39 define
27 word STRING-PUT 40 define
28 word STRING-END 41 define
31 word FIND-DOES 44 define
32 word DEFINE-DOES 45 define
33 word QUIT 16384 define
36 word !CHANNEL 35 define
65 word word find , word find find , word ; find ,
68 ' word , ' here , ' define , ' ; ,
71 : IWRITE-MODE ' dup , ' JNZ: , here 12 + , ' 2drop , ' ; ,
72 ' 2dup , ' find , ' dup , ' JZ: , here 16 + , ' , , ' 2drop , ' ; ,
73 ' drop , ' LIT , ' LIT , ' , , ' EXECUTE-NUM , ' , , ' ; ,
75 : i ' LIT , ' MODE , ' LIT , ' IWRITE-MODE , ' ! , ' ; ,
78 \: e LIT MODE LIT EXECUTE-MODE ! ;
79 \: :> word find here define-does ;
80 \' :> \dup \define-does
81 \: FINISH-" DROP STRING-END ;
82 \: " STRING-START \: KLOOP KEY 34 =? JNZ: FINISH-" STRING-PUT JMP: KLOOP
83 \:> " " swap lit lit , , lit lit , , ;
84 \: IF JZ: \here \8 \+ \, ; word 2drop ;
85 \:> IF \: DOIF LIT JZ: , HERE DUP , ;
87 \:> ELSE \: DOELSE LIT JMP: , HERE DUP , SWAP HERE ! ;
89 \:> THEN \: DOTHEN HERE ! ;
92 \doif dup find-does dup
93 \doif swap drop rot 2drop execute ;
94 \dothen drop , 2drop ;
95 \dothen drop lit lit , execute-num , ;
97 \: c LIT MODE LIT COMPILE-MODE ! ;
101 " watForth-32 Interactive CLI: