home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / STRINGS / STRCHRN.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-05-20  |  955 b   |  39 lines

  1. ;******************************************************************************
  2. ; Filename: STRCHRN.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1995.03.12
  6. ;  Updated: 
  7. ;******************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;******************************************************************************
  11. ; Function: PSZ @strchrn(PSZ str,CHAR chr)
  12. ;  Comment: Searches for the next nonmatch of a character in a string
  13. ;  Returns: string position of the first nonmatch
  14. ;******************************************************************************
  15.  
  16.     Include    STDDEF.INC
  17.  
  18.     Codeseg
  19.  
  20. Proc    strchrn ,2
  21. @@Loop01:    Mov    Cx,[Eax]
  22.         Cmp    Cl,Dl
  23.         Jne    @@Next01
  24.         TestZ    Cl
  25.         Jz    @@Exit01
  26.         Cmp    Ch,Dl
  27.         Jne    @@Next02
  28.         Add    Eax,2
  29.         TestZ    Ch
  30.         Jne    @@Loop01
  31. @@Exit01:    Clear    Eax
  32.         Ret
  33.     Align    4
  34. @@Next02:    Inc    Eax
  35. @@Next01:    Ret
  36. Endp
  37.  
  38.     End
  39.