home *** CD-ROM | disk | FTP | other *** search
- ;******************************************************************************
- ; Filename: STRCHR.ASM
- ; Author: Peter Andersson
- ; Version: 0.0
- ; Created: 1995.03.12
- ; Updated:
- ;******************************************************************************
- ; Copyright Peter Andersson, 1994-1995.
- ; All rights reserved.
- ;******************************************************************************
- ; Function: PSZ @strchr(PSZ str, CHAR chr)
- ; Comment: Searches for a character in a string
- ; Input: Eax - search string
- ; Output: Dl - string to search for
- ; Returns: string pointer if the character was found or zero
- ;******************************************************************************
-
- Include STDDEF.INC
-
- Codeseg
-
- Proc strchr ,2
- @@Loop01: Mov Cx,[Eax]
- Cmp Cl,Dl
- Je @@Next01
- TestZ Cl
- Jz @@Exit01
- Cmp Ch,Dl
- Je @@Next02
- Add Eax,2
- TestZ Ch
- Jne @@Loop01
- @@Exit01: Clear Eax
- Ret
- Align 4
- @@Next02: Inc Eax
- @@Next01: Ret
- Endp
-
- End