forth: Forth-ify "(parse*)"

This commit is contained in:
Virgil Dupras 2020-03-30 14:49:20 -04:00
parent f9d45f7f53
commit a9cf861cfd
3 changed files with 13 additions and 18 deletions

Binary file not shown.

View File

@ -129,6 +129,8 @@ LIT:
.dw CINPTR
.dw SYSVNXT
.dw FLAGS
; 46
.dw PARSEPTR
; *** Code ***
forthMain:
@ -148,10 +150,6 @@ forthMain:
ld (CURRENT), hl
ld hl, HERE_INITIAL
ld (HERE), hl
; Set up PARSEPTR
ld hl, .parseName
call find
ld (PARSEPTR), de
; Set up SYSVNXT
ld hl, SYSVBUF
ld (SYSVNXT), hl
@ -160,12 +158,10 @@ forthMain:
push de
jp EXECUTE+2
.parseName:
.db "(parse)", 0
.bootName:
.db "BOOT", 0
.fill 89
.fill 105
; STABLE ABI
; Offset: 00cd
@ -814,17 +810,10 @@ CURRENT_:
.dw sysvarWord
.dw CURRENT
.db "(parse*)"
.dw $-CURRENT_
.db 8
PARSEPTR_:
.dw sysvarWord
.dw PARSEPTR
.fill 77
.fill 92
.db "_bend"
.dw $-PARSEPTR_
.dw $-CURRENT_
.db 5
; Offset: 0647
.out $

View File

@ -60,6 +60,11 @@
[ JTBL 44 + @ LITN ]
;
: (parse*)
( JTBL+46 == PARSEPTR )
[ JTBL 46 + @ LITN ]
;
: QUIT
0 _c FLAGS _c ! _c (resRS)
LIT< INTERPRET (find) _c DROP EXECUTE
@ -154,12 +159,13 @@
EXECUTE
0 _c FLAGS _c !
ELSE
(parse*) _c @ EXECUTE
_c (parse*) _c @ EXECUTE
THEN
AGAIN
;
: BOOT
LIT< (parse) (find) _c DROP _c (parse*) _c !
LIT< (c<) (find) NOT IF LIT< KEY (find) _c DROP THEN
( JTBL+40 == CINPTR )
[ JTBL 40 + @ LITN ] _c !
@ -190,7 +196,7 @@
( is word )
IF _c DUP _c IMMED? IF EXECUTE ELSE , THEN
( maybe number )
ELSE (parse*) _c @ EXECUTE _c LITN THEN
ELSE _c (parse*) _c @ EXECUTE _c LITN THEN
AGAIN
; IMMEDIATE