We're talking about a DS1307 RTC here (and ignoring the MSB of certain Registers) where the only valid individual digits are in the range 0-9. The subroutine converts two digit DECIMAL in the range 0-99 to a single BCD Byte. $EC is not a valid conversion requirement for this application.
Bookmarks