Searching \ for '32bit binary to ASCII conversion' in subject line. ()
Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=32bit+binary+ascii
Search entire site for: '32bit binary to ASCII conversion'.

Truncated match.
'32bit binary to ASCII conversion'
2000\06\08@064751 by

Hi all
I have a project where I have to convert a 32 bit binary or hex number to
ASCII to be displayed on a LCD. Does some one on this list have done this
before, if so are you willing to share the solution with me or give me some
hints. I have done decimal to ASCII conversion no problem, but now my
project end up with a 32 bit number and then I have only very complicated
solutions.

\||||||/
_____oo0o__( o o )__o0oo_____
(_)

Henrik HolmgŒrd

Henrik Holmgerd wrote:

> Hi all
> I have a project where I have to convert a 32 bit binary or hex number to
> ASCII to be displayed on a LCD. Does some one on this list have done this
> before, if so are you willing to share the solution with me or give me some
> hints. I have done decimal to ASCII conversion no problem, but now my
> project end up with a 32 bit number and then I have only very complicated
> solutions.
>

Here's my Hex to ASCII .
You need only do the word to nibble conversion.

;****************************** HEX to ASCII **********************************

; Converts a HEX nibble, passed in "W", returned in "W".
;******************************************************************************

HEX2ACSII MOVWF ADJ_CHAR ; Save the HEX nibble.
MOVLW '0'  ; Form the character "0".
MOVLW '9'  ; Form the character "9".
SUBWF ADJ_CHAR,W ; Test the new character.
BTFSC STATUS,Z ; Is the new character a Nine?
GOTO H2A_Exit ; Yes, Return sucessful.
BTFSS STATUS,C ; No, Does the new character need further adjust?
GOTO H2A_Exit ; No, Return sucessful.
MOVLW 0x07  ; Yes, Form the Alpha character adjust.
RETURN  ; Done.
;
RETURN  ; Done.

>
>
>                     \||||||/
> _____oo0o__( o o )__o0oo_____
>                       (_)
>
>      Henrik Holmgerd

--
*
|  __O    Thomas C. Sefranek  tcscmcorp.com