;
; increment packed-bcd CLK data in CLKSEC, CLKMIN, and CLKHRS
; once per second
;
ISR_CLK
incf CLKSEC,f ; increment seconds [00..59] |B0
movf CLKSEC,W ; |B0
addlw h'06' ; lo nybble < 10 ? |B0
bndc ISR_ALM ; yes, branch |B0
movwf CLKSEC ; else update |B0
xorlw h'60' ; is it < 60? |B0
bnz ISR_ALM ; yes, branch |B0
movwf CLKSEC ; else, reset sec to '00' and |B0
incf CLKMIN,f ; increment minutes [00..59] |B0
movf CLKMIN,W ; |B0
addlw h'06' ; lo nybble < 10? |B0
bndc ISR_ALM ; yes, branch |B0
movwf CLKMIN ; else update |B0
xorlw h'60' ; is it < 60? |B0
bnz ISR_ALM ; yes, branch |B0
movwf CLKMIN ; else, reset min to '00' and |B0
incf CLKHRS,f ; increment hours [00..23] |B0
movf CLKHRS,W ; |B0
addlw h'06' ; lo nybble < 10? |B0
skpndc ; yes, skip |B0
movwf CLKHRS ; else update |B0
xorlw h'24'+6 ; not '24'? |B0
bnz ISR_ALM ; yes, branch |B0
movwf CLKHRS ; else, reset hrs to '00' and |B0