diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 801370e..19c2a3f 100644 Binary files a/emul/forth/z80c.bin and b/emul/forth/z80c.bin differ diff --git a/forth/dictionary.txt b/forth/dictionary.txt index b6953d4..2759cc0 100644 --- a/forth/dictionary.txt +++ b/forth/dictionary.txt @@ -100,6 +100,7 @@ DUP a -- a a OVER a b -- a b a ROT a b c -- b c a SWAP a b -- b a +2DROP a a -- 2DUP a b -- a b a b 2OVER a b c d -- a b c d a b 2SWAP a b c d -- c d a b diff --git a/forth/icore.fs b/forth/icore.fs index 230fc44..d7e8420 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -74,7 +74,7 @@ _c DUP ( a a ) _c C@ ( a c ) ( exit if null ) - _c DUP NOT IF DROP DROP EXIT THEN + _c DUP NOT IF _c 2DROP EXIT THEN _c EMIT ( a ) 1 _c + ( a+1 ) AGAIN @@ -121,7 +121,7 @@ UNTIL ( a this point, PS is: a WS ) ( null-termination is already written ) - DROP DROP + _c 2DROP [ JTBL 30 + @ LITN ] ; diff --git a/forth/z80c.fs b/forth/z80c.fs index 3846598..f91760c 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -69,6 +69,12 @@ CODE 2DUP HL PUSHqq, ( B ) ;CODE +( a b -- ) +CODE 2DROP + HL POPqq, + HL POPqq, +;CODE + ( a b c d -- a b c d a b ) CODE 2OVER