home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 2,750 of 4,675   
   wolfgang kern to All   
   Re: another stricmp()   
   28 Jun 17 11:33:59   
   
   From: nowhere@never.at   
      
   Yes Ben,   
      
   even not too fast.. this looks much better yet! :)   
   __   
   wolfgang   
      
   > ; =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-   
   > ; this routine compares (case insensitive) two strings   
   > ; ds:si->string0 (asciiz)   
   > ; es:di->string1 (asciiz)   
   > ; returns  zero flag set if equal   
   > ;          carry flag set if string0 < string1   
   > ;          carry flag clear if string0 > string1   
   > ;  preserves: si, di   
   > ;   destroys: ax   
   > stricmp    proc near uses si di   
   >   
   > @@:        mov  al,es:[di]   
   >           inc  di   
   >           call upper_case   
   >           mov  ah,al   
   >   
   >           lodsb   
   >           call upper_case   
   >   
   >           ; if both strings are equal and we are at   
   >           ;  the null terminator, we need to exit now   
   >           or   ax,ax   
   >           jz   short @f   
   >   
   >           ; 'sub' will set/clr the zero flag   
   >           ;   and the carry flag for us   
   >           sub  al,ah   
   >           jz   short @b   
   >   
   > @@:        ret   
   > stricmp    endp   
   >   
   > upper_case proc near   
   >           cmp  al,'a'   
   >           jb   short @f   
   >           cmp  al,'z'   
   >           ja   short @f   
   >           sub  al,('a'-'A')   
   > @@:        ret   
   > upper_case endp   
   >   
   > .end   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca