> I need ideas for a bin to ASCII dec converter. I'm going to be reading > vaules from a tempature sensor over a single wire interface. The issue is, I > need to convert it into an ascii hex form so that I can output it to a > serial tenimal and be able to read it. If you have any ideas please reply. Add 0x30 to result variables to convert to ASCII. At a glance I think the only change to make for non-18F is the RLCF Original http://www.piclist.com/techref/microchip/math/radix/b2bhp-8b3d.htm If this isn't what you're looking for, try here http://www.piclist.com/techref/microchip/math/radix/index.htm ;================================================ ; Convert 8-bit data to ASCII for LCD - 18F ;================================================ ; binary_to_bcd - 8-bits ; ; Input bin - 8-bit binary number ; A1*16+A0 ; Output ; ; d100 - hundreds digit of the BCD conversion ; d011 - tens and ones digits of the BCD conversion bin2bcd clrf d100 swapf temp,w addwf temp,w andlw b'00001111' btfsc dc addlw 0x16 btfsc dc addlw 0x06 addlw 0x06 btfss dc addlw -0x06 btfsc temp,4 addlw 0x16 - 1 + 0x6 btfss dc addlw -0x06 btfsc temp,5 addlw 0x30 btfsc temp,6 addlw 0x60 btfsc temp,7 addlw 0x20 addlw 0x60 rlcf d100 btfss d100,w addlw -0x60 movwf d011 btfsc temp,7 incf d100 swapf d011,w ;separate 10s andlw 0x0f movwf d010 movlw 0x0f ;separate 1s andwf d011,w movwf d011 -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist