Brian, IF the original nibble is <= 9 then OR it with 30H to get ASCII "0" - "9" exactly as James Cameron showed you. IF the nibble has a hex value from 0AH to 0FH then subtract 9 and OR with 40H. For example, if the nibble is 0AH then subtracting 9 will give you 01H, and ORing with 40H will give you 41H. If you desire lower case instead of upper case, then OR with 60H instead. BTW, you can "subtract" 9 by adding the two's complement of 9, which is F7H Hope this helps. Fr. Tom McGahee ---------- > From: Clewer,Brian > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: How to convert an 8 bit byte into two ASCII chars. > Date: Thursday, June 11, 1998 2:50 PM > > James Cameron wrote: > > >Clewer,Brian wrote: > >> My problem is that I have an 8 bit byte and I need to convert it > >> into two printable chars to send to my PC. E.g.. 00111001 would be > >> 39 (in hex). I need to send the two chars 3 and 9 to my PC. > > > > move the byte to W > > swap nibbles (swapf) > > and with 0x0f > > or with 0x30 > > send that byte > > > > move the byte to W again > > and with 0x0f > > or with 0x30 > > send that byte > > > >Hey, I enjoyed that. Uh oh. ;-) > > This is ok if you use the numbers 0 to 9 but it doesn't work if you need > HEX values from A to F. > > Any more ideas? > > Thanks, > Brian.