Hi, nothing effective but different in the sense that it accept also a-f as input ( i've been bitten by this :) ). = I'm not the originator, can't remember who was. Anyway here goes: ; *********************************************************************** ; IS_HEX - Routine to check if value in W is ASCII hex digit 0-9, A-F or a-f ; Returns with zero SET if NOT hex ( value preserved ) ; Else returns with zero flag clear and value of input as binary in W ; IS_HEX GLOBAL IS_HEX ; 0-9 A-F a-f Z ; 0x30-0x39 0x41-0x46 0x61-0x66 0x4A ADDLW 0xC6 ; 0xF6-0xFF 0x07-0x0C 0x27-0x2C 0x10 ADDLW 0x0A ; 0x00-0x09 0x11-0x16 0x31-0x36 0x1A BTFSC STATUS,C GOTO IS_09 ADDLW 0xE9 ; 0xFA-0xFF 0x1A-0x1F 0x03 ADDLW 0x06 ; 0x00-0x05 0x20-0x25 0x09 BTFSC STATUS,C GOTO IS_AF ADDLW 0xDA ; 0xFA-0xFF 0xE3 ADDLW 0x06 ; 0x00-0x05 0xE9 BTFSC STATUS,C GOTO IS_AF ADDLW 0x61 ; 0x4A BSF STATUS,Z ; SET zero flag value is not HEX and return RETURN IS_AF ADDLW 0x0A ; add ten ( range is A-F ) IS_09 BCF STATUS,Z ; clear zero flag value is HEX RETURN Tony K=FCbek, Flintab AB = =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2= =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2= =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2 E-mail: tony.kubek@flintab.com =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2= =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2=B2= =B2=B2=B2=B2=B2=B2=B2=B2=B2=B2 -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body