diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 913ef96..22f9c50 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 b76d4c0..455d6a3 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -952,25 +952,10 @@ DUP: push hl jp next -; ( a b -- a b a ) - .db "OVER" - .dw $-DUP - .db 4 -OVER: - .dw nativeWord - pop hl ; B - pop de ; A - call chkPS - push de - push hl - push de - jp next - - -.fill 112 +.fill 132 .db "_bend" - .dw $-OVER + .dw $-DUP .db 5 ; Offset: 06ee .out $ diff --git a/forth/icore.fs b/forth/icore.fs index 072f4ca..cbc22c2 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -98,7 +98,7 @@ BEGIN ( We take advantage of the fact that char MSB is always zero to pre-write our null-termination ) - OVER ! ( a ) + _c OVER ! ( a ) 1 _c + ( a+1 ) C< ( a c ) DUP _c WS? diff --git a/forth/z80c.fs b/forth/z80c.fs index d1809a5..bfca503 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -31,6 +31,16 @@ CODE ROT BC PUSHqq, ( A ) ;CODE +( a b -- a b a ) +CODE OVER + HL POPqq, ( B ) + DE POPqq, ( A ) + chkPS, + DE PUSHqq, ( A ) + HL PUSHqq, ( B ) + DE PUSHqq, ( A ) +;CODE + ( a b -- a b a b ) CODE 2DUP HL POPqq, ( B )