Prev: ADEA Up: Map Next: AE2C
ADFB: Prints a decimal BCD string onto screen.
Input
HL Ptr to BCD number.
Output
Display_DecimalValue. ADFB LD B,$04 Number of bytes that make up decimnal value.
ADFD XOR A
ADFE LD DE,$0003 Start with the most significant digit.
AE01 ADD HL,DE
AE02 LD DE,_adf3
Display_DecimalValue._0 AE05 LD C,(HL) Copy BCD value for each digit in overall number.
AE06 RLD
AE08 LD (DE),A
AE09 INC DE
AE0A RLD
AE0C LD (DE),A
AE0D INC DE
AE0E LD (HL),C
AE0F DEC HL
AE10 DJNZ Display_DecimalValue._0
AE12 LD HL,_adf3
AE15 LD B,$07
AE17 LD C,$00 Set C so that leading zero check is used. Once C is set, check will stop.
Display_DecimalValue._1 AE19 LD A,(HL) Get decimal value.
AE1A OR C Skip leading zeros.
AE1B JR Z,Display_DecimalValue._2
AE1D LD C,$30 Convert into ascii equivalent and print.
AE1F OR C
AE20 CALL Print_SelectChar
Display_DecimalValue._2 AE23 INC HL Next digit.
AE24 DJNZ Display_DecimalValue._1
AE26 LD A,(HL) Print final zero.
AE27 OR $30
AE29 JP Print_SelectChar
Prev: ADEA Up: Map Next: AE2C