Hi,
I am testing a function that translates 16- hex characters to 8 ASCII characters the characters are unsigned characters, they produce a large numbers int the range 0 --> 255 which is
correct, how can I take those valuses to Ascii char values ?
here is the program:
Code:
code
ByteType HexToAscii ( ByteType *Addr)
{
ByteType CH;
CH = ( Addr [0] >= 'A' ? ( ( Addr [0] & 0xDF ) - 'A' ) + 10 :
( Addr [0] - '0' ) );
CH *= 16;
CH += ( Addr [1] >= 'A' ? ( ( Addr [1] & 0xDF ) - 'A' ) + 10 :
( Addr [1] - '0' ) );
return(CH);
}