diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 9b8cb46..1b87eeb 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 bbc0764..ce5732c 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -123,7 +123,9 @@ LIT: .dw INITIAL_SP .dw WORDBUF jp flagsToBC +; 35 jp strcmp + .dw RS_ADDR ; *** Code *** forthMain: @@ -174,15 +176,7 @@ forthMain: .bootName: .db "BOOT", 0 -INTERPRET: - .dw compiledWord - .dw LIT - .db "INTERPRET", 0 - .dw FIND_ - .dw DROP - .dw EXECUTE - -.fill 50 +.fill 68 ; STABLE ABI ; Offset: 00cd @@ -632,23 +626,7 @@ EXIT: call popRSIP jp next -; ( R:I -- ) - .db "QUIT" - .dw $-EXIT - .db 4 -QUIT: - .dw compiledWord - .dw NUMBER - .dw 0 - .dw FLAGS_ - .dw STORE - .dw .private - .dw INTERPRET - -.private: - .dw nativeWord - ld ix, RS_ADDR - jp next +.fill 30 abortUnderflow: ld hl, .name @@ -659,7 +637,7 @@ abortUnderflow: .db "(uflw)", 0 .db "(br)" - .dw $-QUIT + .dw $-EXIT .db 4 BR: .dw nativeWord diff --git a/forth/icore.fs b/forth/icore.fs index 1627095..0f31198 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -49,7 +49,9 @@ , ( write! ) ; IMMEDIATE -: ABORT _c (resSP) QUIT ; +: QUIT 0 FLAGS ! _c (resRS) LIT< INTERPRET (find) DROP EXECUTE ; + +: ABORT _c (resSP) _c QUIT ; ( This is only the "early parser" in earlier stages. No need for an abort message ) diff --git a/forth/z80c.fs b/forth/z80c.fs index a9fe873..3846598 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -290,6 +290,11 @@ CODE (resSP) SP JTBL 28 + @ LDdd(nn), ;CODE +CODE (resRS) + ( RS_ADDR == JTBL+38 ) + IX JTBL 38 + @ LDddnn, +;CODE + CODE SCMP DE POPqq, HL POPqq,