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,771 of 4,675   
   Terje Mathisen to James Harris   
   Re: Optimize stricmp() algorithm (casele   
   30 Jun 17 17:50:30   
   
   From: terje.mathisen@nospicedham.tmsw.no   
      
   James Harris wrote:   
   > On 30/06/2017 07:41, James Harris wrote:   
   >> On 29/06/2017 23:40, Rod Pemberton wrote:   
   >   
   > ...   
   >   
   >>> When "if (x == MIGHT)", the XOR result is 0x20, meaning that the two   
   >>> characters are either an upper- and lower-case alphabetic which are the   
   >>> same when lower-cased, or they're two different graphics characters   
   >>> 0x20 apart.   
   >>   
   >> That's far from obvious but I have to say that for ASCII it seems to   
   >> be correct. And it may work for EBCDIC too (with an XOR of 0x40).   
   >   
   > Maybe that suggests a fast way of recognising a letter in ASCII without   
   > using a lookup table:   
   >   
   >   or al, 'a' ^ 'A'   
   >   sub al, 'a'   
   >   cmp al, 'z' - 'a'   
   >   ja is_not_alphabetic   
      
   That is the method I use for US ascii. :-)   
      
   Terje   
      
   --   
   -    
   "almost all programming can be viewed as an exercise in caching"   
      
   --- 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