On Mon, 4 Feb 2002 14:29:55 -0800, Andrew Warren wrote: >Bob Barr wrote: >> >> In either case, you can remove the BTFSC's and the MOVLW's following >> them since the BTFSC will always skip the MOVLW. Bit 6 of your digit's >> ASCII will always be clear for decimal digits '0' through '9'. > > True, but it'll be set for hex digits 'A' through 'F'. > > If the two input bytes are hex digits in the range 0-F, you need >the > BTFSC/MOVLWs; if they're only in the range 0-9, you don't. > Andy, The input digits do have to be in the ASCII '0'-'9' range (otherwise doing the '* 10' wouldn't be right.) Royce's original input data is a pair of decimal characters to be converted to hex. The characters 'A' through 'F' just can't be part of valid input data. Royce,=20 Do you need your result in BCD form (for displaying the two digits) or in its true hex form (for indexing a table or some such)? Regards, Bob -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body