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

  1. ;******************************************************************************
  2. ; Filename: STRCMP.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: LONG @strcmp(PSZ srcptr,PSZ destptr)
  12. ;  Comment: Compares two strings
  13. ;    Input: Eax - srcptr
  14. ;           Edx - destptr
  15. ;  Returns: zero if equal, less than zero srcptr < destptr and above zero
  16. ;           if srcptr > destptr.
  17. ;******************************************************************************
  18.  
  19.     Include    STDDEF.INC
  20.  
  21.     Codeseg
  22.  
  23. Proc    strcmp  ,2
  24.         Push    Ebx
  25.         Clear    Ebx
  26.         Clear    Ecx
  27.     Align    4
  28. @@Loop01:    Mov    Cl,[Eax]
  29.         Mov    Bl,[Edx]
  30.         Jecxz    @@Exit01
  31.         Sub    Ecx,Ebx
  32.         Inc    Edx
  33.         Inc    Eax
  34.         Jecxz    @@Loop01
  35.         Mov    Eax,Ecx
  36.         Pop    Ebx
  37.         Ret
  38.     Align    4
  39. @@Exit01:    Sub    Ecx,Ebx
  40.         Mov    Eax,Ecx
  41.         Pop    Ebx
  42.         Ret
  43. Endp
  44.  
  45.     End
  46.