diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 86b2877..913ef96 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 f31284b..b76d4c0 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -967,24 +967,10 @@ OVER: jp next -.fill 31 +.fill 112 -; ( a b -- c ) A + B - .db "+" - .dw $-OVER - .db 1 -PLUS: - .dw nativeWord - pop hl - pop de - call chkPS - add hl, de - push hl - jp next - -.fill 65 .db "_bend" - .dw $-PLUS + .dw $-OVER .db 5 ; Offset: 06ee .out $ diff --git a/forth/icore.fs b/forth/icore.fs index 663c843..072f4ca 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -65,7 +65,7 @@ ( exit if null ) DUP NOT IF DROP DROP EXIT THEN _c EMIT ( a ) - 1 + ( a+1 ) + 1 _c + ( a+1 ) AGAIN ; @@ -75,13 +75,13 @@ : C, HERE @ _c C! - HERE @ 1 + HERE ! + HERE @ 1 _c + 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 _c CMP 1 + NOT ; +: WS? 33 _c CMP 1 _c + NOT ; : TOWORD BEGIN @@ -99,7 +99,7 @@ ( We take advantage of the fact that char MSB is always zero to pre-write our null-termination ) OVER ! ( a ) - 1 + ( a+1 ) + 1 _c + ( a+1 ) C< ( a c ) DUP _c WS? UNTIL @@ -111,7 +111,7 @@ : LITN ( JTBL+24 == NUMBER ) - JTBL 24 + , + JTBL 24 _c + , , ; diff --git a/forth/z80c.fs b/forth/z80c.fs index edf882c..d1809a5 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -111,6 +111,14 @@ CODE XOR HL PUSHqq, ;CODE +CODE + + HL POPqq, + DE POPqq, + chkPS, + DE ADDHLss, + HL PUSHqq, +;CODE + CODE - DE POPqq, HL POPqq,