diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 0e6fbf1..6c75407 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 26ffeba..4feaf28 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -830,27 +830,10 @@ CIN: .dw EXIT -; ( c -- f ) -; 33 CMP 1 + NOT -; The NOT is to normalize the negative/positive numbers to 1 or 0. -; Hadn't we wanted to normalize, we'd have written: -; 32 CMP 1 - - .db "WS?" - .dw $-CIN - .db 3 -ISWS: - .dw compiledWord - .dw NUMBER - .dw 33 - .dw CMP - .dw NUMBER - .dw 1 - .dw PLUS - .dw NOT - .dw EXIT +.fill 24 .db "NOT" - .dw $-ISWS + .dw $-CIN .db 3 NOT: .dw nativeWord diff --git a/forth/icore.fs b/forth/icore.fs index e0067bd..ea4ef4b 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -78,9 +78,14 @@ HERE @ 1 + HERE ! ; +( The NOT is to normalize the negative/positive numbers to 1 + or 0. Hadn't we wanted to normalize, we'd have written: + 32 CMP 1 - ) +: WS? 33 CMP 1 + NOT ; + : TOWORD BEGIN - C< DUP WS? NOT IF EXIT THEN DROP + C< DUP _c WS? NOT IF EXIT THEN DROP AGAIN ; @@ -96,7 +101,7 @@ OVER ! ( a ) 1 + ( a+1 ) C< ( a c ) - DUP WS? + DUP _c WS? UNTIL ( a this point, PS is: a WS ) ( null-termination is already written )