home *** CD-ROM | disk | FTP | other *** search
- ;******************************************************************************
- ; Filename: STRCMP.ASM
- ; Author: Peter Andersson
- ; Version: 0.0
- ; Created: 1995.03.12
- ; Updated:
- ;******************************************************************************
- ; Copyright Peter Andersson, 1994-1995.
- ; All rights reserved.
- ;******************************************************************************
- ; Function: LONG @strcmp(PSZ srcptr,PSZ destptr)
- ; Comment: Compares two strings
- ; Input: Eax - srcptr
- ; Edx - destptr
- ; Returns: zero if equal, less than zero srcptr < destptr and above zero
- ; if srcptr > destptr.
- ;******************************************************************************
-
- Include STDDEF.INC
-
- Codeseg
-
- Proc strcmp ,2
- Push Ebx
- Clear Ebx
- Clear Ecx
- Align 4
- @@Loop01: Mov Cl,[Eax]
- Mov Bl,[Edx]
- Jecxz @@Exit01
- Sub Ecx,Ebx
- Inc Edx
- Inc Eax
- Jecxz @@Loop01
- Mov Eax,Ecx
- Pop Ebx
- Ret
- Align 4
- @@Exit01: Sub Ecx,Ebx
- Mov Eax,Ecx
- Pop Ebx
- Ret
- Endp
-
- End