2020-06-21 10:40:09 -04:00
|
|
|
CODE _find ( cur w -- a f )
|
|
|
|
SI POPx, ( w ) DI POPx, ( cur )
|
2020-06-21 11:57:12 -04:00
|
|
|
CH CH XORrr, CL [SI] MOVr[], ( CX -> strlen )
|
|
|
|
SI INCx, ( first char ) AX AX XORxx, ( initial prev )
|
|
|
|
BEGIN, ( loop )
|
|
|
|
DI AX SUBxx, ( jump to prev wordref )
|
2020-06-21 13:09:51 -04:00
|
|
|
AL [DI] -1 MOVr[]+, 0x7f ANDALi, ( strlen )
|
2020-06-21 11:57:12 -04:00
|
|
|
CL AL CMPrr, IFZ, ( same len )
|
|
|
|
SI PUSHx, DI PUSHx, CX PUSHx, ( --> lvl 3 )
|
|
|
|
3 ADDALi, ( header ) AH AH XORrr, DI AX SUBxx,
|
|
|
|
CLD, REPZ, CMPSB,
|
|
|
|
CX POPx, DI POPx, SI POPx, ( <-- lvl 3 )
|
|
|
|
IFZ, DI PUSHx, AX 1 MOVxI, AX PUSHx,
|
|
|
|
JMPn, lblnext @ RPCn, THEN,
|
|
|
|
THEN,
|
|
|
|
DI 3 SUBxi, AX [DI] MOVx[], ( prev ) AX AX ORxx, ( cont. )
|