MPASM 4.02 Released BCDWATCH.ASM 11-11-2005 23:12:21 PAGE 1 LOC OBJECT CODE LINE SOURCE TEXT VALUE 00001 list p=16f627a 00002 #include p16f627a.inc 00001 LIST 00002 ; P16F627A.INC Standard Header File, Version 1.10 Microchip Technology, Inc. 00265 LIST 00003 00004 ; Set config bits 2007 3FF8 00005 __CONFIG _INTRC_OSC_NOCLKOUT & _PWRTE_OFF & _WDT_OFF & _CP_OFF 00006 00007 ; Compute a value for the timer. 00008 ; Goal is 625 interrupts per second, so we need to divide 00009 ; 1Mhz by 1600 (2^6*25) to get 625Hz. Set the prescaler for 00010 ; (2^6)=64, then set the clock for (5^2)=25. 00011 ; BUGBUG: I don't know why this is off by a factor of 3! 00012 ;timeval EQU -d'25' FFFFFFB5 00013 timeval EQU -d'75' 00014 00015 ; Declare the time of day variables 00016 cblock 0x20 00000020 00017 row 00000021 00018 ticks 00000022 00019 seconds 00000023 00020 minutes 00000024 00021 hours 00000025 00022 days 00000026 00023 months 00000027 00024 mode 00000028 00025 bouncing 00000029 00026 savew 0000002A 00027 saves 0000002B 00028 ticksec 00029 endc 00030 0000 00031 org 0x0000 ;Reset vector 0000 2820 00032 goto main ; Jump to main code defined in Example.asm 0001 0000 00033 nop ; Pad out so interrupt 0002 0000 00034 nop ; service routine gets 0003 0000 00035 nop ; put at address 0x0004. 0004 286A 00036 goto service ; Points to interrupt service routine 0020 00037 org 0x0020 ; Begin program 0020 00038 main ; Main code entry -- once only initialization 00039 ;OPTION 00040 ; Clear RBPU 00041 ; Clear TOCS 00042 ; Clear PSA 00043 ; Set prescaler = 111 (divide by 256) 0020 0064 00044 clrwdt 0021 1303 00045 bcf STATUS, RP1 ; Select BANK0 or BANK1 0022 1683 00046 bsf STATUS, RP0 ; Select BANK1 0023 3005 00047 movlw (1<