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

  1. ;******************************************************************************
  2. ; Filename: STRCHR.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 @strchr(PSZ str, CHAR chr)
  12. ;  Comment: Searches for a character in a string
  13. ;    Input: Eax - search string
  14. ;   Output: Dl - string to search for
  15. ;  Returns: string pointer if the character was found or zero
  16. ;******************************************************************************
  17.  
  18.     Include    STDDEF.INC
  19.  
  20.     Codeseg
  21.  
  22. Proc    strchr  ,2
  23. @@Loop01:    Mov    Cx,[Eax]
  24.         Cmp    Cl,Dl
  25.         Je    @@Next01
  26.         TestZ    Cl
  27.         Jz    @@Exit01
  28.         Cmp    Ch,Dl
  29.         Je    @@Next02
  30.         Add    Eax,2
  31.         TestZ    Ch
  32.         Jne    @@Loop01
  33. @@Exit01:    Clear    Eax
  34.         Ret
  35.     Align    4
  36. @@Next02:    Inc    Eax
  37. @@Next01:    Ret
  38. Endp
  39.  
  40.     End
  41.