mirror of
https://github.com/hsoft/collapseos.git
synced 2024-12-25 17:48:06 +11:00
pcat: move all find code in _find word
It isn't used by low level boot code anymore, so it can go there.
This commit is contained in:
parent
dbd283758c
commit
1b5333d0b4
2
blk/812
2
blk/812
@ -1,4 +1,4 @@
|
||||
VARIABLE lblexec VARIABLE lblfind VARIABLE lblnext
|
||||
VARIABLE lblexec VARIABLE lblnext
|
||||
H@ ORG !
|
||||
JMPn, 0 A,, ( 00, main ) 0 A, 0 A,, ( unused )
|
||||
0 A,, ( unused ) 0 A,, ( 08, LATEST )
|
||||
|
15
blk/819
15
blk/819
@ -1,15 +0,0 @@
|
||||
lblfind BSET
|
||||
( find word the same name as str in SI starting from tip in
|
||||
DI. Returns wordref in DI. Z if found, NZ if not. )
|
||||
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 )
|
||||
AL [DI] -1 MOVr[]+, ( strlen )
|
||||
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, RETn, THEN,
|
||||
THEN,
|
5
blk/820
5
blk/820
@ -1,5 +0,0 @@
|
||||
( find cont. )
|
||||
DI 3 SUBxi, AX [DI] MOVx[], ( prev )
|
||||
AX AX ORxx,
|
||||
JNZ, AGAIN, ( loop )
|
||||
SI DECx, ( start of string, and NZ ) RETn,
|
21
blk/828
21
blk/828
@ -1,9 +1,16 @@
|
||||
CODE _find ( cur w -- a f )
|
||||
SI POPx, ( w ) DI POPx, ( cur )
|
||||
CALLn, lblfind @ RPCn,
|
||||
IFNZ, ( not found )
|
||||
SI PUSHx, AX AX XORxx, AX PUSHx,
|
||||
JMPn, lblnext @ RPCn,
|
||||
THEN, ( found )
|
||||
DI PUSHx, AX 1 MOVxI, AX PUSHx,
|
||||
;CODE
|
||||
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 )
|
||||
AL [DI] -1 MOVr[]+, ( strlen )
|
||||
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. )
|
||||
|
Loading…
Reference in New Issue
Block a user