diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 5f84a62..a0a1323 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 2e480e2..d0140c7 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -875,26 +875,11 @@ NOT: push hl jp next -; ( -- c ) -; C< DUP 32 CMP 1 - SKIP? EXIT DROP TOWORD - .db "TOWORD" - .dw $-NOT - .db 6 -TOWORD: - .dw compiledWord - .dw CIN - .dw DUP - .dw ISWS - .dw CSKIP - .dw EXIT - .dw DROP - .dw TOWORD - .dw EXIT -.fill 73 +.fill 100 .db "(parsed)" - .dw $-TOWORD + .dw $-NOT .db 8 PARSED: .dw nativeWord diff --git a/forth/icore.fs b/forth/icore.fs index a7b52da..e0067bd 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -78,12 +78,18 @@ HERE @ 1 + HERE ! ; +: TOWORD + BEGIN + C< DUP WS? NOT IF EXIT THEN DROP + AGAIN +; + ( Read word from C<, copy to WORDBUF, null-terminate, and return, make HL point to WORDBUF. ) : WORD ( JTBL+30 == WORDBUF ) [ JTBL 30 + @ LITN ] ( a ) - TOWORD ( a c ) + _c TOWORD ( a c ) BEGIN ( We take advantage of the fact that char MSB is always zero to pre-write our null-termination )