mirror of
https://github.com/hsoft/collapseos.git
synced 2024-11-27 14:58:06 +11:00
Make (find) 2-layered, the lower layer having CURRENT as a param
This commit is contained in:
parent
66dc621919
commit
1b6286dcfe
Binary file not shown.
Binary file not shown.
@ -123,14 +123,16 @@ PC ORG @ 1 + ! ( main )
|
|||||||
0x08 LDHL(nn),
|
0x08 LDHL(nn),
|
||||||
RAMSTART 0x02 + LD(nn)HL, ( RAM+02 == CURRENT )
|
RAMSTART 0x02 + LD(nn)HL, ( RAM+02 == CURRENT )
|
||||||
RAMSTART 0x04 + LD(nn)HL, ( RAM+04 == HERE )
|
RAMSTART 0x04 + LD(nn)HL, ( RAM+04 == HERE )
|
||||||
|
EXDEHL,
|
||||||
HL L1 @ LDddnn,
|
HL L1 @ LDddnn,
|
||||||
0x03 CALLnn, ( 03 == find )
|
0x03 CALLnn, ( 03 == find )
|
||||||
DE PUSHqq,
|
DE PUSHqq,
|
||||||
L2 @ 2 + JPnn,
|
L2 @ 2 + JPnn,
|
||||||
|
|
||||||
PC ORG @ 4 + ! ( find )
|
PC ORG @ 4 + ! ( find )
|
||||||
( Find the entry corresponding to word where (HL) points to
|
( Find the entry corresponding to word name where (HL) points
|
||||||
and sets DE to point to that entry. Z if found, NZ if not.
|
to in dictionary having its tip at DE and sets DE to point
|
||||||
|
to that entry. Z if found, NZ if not.
|
||||||
)
|
)
|
||||||
|
|
||||||
BC PUSHqq,
|
BC PUSHqq,
|
||||||
@ -154,7 +156,6 @@ PC ORG @ 4 + ! ( find )
|
|||||||
adjust. Because the compare loop pre-decrements, instead
|
adjust. Because the compare loop pre-decrements, instead
|
||||||
of DECing HL twice, we DEC it once. )
|
of DECing HL twice, we DEC it once. )
|
||||||
HL DECss,
|
HL DECss,
|
||||||
DE RAMSTART 0x02 + LDdd(nn), ( RAM+02 == CURRENT )
|
|
||||||
L3 BSET ( inner )
|
L3 BSET ( inner )
|
||||||
( DE is a wordref, first step, do our len correspond? )
|
( DE is a wordref, first step, do our len correspond? )
|
||||||
HL PUSHqq, ( --> lvl 1 )
|
HL PUSHqq, ( --> lvl 1 )
|
||||||
@ -241,6 +242,7 @@ PC ORG @ 0x15 + ! ( popRS )
|
|||||||
'(' A, 'u' A, 'f' A, 'l' A, 'w' A, ')' A, 0 A,
|
'(' A, 'u' A, 'f' A, 'l' A, 'w' A, ')' A, 0 A,
|
||||||
L1 BSET ( abortUnderflow )
|
L1 BSET ( abortUnderflow )
|
||||||
HL PC 7 - LDddnn,
|
HL PC 7 - LDddnn,
|
||||||
|
DE RAMSTART 0x02 + LDdd(nn), ( RAM+02 == CURRENT )
|
||||||
0x03 CALLnn, ( find )
|
0x03 CALLnn, ( find )
|
||||||
DE PUSHqq,
|
DE PUSHqq,
|
||||||
L2 @ 2 + JPnn, ( EXECUTE, skip nativeWord )
|
L2 @ 2 + JPnn, ( EXECUTE, skip nativeWord )
|
||||||
@ -366,7 +368,7 @@ PC ORG @ 0x22 + ! ( litWord )
|
|||||||
JPNEXT,
|
JPNEXT,
|
||||||
|
|
||||||
( filler )
|
( filler )
|
||||||
NOP, NOP, NOP, NOP, NOP, NOP,
|
NOP, NOP, NOP, NOP, NOP,
|
||||||
|
|
||||||
( DICT HOOK )
|
( DICT HOOK )
|
||||||
( This dummy dictionary entry serves two purposes:
|
( This dummy dictionary entry serves two purposes:
|
||||||
|
@ -37,6 +37,9 @@
|
|||||||
: HERE 0x04 RAM+ ;
|
: HERE 0x04 RAM+ ;
|
||||||
: CURRENT 0x02 RAM+ ;
|
: CURRENT 0x02 RAM+ ;
|
||||||
|
|
||||||
|
( w -- a f )
|
||||||
|
: (find) CURRENT @ SWAP _find ;
|
||||||
|
|
||||||
: QUIT
|
: QUIT
|
||||||
0 FLAGS ! (resRS)
|
0 FLAGS ! (resRS)
|
||||||
LIT< INTERPRET (find) DROP EXECUTE
|
LIT< INTERPRET (find) DROP EXECUTE
|
||||||
|
@ -354,8 +354,10 @@ CODE CMP
|
|||||||
BC PUSHqq,
|
BC PUSHqq,
|
||||||
;CODE
|
;CODE
|
||||||
|
|
||||||
CODE (find)
|
( cur w -- a f )
|
||||||
HL POPqq,
|
CODE _find
|
||||||
|
HL POPqq, ( w )
|
||||||
|
DE POPqq, ( cur )
|
||||||
chkPS,
|
chkPS,
|
||||||
( 3 == find )
|
( 3 == find )
|
||||||
3 CALLnn,
|
3 CALLnn,
|
||||||
|
Loading…
Reference in New Issue
Block a user