mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-23 16:28:05 +11:00
forth: Forth-ify "(parse*)"
This commit is contained in:
parent
f9d45f7f53
commit
a9cf861cfd
Binary file not shown.
@ -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 $
|
||||
|
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user