list p=16f627a #include p16f627a.inc ; Set config bits ; __CONFIG _INTRC_OSC_NOCLKOUT & _PWRTE_OFF & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _LVP_OFF ; __CONFIG _INTOSC_OSC_NOCLKOUT & _PWRTE_OFF & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _LVP_OFF __CONFIG _XT_OSC & _PWRTE_OFF & _WDT_OFF & _CP_OFF & _MCLRE_OFF & _LVP_OFF ; Declare the variables. cblock 0x20 debug ; TODO: Used only for debugging debugh ; TODO: Used only for debugging dark ; Time until the display is blanked. ; (Blanking the display saves battery life.) row ; Row to refresh on display ticks ; Ticks this second (0-124) seconds ; Seconds this minute (0-59) minutes ; Minutes this hour (0-59) hours ; Hours this day (0-23) days ; Day of month (1-31) months ; Month of year (1-12) mode ; Current operatin mode ; 0 - displaying time ; 1 - setting minutes ; 2 - setting hours ; 3 - setting days ; 4 - setting months ; Start in mode 4. Pressing the button decrements the mode. ; Pressing the button generally decrements the mode, bouncing ; Non-zero during debounce intervals savew ; Saves W during interrupts saves ; Saves STATUS during interrupts timeval ; Value for the timer register ticksec ; Ticks per second (after row division) endc org 0x0000 ;Reset vector goto main ; Jump to main code defined in Example.asm nop ; Pad out so interrupt nop ; service routine gets nop ; put at address 0x0004. goto service ; Points to interrupt service routine org 0x0020 ; Begin program main ; Main code entry -- once only initialization ;OPTION ; Clear RBPU ; Clear TOCS ; Clear PSA ; Set prescaler = 111 (divide by 256) clrwdt bcf STATUS, RP1 ; Select BANK0 or BANK1 bsf STATUS, RP0 ; Select BANK1 movlw (1<