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,769 of 4,675    |
|    James Harris to James Harris    |
|    Re: Optimize stricmp() algorithm (casele    |
|    30 Jun 17 11:48:17    |
      From: james.harris.1@nospicedham.gmail.com              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                     --       James Harris              --- 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