	;Expt4c.asm
        ;Project: Displaying letters
	;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.	
	GOTO Main


Table	ADDWF 02h,1	;Add W to the Program Counter to create a jump. 
	RETLW 77h	;A    This is jump=0 location.   format= gfedcba
	RETLW 7Ch	;b
	RETLW 39h	;C
	RETLW 5Eh	;d
	RETLW 79h	;E
	RETLW 71h	;F
	RETLW 6Fh	;g
	RETLW 76h	;H
	RETLW 06h	;I
	RETLW 1Eh	;J
	RETLW 38h	;L
	RETLW 37h	;N
	RETLW 3Fh	;O
	RETLW 73h	;P
	RETLW 67h	;q
	RETLW 50h	;r
	RETLW 6Dh	;S
	RETLW 78h	;t
	RETLW 3Eh	;U
	RETLW 6Eh	;y


Delay	NOP		;Create approx 250mS delay
	DECFSZ 1A,1
	GOTO Delay
	DECFSZ 1B,1
	GOTO Delay
	RETURN


		
Main	CLRF 1E		;File 1E holds the jump-value for the table
Main1	MOVF 1E,0	;Copy the jump-value into W
	CALL Table	;W will return with display-value
	MOVWF 06	;Output display value
	CALL Delay	;Display for 0.25sec
	CALL Delay	;Display for 0.25sec
	CALL Delay	;Display for 0.25sec
	CLRF 06		;Clear the display
	CALL Delay	;Display for 0.25sec
	INCF 1E,1	;Increment jump-value to look at next table value
	MOVLW 14h	;The number of table-values (in hex)
	XORWF 1E,0	;Has the jump-value reached 14h?
	BTFSS 03,2	;Test the zero bit in the Status register
	GOTO Main1	;Loop to display next value 
	GOTO Main	;Start again


	END		;Tells assembler end of program