From 1b5333d0b4866d53e5b42c5fd9f25a25c810dfa0 Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Sun, 21 Jun 2020 11:57:12 -0400 Subject: [PATCH] pcat: move all find code in _find word It isn't used by low level boot code anymore, so it can go there. --- blk/381 | 1 - blk/812 | 2 +- blk/819 | 15 --------------- blk/820 | 5 ----- blk/828 | 21 ++++++++++++++------- blk/829 | 3 +++ 6 files changed, 18 insertions(+), 29 deletions(-) delete mode 100644 blk/819 delete mode 100644 blk/820 diff --git a/blk/381 b/blk/381 index 6a83d74..ae593ec 100644 --- a/blk/381 +++ b/blk/381 @@ -14,4 +14,3 @@ XCURRENT @ _xapply ORG @ 0x06 ( stable ABI uflw ) + ! - diff --git a/blk/812 b/blk/812 index 749d51c..c776e95 100644 --- a/blk/812 +++ b/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 ) diff --git a/blk/819 b/blk/819 deleted file mode 100644 index 827852b..0000000 --- a/blk/819 +++ /dev/null @@ -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, diff --git a/blk/820 b/blk/820 deleted file mode 100644 index 704b139..0000000 --- a/blk/820 +++ /dev/null @@ -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, diff --git a/blk/828 b/blk/828 index a504a3f..68c5f83 100644 --- a/blk/828 +++ b/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. ) diff --git a/blk/829 b/blk/829 index e8863e2..79f9251 100644 --- a/blk/829 +++ b/blk/829 @@ -1,3 +1,6 @@ +( cont. find ) JNZ, AGAIN, ( loop ) + SI DECx, SI PUSHx, AX AX XORrr, AX PUSHx, +;CODE CODE 0 AX AX XORxx, AX PUSHx, ;CODE CODE 1 AX 1 MOVxI, AX PUSHx, ;CODE CODE -1 AX -1 MOVxI, AX PUSHx, ;CODE