From 1b6286dcfe8c2d8846eed22fc302980e349d1992 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Thu, 9 Apr 2020 11:20:54 -0400 Subject: [PATCH] Make (find) 2-layered, the lower layer having CURRENT as a param --- emul/forth/boot.bin | Bin 451 -> 451 bytes emul/forth/z80c.bin | Bin 1681 -> 1702 bytes forth/boot.fs | 10 ++++++---- forth/icore.fs | 3 +++ forth/z80c.fs | 6 ++++-- 5 files changed, 13 insertions(+), 6 deletions(-) diff --git a/emul/forth/boot.bin b/emul/forth/boot.bin index 879248db975e385f4e02c4a4a215822dad43e61d..bb5b52c4063aacdf03c1f7485c6cb5cae940d1e6 100644 GIT binary patch delta 143 zcmX@ie3)7H@G^$OM;XB2a2w;{JjTQPjEAKd|Gs269Ljjuig706az>EsVK&CY-4k_t zrC%#9WH`&raP{y+hNDk`QtRJttbFTYtD)zwJ@H0_t}5f(Xr>oX1y8jYUT6cs_P0e3 nFGxJT`}Cn8!-wr}gDyy1KP$^{)^lVNS-wT@!VC z3_DXJ+(-9&3?-P#y)zF2JPd2b&}gl$xBtO<4552{HFwK}gIdh_*ps z&;_)yP3ve86fIi03R?t$1U8dKyP5Z4zHgrQG@f!f`kt(8R*!bJ<(U}?Wmp9fw25XB%rH8b%m?jX>Q+?=bssKAdp zO5n<1$tSSvdbvWcJO^o>mIjS5cvm;p5OLI_ zwZFZ(?)f&D4F|w2lhkD{yn>%Em&$n`0c(*uB<2^2Wq%ahMvQ$kiPWP7 zQJd_D_lYLiQcuj8I1w>R(yqs^Dr)%b7zY~{I@6jgZKMrKlN{3~$*CkCqvzs5E%RaO zikv#&gSrpYDc>Q1`rwI-!E+EX>(pR-hPZ|v)KP)Zi6=u6E1q8{bzkJb6|TyP)S@fe rv_&McF$3EcCWI@ryIvpA3BE%AHcaakje5^~TE| lvl 1 ) @@ -241,6 +242,7 @@ PC ORG @ 0x15 + ! ( popRS ) '(' A, 'u' A, 'f' A, 'l' A, 'w' A, ')' A, 0 A, L1 BSET ( abortUnderflow ) HL PC 7 - LDddnn, + DE RAMSTART 0x02 + LDdd(nn), ( RAM+02 == CURRENT ) 0x03 CALLnn, ( find ) DE PUSHqq, L2 @ 2 + JPnn, ( EXECUTE, skip nativeWord ) @@ -366,7 +368,7 @@ PC ORG @ 0x22 + ! ( litWord ) JPNEXT, ( filler ) -NOP, NOP, NOP, NOP, NOP, NOP, +NOP, NOP, NOP, NOP, NOP, ( DICT HOOK ) ( This dummy dictionary entry serves two purposes: diff --git a/forth/icore.fs b/forth/icore.fs index ff15d27..e445dd1 100644 --- a/forth/icore.fs +++ b/forth/icore.fs @@ -37,6 +37,9 @@ : HERE 0x04 RAM+ ; : CURRENT 0x02 RAM+ ; +( w -- a f ) +: (find) CURRENT @ SWAP _find ; + : QUIT 0 FLAGS ! (resRS) LIT< INTERPRET (find) DROP EXECUTE diff --git a/forth/z80c.fs b/forth/z80c.fs index d2091ec..82dcf86 100644 --- a/forth/z80c.fs +++ b/forth/z80c.fs @@ -354,8 +354,10 @@ CODE CMP BC PUSHqq, ;CODE -CODE (find) - HL POPqq, +( cur w -- a f ) +CODE _find + HL POPqq, ( w ) + DE POPqq, ( cur ) chkPS, ( 3 == find ) 3 CALLnn,