Author Topic: character insensitive compare  (Read 179 times)

Offline mik3ca

  • Jr. Member
  • *
  • Posts: 30
character insensitive compare
« on: January 19, 2021, 02:15:53 AM »
I'm trying to figure out the least processor intensive way to compare two characters to see if they match regardless of whether the letter is capital or small. Let's say the characters are stored in registers CL, and DL.

Initially I thought of this:

Code: [Select]
mov AL,CL
anl AL,11010000b ;make letter upper case
mov BL,DL
anl BL,11010000b ;make this one upper case
cmp AL,BL
je charsaresame

But the problem is if I used numbers or compared other symbols, then they would match up with other symbols, and I don't want that.

How would I be able to do this the most efficient way?