commit 1c9bada9e3ee47a3b04d6002757feae802be4ad7
parent 87422ca73e4b43264119b9b3ef328b4cc8ffc455
Author: Henry Wilson <m3henry@googlemail.com>
Date: Mon, 31 Jul 2017 19:10:49 +0100
compiler first working state
Diffstat:
2 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/macros.i b/macros.i
@@ -3,7 +3,7 @@
.endm
.macro forthword
- do ENTER
+ .quad enter
.endm
.macro endword
diff --git a/main.s b/main.s
@@ -128,17 +128,14 @@ verb forth INTERPRET
goto 2f
1: do DUP
const 8
- do plus
- do SWAP
+ do minus
do fetch
get MODE
do AND
if 1f
do EXECUTE
goto 2f
- 1: say "!"
- do dot
- saycr "!"
+ 1: do COMPILE
2: get numin
get numtib
do less
@@ -243,7 +240,7 @@ verb forth FIND
do plus
do STRCMP
unless 1f
- const 16
+ const 24
do plus
do SWAP
do fetch
@@ -286,19 +283,17 @@ verb forth COMPILE "COMPILE" immediate
verb forth compnew "\x3A" # :
do modeC
+ get HERE
get LAST
do COMPILE
- endword
do WORD
- do DUP
do fetch
+ const 8
do plus
- set HERE
+ do ALLOT
do TRUE
do COMPILE
- get HERE
- const 8
- do plus
+ const enter
do COMPILE
endword
@@ -306,6 +301,7 @@ verb forth compend "\x3B" immediate # ;
const EXIT
do COMPILE
do modeI
+ set LAST
endword
# User Words