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

  1. ;*****************************************************************************
  2. ; Filename: STRICMP.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 @stricmp(PSZ srcptr,PSZ destptr)
  12. ;  Comment: Compares two strings without case sensitivity
  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. Extrn UpperCaseTable:Byte:256
  24.  
  25. Proc    stricmp ,2
  26.         Push    Ebx
  27.         Clear    Ebx
  28.         Clear    Ecx
  29.     Align    4
  30. @@Loop01:    Mov    Cl,[Eax]
  31.         Mov    Bl,[Edx]
  32.         Jecxz    @@Exit01
  33.         Mov    Bl,[UpperCaseTable+Ebx]
  34.         Mov    Cl,[UpperCaseTable+Ebx]
  35.         Sub    Ecx,Ebx
  36.         Inc    Eax
  37.         Inc    Edx
  38.         Jecxz    @@Loop01
  39.         Mov    Eax,Ecx
  40.         Pop    Ebx
  41.         Ret
  42.     Align    4
  43. @@Exit01:    Movsx    Eax,[UpperCaseTable+Ebx]
  44.         Neg    Eax
  45.         Pop    Ebx
  46.         Ret
  47. Endp
  48.  
  49.     End
  50.