Im Magazin „ BYTE" wurde in der Ausgabe Juni 1979 der folgende Artikel abgedruckt.
Hierbei handelt es sich um einen Trick, wie sich aus einem 4-Bit Binärwert das entsprechende ASCII-Zeichen erzeugen lässt.
|
|
5 Byte Hexadecimal to ASCII Converter
Ashwin L Doshi
5830 Green Valley Cir 105
Culver City CA 90230
|
I was recently challenged by a colleague to find the most efficient 8080 code to translate hexadecimal 0 thru F (stored in the accumulator) into ASCII 0 thru 9 and A thru F (also in the accumulator).
After I came up with a 5 byte translation, he showed me a well-published 6 byte translation (of which I was unaware) which is as follows:
ADI 90H
DAA
ACI 40H
DAA.
The 5 byte code that does the same translation is as follows:
DAA
ADI F0H
ACI 40H.
The latter assumes that the carry and the auxiliary carry are reset, which is the case in all applications that I could find of this translation.
Eingescanned von
Werner Cirsovius
September 2002
© BYTE Publications Inc.