diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 8bee94b..86b2877 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 db6cd21..f31284b 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -982,25 +982,9 @@ PLUS: push hl jp next -.fill 42 - -; ( n1 n2 -- f ) - .db "CMP" - .dw $-PLUS - .db 3 -CMP: - .dw nativeWord - pop hl - pop de - call chkPS - or a ; clear carry - sbc hl, de - call flagsToBC - push bc - jp next - +.fill 65 .db "_bend" - .dw $-CMP + .dw $-PLUS .db 5 ; Offset: 06ee .out $ diff --git a/forth/icore.fs b/forth/icore.fs index ad6d542..663c843 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -81,7 +81,7 @@ ( 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 ; +: WS? 33 _c CMP 1 + NOT ; : TOWORD BEGIN diff --git a/forth/z80c.fs b/forth/z80c.fs index cdc5925..edf882c 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -266,3 +266,14 @@ CODE SCMP BC PUSHqq, ;CODE +CODE CMP + HL POPqq, + DE POPqq, + chkPS, + A ORr, ( clear carry ) + DE SBCHLss, + ( JTBL+32 == flagsToBC ) + JTBL 32 + CALLnn, + BC PUSHqq, +;CODE +