	;Expt7a.asm
        ;Project: Hee Haw Sound
	;List P = 16F84
	;#include <p16F84.inc>
	;__CONFIG 1Bh    ;_CP_OFF & _PWRTE_ON & _WDT_OFF & _RC_OSC


	ORG 0		;This is the start of memory for the program.
SetUp	BSF 03,5	;Go to Bank 1
	CLRF 06		;Make all port B output		
	BCF 03,5	;Go to Bank 0 - the program memory area.	
	CLRF 06		;Clear display
	GOTO Hee1

Hee1	MOVLW 0FFh	;Number of loops
	MOVWF 14h	;The loop file
Hee2	MOVLW 0C0h	;Duration of HIGH
	BSF 06,7	;Turn on piezo
Hee3	NOP
	DECFSZ 15h,1	;Create the HIGH time
	GOTO Hee3
	MOVLW 0C0h	;Duration of the LOW
	MOVWF 15h	;The LOW file
	BCF 06,7	;Turn off piezo
Hee4	NOP
	DECFSZ 15h,1	;Create the LOW time
	GOTO Hee4
	DECFSZ 14h,1	;Decrement the loop file
	GOTO Hee2	;Do more cycles

	MOVLW 0C0h	;Number of loops
	MOVWF 14h	;The loop file
Haw1	MOVLW 0FFh
	MOVWF 15h
	BSF 06,7	;Turn on piezo
Haw2	NOP
	DECFSZ 15h,1	;Create the HIGH time
	GOTO Haw2
	MOVLW 0FFh	;Duration of the LOW
	MOVWF 15h	;The LOW file
	BCF 06,7	;Turn off piezo
Haw3	NOP
	DECFSZ 15h,1	;Create the LOW time
	GOTO Haw3
	DECFSZ 14h,1	;Decrement the loop file
	GOTO Haw1	;Do more cycles 
	GOTO Hee1

	END		;Tells assembler end of program



