;
; unsigned char Clock1 [] = { 23, 59, 59, 99 };
;
; if (Clock1_switch) // if Clock1 running
; { if (Clock1[3]++ = 99) // if hundreths overflow (post inc hundreths)
; { Clock1[3] = 0; // reset hundreths and increment time
; unsigned char n = 2; // index for seconds element
; while (Clock1[n]++ == 59) // while value 59 (post inc value)
; Clock1[n--] = 0; // set to 00 and bump array index
; }
; }
;
ISR_CLK1
btfss Switch1 ; switch 1 set (clock 1 enabled)?
goto ISR_CLK2 ; no, branch, else
movf Clock1+3 ; hundreths digit
incf Clock1+3,F ; post increment hundreths
xorlw d'99' ; done (no overflow)?
bnz ISR_CLK2 ; yes, branch, else
movlw Clock1+2 ; index for seconds element
movwf FSR ; setup for indirect access
ISR_Bump1
movf INDF,W ; while (Clock1[n]++ == 59)
incf INDF,F ;
xorlw d'59' ;
bnz ISR_CLK2 ;
clrf INDF ; Clock1[n] = 0;
decf FSR,F ; n--;
goto ISR_Bump1 ;
;
ISR_CLK2