2020-07-06 12:35:54 +10:00
|
|
|
( 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 )
|
2020-04-23 11:19:12 +10:00
|
|
|
( First, figure out string len )
|
2020-05-26 10:34:52 +10:00
|
|
|
A (HL) LDrr, A ORr,
|
2020-04-23 11:19:12 +10:00
|
|
|
( special case. zero len? we never find anything. )
|
2020-07-06 12:35:54 +10:00
|
|
|
IFZ, PUSH0, JPNEXT, THEN,
|
2020-05-26 10:34:52 +10:00
|
|
|
( 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. )
|
2020-06-28 12:01:56 +10:00
|
|
|
C A LDrr, B 0 LDri, ( C holds our length )
|
|
|
|
BC ADDHLd, HL INCd, ( HL points to after-last-char )
|
2020-05-26 10:34:52 +10:00
|
|
|
( cont . )
|