;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; PROCESSOR 16F877 ; Define MCU type include "p16f877.inc" __CONFIG 0x3733 ; Set config fuses CountOuter0 equ D'10'; CountInner0 equ D'15'; cblock 0x25 CountOuter CountInner pointer endc ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; Initialise Port B BANKSEL TRISB ; Select bank 1 MOVLW b'00000000' ; Port B Direction Code MOVWF TRISB ; Load the DDR code into F86 BANKSEL PORTB ; Select bank 0 GOTO reset ; Jump to main loop ; 'delay' subroutine ........................................ delay movlw CountOuter0 movwf CountOuter DecO movlw CountInner0 movwf CountInner DecI nop decfsz CountInner, F goto DecI decfsz CountOuter, F goto DecO return ;.......................................................... table:addwf PCL; RETLW 23; RETLW 24; addlw 3; retlw 47; retlw 7f; retlw 39; ; Start main loop ........................................... reset:clrf pointer; loop:movf pointer,0; call table; movwf PORTB; call delay; incf pointer,1; btfss pointer,2; goto loop;  goto $; END ; Terminate source code