Ah, ok. I still think you can optimize the bad [many same bytes before the first difference] case by using a technique similar to strcmp - compare for equality, and once you found a difference, compare for greater/lesser. The good case is probably not that bad either way (and of course, if the compiler is clever, it will only do ONE compare and three different jump instructions).
--
Mats