diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 17e8358..7736d7e 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 3a7ae57..096af24 100644 --- a/forth/forth.asm +++ b/forth/forth.asm @@ -928,22 +928,10 @@ DROP: pop hl jp next -; ( a b -- b a ) - .db "SWAP" - .dw $-DROP - .db 4 -SWAP: - .dw nativeWord - pop hl - call chkPS - ex (sp), hl - push hl - jp next - -.fill 149 +.fill 167 .db "_bend" - .dw $-SWAP + .dw $-DROP .db 5 ; Offset: 06ee .out $ diff --git a/forth/icore.fs b/forth/icore.fs index fa3220b..1627095 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -122,7 +122,7 @@ ( Adjust HERE -1 because SCPY copies the null ) HERE @ 1 _c - ( h h' ) _c DUP HERE ! ( h h' ) - SWAP _c - ( sz ) + _c SWAP _c - ( sz ) ( write prev value ) HERE @ CURRENT @ _c - , ( write size ) diff --git a/forth/z80c.fs b/forth/z80c.fs index f04556d..a9fe873 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -39,6 +39,15 @@ CODE DUP HL PUSHqq, ( A ) ;CODE +( a b -- b a ) +CODE SWAP + HL POPqq, ( B ) + DE POPqq, ( A ) + chkPS, + HL PUSHqq, ( B ) + DE PUSHqq, ( A ) +;CODE + ( a b -- a b a ) CODE OVER HL POPqq, ( B )