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,754 of 4,675   
   Benjamin David Lunt to Terje Mathisen   
   Re: another stricmp()   
   28 Jun 17 09:47:47   
   
   From: zfysz@nospicedham.fysnet.net   
      
   "Terje Mathisen"  wrote in message   
   news:oj0b4j$1dri$1@gioia.aioe.org...   
   > wolfgang kern wrote:   
   >   
   > This looks extremely "by the book", i.e. straight forward coding.   
      
   Is that a compliment?  :-)   
      
   > You could combine a few of the current ideas:   
   >   
   > next:   
   >   lodsb   
   >   test al,al   
   >   scasb   
   >    jz check_end   
   >   
   > ; Is this a case mismatch?   
   >   xor al,32   
   >   cmp al,es:[di-1]   
   >    jnz done   
   >   
   > ; Was it an a-z char?   
   >   or al,32   
   >   sub al,'a'   
   >    jb done   
   >   cmp al,'z'   
   >    ja done   
   >   jmp next   
   >   
   > check_end:   
   > ; All chars up to here have matched   
   >   test al,al   
   >    jnz next   
   > done:   
   >   ret   
   >   
   > Setting the proper return codes is left as an exercise. :-)   
   >   
   > Terje   
      
   One advantage to "by the book" coding compared to your code   
   above, is that in 5 years when I need to make a modification,   
   it is easily understood what the code is doing, and I don't   
   have to re-learn why I coded it that way.   
      
   However, if I need the extra bytes for the boot loader, your   
   code is an advantage over mine.   
      
   Thanks,   
   Ben   
      
   --- 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