converts a 2 byte-integer to BCD. This code is a part of pAVRlib.
This program is based on AVR Application Note 204.
Subroutine
BIN2BCD16 (in: r25:r24, out: r25,r24,r23)
converts a 2 byte-integer (r25:r24) to BCD.
Example
ldi r25, 0x7f
ldi r24, 0xff
rcall BIN2BCD16This code results r25:r24:r23 = 0x03:0x27:0x67 (0x7fff = 3276710).