mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-26 16:28:06 +11:00
a6e987b5f7
In preparation for the IY->BC move
17 lines
686 B
Plaintext
17 lines
686 B
Plaintext
( Native words )
|
|
H@ 4 + XCURRENT ! ( make next CODE have 0 prev field )
|
|
CODE _find ( cur w -- a f )
|
|
HL POP, ( w ) DE POP, ( cur ) chkPS,
|
|
HL PUSH, ( --> lvl 1 )
|
|
( First, figure out string len )
|
|
A (HL) LDrr, A ORr,
|
|
( special case. zero len? we never find anything. )
|
|
IFZ, PUSH0, JPNEXT, THEN,
|
|
BC PUSH, ( --> lvl 2, protect )
|
|
( Let's do something weird: We'll hold HL by the *tail*.
|
|
Because of our dict structure and because we know our
|
|
lengths, it's easier to compare starting from the end. )
|
|
C A LDrr, B 0 LDri, ( C holds our length )
|
|
BC ADDHLd, HL INCd, ( HL points to after-last-char )
|
|
( cont . )
|