processor 16F628A radix DEC __config 0x3F10 STATUS EQU 0x03 PORTA EQU 0x05 TRISA EQU 0x85 COUNT1 EQU 0x08 COUNT2 EQU 0x09 RP0 EQU 5 RP1 EQU 6 cblock 0x20 ;start of general purpose registers count1 ;used in delay routine counta ;used in delay routine countb ;used in delay routine endc org 0x0000 ;org sets the origin, 0x0000 for the 16F628, ;this is where the program starts runninggoto main BSF 0x03,RP0 CLRF TRISA BCF 0x03,RP0 real MOVLW 0x01 MOVWF PORTA call DELAY MOVLW 0x02 MOVWF PORTA call DELAY MOVLW 0x04 MOVWF PORTA call DELAY MOVLW 0x08 MOVWF PORTA call DELAY MOVLW 0x40 MOVWF PORTA call DELAY MOVLW 0x80 MOVWF PORTA call DELAY goto real DELAY movlw d'250' ;delay 250 ms (4 MHz clock) movwf count1 d1 movlw 0xC7 movwf counta movlw 0x01 movwf countb Delay_0 decfsz counta, f goto $+2 decfsz countb, f goto Delay_0 decfsz count1 ,f goto d1 retlw 0x00 END