commit 68df549b136c0c2f6d459246f16fb6ce164be111
parent 3b30307c5f3b6f51b17647d107fc844ef16087f8
Author: Henry Wilson <m3henry@googlemail.com>
Date: Sun, 30 Jul 2017 13:09:07 +0100
tidying
Diffstat:
M | main.s | | | 44 | ++++++++++++++++++++++---------------------- |
1 file changed, 22 insertions(+), 22 deletions(-)
diff --git a/main.s b/main.s
@@ -70,6 +70,24 @@ verb forth QUIT
escape 0
do HALT
+# Interpreter
+
+verb forth PAD
+ scratch 90
+ endword
+
+verb forth TIB
+ scratch 80
+ endword
+
+verb forth numtib "\#TIB"
+ variable
+ endword
+
+verb forth numin "\#IN"
+ variable
+ endword
+
verb forth INTERPRET
set numin 0
3: do WORD
@@ -209,6 +227,8 @@ verb forth FIND
do FALSE
endword
+# User Words
+
verb forth greet GREET
say "Hello, World!"
do CR
@@ -225,7 +245,8 @@ verb forth FLAG
endword
line: forthword
- 1: do STAR
+ 1: const '*'
+ do EMIT
do dec
do DUP
if 1b
@@ -233,32 +254,11 @@ line: forthword
do CR
endword
-verb forth STAR
- const '*'
- do EMIT
- endword
-
verb forth SPACE
const ' '
do EMIT
endword
-verb forth PAD
- scratch 90
- endword
-
-verb forth TIB
- scratch 80
- endword
-
-verb forth numtib "\#TIB"
- variable
- endword
-
-verb forth numin "\#IN"
- variable
- endword
-
verb forth CR
const '\n'
do EMIT