(Subject added) > You can do this several ways, Another way is XOR. When two bit patterns are the same the result is 0 xorlw "a" bz is_a If there are two or more characters to detect, eg "a" or "b" or "c" xorlw "a" bz is_a xorlw "a" ^ "b" ;restore W and re-test bz is_b xorlw "b" ^ "c" ;restore W and re-test bz is_c Not quite what you were asking but it may come in handy one day I have this routine to detect non-letter characters in a received string and convert any lower case to upper case (to simplify testing in other routines) cloop movlw "^" ;test for end-of-string character, "^" xorwf indf0,w bz eos ;yes movfw indf0 ;no, get char addlw d255-"z" ;test addlw ("z"-"a")+1 bnc nextc ;no movlw 0xe0 ;LC letter, subtract 0x20 addwf indf0 ;replace in string nextc incf fsr0l ;increment indices incf str_ptr bra cloop -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist