diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 8c4ec0e..ecf78e0 100644 Binary files a/emul/forth/z80c.bin and b/emul/forth/z80c.bin differ diff --git a/forth/forth.asm b/forth/forth.asm index 21a184c..db20979 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -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 $ diff --git a/forth/icore.fs b/forth/icore.fs index 51c0d5c..1461b4a 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -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