/* Write a function to unpack two BCD numbers * in register r24 and then convert their binary equivalent * values into two ASCII characters. * Return ASCII characters in the r25:r24 register pair. */ .INCLUDE BCDtoASCII: ; Conversion of packed BCD number to 8-bit Binary (0 to 99) push r15 ; save contents of registers modified by this subroutine in r15, SREG mov r25,r24 ; copy the number to another register. swap r25 ; exchange upper and the lower nibbles cbr r25,0xF0 ; clear upper BCD nibble and sbr r25,0x30 ; convert to ASCII character cbr r24,0xF0 ; clear lower BCD nibble and sbr r24,0x30 ; convert to ASCII character out SREG, r15 pop r15 ret