home *** CD-ROM | disk | FTP | other *** search
/ BURKS 2 / BURKS_AUG97.ISO / BURKS / SOFTWARE / LIBS / PMC101.ZIP / LIBSRC.ZIP / STRNICMP.ASM (.txt) < prev    next >
Assembly Source File  |  1994-06-14  |  929b  |  61 lines

  1. .386p
  2. locals
  3.  
  4. public  STRNICMP
  5.  
  6. _TEXT           segment byte public use32 'CODE'
  7. assume  cs:_TEXT
  8.  
  9. STRNICMP:
  10.         push esi edi
  11.         cld
  12.  
  13.         mov edi,[esp+4+8+08h]
  14.         mov esi,[esp+4+8+04h]
  15.         mov ecx,[esp+4+8+00h]
  16.         jecxz short @@01
  17.         add ecx,esi
  18.  
  19. @@00l:
  20.         lodsb
  21.         cmp al,'A'
  22.         jb short @@00l00
  23.         cmp al,'Z'
  24.         ja short @@00l00
  25.         add al,'a'-'A'
  26.  
  27. @@00l00:
  28.         mov ah,[edi]
  29.         inc edi
  30.         cmp ah,'A'
  31.         jb short @@00l01
  32.         cmp ah,'Z'
  33.         ja short @@00l01
  34.         add ah,'a'-'A'
  35.  
  36. @@00l01:
  37.         cmp al,ah
  38.         jne short @@00
  39.  
  40.         cmp esi,ecx
  41.         jae short @@01
  42.  
  43.         or al,al
  44.         jnz @@00l
  45.  
  46. @@01:
  47.         xor eax,eax
  48.  
  49. @@00:
  50.         setl al
  51.         setg ah
  52.         sub al,ah
  53.         movsx eax,al
  54.  
  55.         pop edi esi
  56.         ret 0ch
  57.  
  58. _TEXT           ends
  59. end
  60.  
  61.