From 36e200adbbd2114f853677c919096cebd6f318d1 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Mon, 30 Mar 2020 17:59:30 -0400 Subject: [PATCH] forth: Forth-ify "SCPY" --- emul/forth/z80c.bin | Bin 1512 -> 1549 bytes forth/forth.asm | 18 ++---------------- forth/icore.fs | 4 ++-- forth/z80a.fs | 2 ++ forth/z80c.fs | 18 ++++++++++++++++++ 5 files changed, 24 insertions(+), 18 deletions(-) diff --git a/emul/forth/z80c.bin b/emul/forth/z80c.bin index 03f9ff6bd6728ef02e081867f346a34c208a54d8..ca8ccbe7b1b94b8d810bd8110ab5ac7e5c4f8e5c 100644 GIT binary patch delta 374 zcmXwzze~eV5XUd?z2xObjZ~4^Vr)>vrwHOEB9>4y6t&be2;vmPsf*a%>L7G+dYk?S z3gRXXog9itp-Z7oK~M-thi>X1zEoZAj?eddci+f3PuzZ^H49o8nEI9k=saYglavO% zoGS@s8Bsmv|-(x`WtZ za8x~*8wP5ErMWaj1Q>tDS?P>_;`v2SXTp_Vod9Hl4T-2r>sWvVGX|m7rSCMZHb}5X zL+%kKU+97I$ZKRW`KoiJ`KSHT8ujILY4m1<6;besLQ}oZki& et0Mo(5S*H@WY}N|f(?EpXJ}h|tK%>JBwIh|_+Z@t delta 322 zcmeC>dBMHmAJb$;W)W6bU(XPk$u`Uytbasi@F+~qWDaATG5G+qs^o1>M<$Je#G>L< zO@0P;J_cD%SN8i%EDX$(|1rxmCQO!N(PGx+VxH{HA}zR!^9K8Cb`Yt+z{n8IzH4$h zi$;AZS0dXIE{HBired~wrg#4xnZo^pTx1wn_!txz_+ISin#^__stKa}K2XtKHjo_9 z`qaFVqDoC|ko6$L?{Ouuz%0pTPh{K0d7Qn0EgNj{8K8VNI|p+c7f8h!pp3pFlc!&Z zYfwOtYluAqCm+K-E=SJ$OcFqg85w2(6?8BwFff2w^-LTLt0()iDlx8}T)=9<=r?&K gs|*(pH_#aj9L)E)CZA`OVqXn3w}biW C@ A, ; 0xeb OP1 EXDEHL, 0x76 OP1 HALT, +0x12 OP1 LD(DE)A, +0x1a OP1 LDA(DE), 0xc9 OP1 RET, 0x17 OP1 RLA, 0x07 OP1 RLCA, diff --git a/forth/z80c.fs b/forth/z80c.fs index 0f30aed..a673dd9 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -379,6 +379,7 @@ CODE (parsed) CODE (find) HL POPqq, + chkPS, ( 3 == find ) 3 CALLnn, 10 JRZe, ( found ) @@ -392,3 +393,20 @@ CODE (find) DE 1 LDddnn, DE PUSHqq, ;CODE + +CODE SCPY + HL POPqq, + chkPS, + DE HERE LDdd(nn), + B 0 LDrn, +( loop ) + A (HL) LDrr, + LD(DE)A, + HL INCss, + DE INCss, + B INCr, + A ORr, + -6 JRNZe, ( loop ) + DE A LD(dd)r + HERE DE LD(nn)dd, +;CODE