Make (find) 2-layered, the lower layer having CURRENT as a param

This commit is contained in:
Virgil Dupras 2020-04-09 11:20:54 -04:00
parent 66dc621919
commit 1b6286dcfe
5 changed files with 13 additions and 6 deletions

Binary file not shown.

Binary file not shown.

View File

@ -123,14 +123,16 @@ PC ORG @ 1 + ! ( main )
0x08 LDHL(nn),
RAMSTART 0x02 + LD(nn)HL, ( RAM+02 == CURRENT )
RAMSTART 0x04 + LD(nn)HL, ( RAM+04 == HERE )
EXDEHL,
HL L1 @ LDddnn,
0x03 CALLnn, ( 03 == find )
DE PUSHqq,
L2 @ 2 + JPnn,
PC ORG @ 4 + ! ( find )
( Find the entry corresponding to word where (HL) points to
and sets DE to point to that entry. Z if found, NZ if not.
( Find the entry corresponding to word name where (HL) points
to in dictionary having its tip at DE and sets DE to point
to that entry. Z if found, NZ if not.
)
BC PUSHqq,
@ -154,7 +156,6 @@ PC ORG @ 4 + ! ( find )
adjust. Because the compare loop pre-decrements, instead
of DECing HL twice, we DEC it once. )
HL DECss,
DE RAMSTART 0x02 + LDdd(nn), ( RAM+02 == CURRENT )
L3 BSET ( inner )
( DE is a wordref, first step, do our len correspond? )
HL PUSHqq, ( --> 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:

View File

@ -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

View File

@ -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,