>Can anybody help me with an efficient C-Algorithm for this conversion?
printf directly supports printing characters, decimal, and hexadecimal, so that's easy. Converting between ASCII and EBCDIC is also easy and highly efficient if you use two conversion tables:
unsigned char ascii[] = {
/* All characters in ASCII */
};
unsigned char ebcdic[] = {
/* All characters in EBCDIC */
};
unsigned char to_ascii ( unsigned char c )
{
return ascii[c];
}
unsigned char to_ebcdic ( unsigned char c )
{
return ebcdic[c];
}
I'm here to prove you wrong.