ON 20060510@11:07:53 AM at page: http://www.piclist.com/microchip/math/radix/b2ah-8b2a-sd.htm#38847.2321296296 James Newton[JMN-EFP-786] published post 38847.2321296296 AlexanderVangelov@gmal.com shares this code:
After calling bin2hex, usualy data must be sended to some interface: hi-byte first than lo-byte
But we get char_hi and WREG (char_lo)
Better way to have char_lo and W (char_hi)
So:
<blockquote>
bin2hex:
MOVWF char_lo
CALL convert_nibble
XORWF char_lo,F
XORWF char_lo,W
XORWF char_lo,F
SWAPF WREG,W
convert_nibble:
ANDLW 0x0F
ADDLW 0xF6
BTFSC STATUS,C
ADDLW 0x07
ADDLW 0x3A
RETURN
</blockquote>
|Delete 'P-' before: '' but after: '