[openfirmware] [commit] r3367 - cpu/x86

repository service svn at openfirmware.info
Sat Oct 13 03:40:01 CEST 2012


Author: wmb
Date: Sat Oct 13 03:40:00 2012
New Revision: 3367
URL: http://tracker.coreboot.org/trac/openfirmware/changeset/3367

Log:
x86 kernel - added bscan code word used by new substring variant.

Modified:
   cpu/x86/kerncode.fth

Modified: cpu/x86/kerncode.fth
==============================================================================
--- cpu/x86/kerncode.fth	Sat Oct 13 03:30:13 2012	(r3366)
+++ cpu/x86/kerncode.fth	Sat Oct 13 03:40:00 2012	(r3367)
@@ -657,6 +657,30 @@
    2 # cx shl  cx push
 c;
 
+\ Find the first occurence of bvalue, returning the residual string
+code bscan  ( adr1 len1 char -- adr' len' )
+   si dx mov
+   cld
+   bx pop                  \ bx: char
+   cx pop                  \ cx: count
+   si pop                  \ si: adr
+   cx cx or  0<>  if
+      begin
+         al lods
+         bl al cmp
+      loopne
+      =  if                
+         si dec si push    ( adr' )
+         cx inc cx push    ( adr' len' )
+         dx si mov
+         next
+      then
+   then
+   si push                 ( adr' )
+   cx push                 ( adr' len' )
+   dx si mov
+c;
+
 code noop (s -- )  c;
 
 code n->l (s n.unsigned -- l ) c;



More information about the openfirmware mailing list