Aim:
To write an assembly language program to generate the square waveform of equal
duty cycles of 10ms using PIC16F877.

Algorithm:
Step1. Initialize Port B 3rd pin
Step 2. Initialize the control word with Timer0, 16 bit timer and no prescale
Step 3. Load the timer high and timer low byte with initial count values
Step 4.Clear the Timer0 interrupt flag
Step 5: Call the Delay function go to Step 8
Step 6: Toggle the Port B 3rd pin
Step 7. Repeat the flow from Step 3
Step 8: Start the Timer0
Step 9: Check the Timer0 interrupt flag
Step 10: Repeat the Step 9 until it sets
Step 11: Stop the Timer0
Step 12: Jump to the Step 6

Program for generation of Square waveform
BCF TRISB, 3
MOVLW 0X08
MOVWF T0CON
HERE: MOVLW 0XCF
MOVWF TMR0H
MOVLW 0X2C
MOVWF TMR0L
BCF INTCON, TMR0IF
CALL DELAY
BTG PORTB, 3
BRA HERE
DELAY: BSF TOCON, TMR0ON
AGAIN:BTFSS INTCON, TMR0IF
BRA AGAIN
BCF T0CON, TMR0ON
RETURN