[openfirmware] r926 - cpu/x86
svn at openfirmware.info
svn at openfirmware.info
Tue Sep 9 03:55:47 CEST 2008
Author: wmb
Date: 2008-09-09 03:55:47 +0200 (Tue, 09 Sep 2008)
New Revision: 926
Modified:
cpu/x86/kerncode.fth
Log:
Added bskip and lskip primitives to speed up bitmap searching for ext2.
Modified: cpu/x86/kerncode.fth
===================================================================
--- cpu/x86/kerncode.fth 2008-09-08 23:30:08 UTC (rev 925)
+++ cpu/x86/kerncode.fth 2008-09-09 01:55:47 UTC (rev 926)
@@ -551,6 +551,31 @@
dx di mov
c;
+\ Skip initial occurrences of bvalue, returning the residual length
+code bskip ( adr len bvalue -- residue )
+ di dx mov
+ ax pop \ BX: compare value
+ cx pop \ CX: Length
+ di pop \ SI: address
+ cld repz byte scas
+ <> if cx inc then
+ dx di mov
+ cx push
+c;
+
+\ Skip initial occurrences of lvalue, returning the residual length
+code lskip ( adr len lvalue -- residue )
+ di dx mov
+ ax pop \ BX: compare value
+ cx pop \ CX: Length
+ 2 # cx shr \ Convert CX to longword count
+ di pop \ SI: address
+ cld repz scas
+ <> if cx inc then
+ dx di mov
+ 2 # cx shl cx push
+c;
+
code noop (s -- ) c;
code n->l (s n.unsigned -- l ) c;
More information about the openfirmware
mailing list