SW1 EQU H'00' ;SW1 is triggering RA0 SW2 EQU H'01' ;SW2 is triggering RA1 SW3 EQU H'02' ;SW3 is triggering RA2 SW4 EQU H'03' ;SW4 is triggering RA3 TIMER1 EQU H'20' ;Used in delay routine TIMER2 EQU H'21' ; " " " PATERN EQU H'22' ;Pattern data for effect's ORG 0 ;Reset vector address GOTO RESET ;goto RESET routine when boot. ; ********************************************* ; * Example of a delay routine * ; ********************************************* DELAY_ROUTINE MOVLW D'100' ;54 Generate approx 10mS delay at 4Mhz CLK MOVWF TIMER2 DEL_LOOP1 MOVLW D'100' ;60 MOVWF TIMER1 DEL_LOOP2 BTFSC PORTA,SW1 GOTO MENU BTFSC PORTA,SW2 GOTO MENU BTFSC PORTA,SW3 GOTO MENU BTFSC PORTA,SW4 GOTO MENU DECFSZ TIMER1,F GOTO DEL_LOOP2 DECFSZ TIMER2,F GOTO DEL_LOOP1 RETLW 0