diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 8eb6d75..cdba5f0 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 cdf0455..6b323d9 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -743,30 +743,10 @@ FIND_: push de jp next -.fill 41 - - .db "NOT" - .dw $-FIND_ - .db 3 -NOT: - .dw nativeWord - pop hl - call chkPS - ld a, l - or h - ld hl, 0 - jr nz, .skip ; true, keep at 0 - ; false, make 1 - inc hl -.skip: - push hl - jp next - - -.fill 362 +.fill 427 .db "_bend" - .dw $-NOT + .dw $-FIND_ .db 5 ; Offset: 0647 .out $ diff --git a/forth/icore.fs b/forth/icore.fs index b4e4ec5..a6f5589 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -85,7 +85,7 @@ ( This is only the "early parser" in earlier stages. No need for an abort message ) : (parse) - _c (parsed) NOT IF _c ABORT THEN + _c (parsed) _c NOT IF _c ABORT THEN ; ( a -- ) @@ -94,7 +94,7 @@ _c DUP ( a a ) _c C@ ( a c ) ( exit if null ) - _c DUP NOT IF _c 2DROP EXIT THEN + _c DUP _c NOT IF _c 2DROP EXIT THEN _c EMIT ( a ) 1 _c + ( a+1 ) AGAIN @@ -117,11 +117,11 @@ ( 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 _c CMP 1 _c + NOT ; +: WS? 33 _c CMP 1 _c + _c NOT ; : TOWORD BEGIN - _c C< _c DUP _c WS? NOT IF EXIT THEN _c DROP + _c C< _c DUP _c WS? _c NOT IF EXIT THEN _c DROP AGAIN ; @@ -176,7 +176,7 @@ : BOOT LIT< (parse) (find) _c DROP _c (parse*) _c ! - LIT< (c<) (find) NOT IF LIT< KEY (find) _c DROP THEN + LIT< (c<) (find) _c NOT IF LIT< KEY (find) _c DROP THEN ( 48 == CINPTR ) [ 48 @ LITN ] _c ! LIT< (c<$) (find) IF EXECUTE ELSE _c DROP THEN diff --git a/forth/z80c.fs b/forth/z80c.fs index 0accf92..ca4f799 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -149,6 +149,19 @@ CODE XOR HL PUSHqq, ;CODE +CODE NOT + HL POPqq, + chkPS, + A L LDrr, + H ORr, + HL 0 LDddnn, + 3 JRNZe, ( skip) + ( false, make 1 ) + HL INCss, +( skip ) + HL PUSHqq, +;CODE + CODE + HL POPqq, DE POPqq,