		LIST P=16F628A
		INCLUDE<P16F628A.INC>

		__CONFIG	_PWRTE_ON	&	_WDT_OFF	&	_BODEN_OFF	&	_MCLRE_OFF	&	_LVP_OFF	&	_INTRC_OSC_NOCLKOUT


CISLO1	EQU		20h
CISLO2	EQU		21h


#DEFINE	D0		PORTB,0
#DEFINE	D1		PORTB,1
#DEFINE	D2		PORTB,2
#DEFINE	D3		PORTB,3
#DEFINE	D4		PORTB,4
#DEFINE	D5		PORTB,5
#DEFINE	D6		PORTB,6
#DEFINE	D7		PORTB,7

#DEFINE	RS		PORTA,0
#DEFINE	RW		PORTA,1
#DEFINE	E		PORTA,2




		ORG		00h
		GOTO	PROGRAM

CEKEJ	INCFSZ	CISLO1,F
		GOTO	CEKEJ
		INCFSZ	CISLO2,F
		GOTO	CEKEJ
		RETURN


PROGRAM	MOVLW	B'00000111'
		MOVWF	CMCON
		BSF		STATUS,RP0
		MOVLW	B'00000000'
		MOVWF	TRISA
		MOVLW	B'00000000'
		MOVWF	TRISB
		BCF		STATUS,RP0

START	BCF		RS
		BCF		RW
		BCF		E

		MOVLW	B'00111011'
		MOVWF	PORTB
		BSF		E
		CALL	CEKEJ
		BCF		E
		CALL	CEKEJ
		MOVLW	B'00001110'
		MOVWF	PORTB
		BSF		E
		CALL	CEKEJ
		BCF		E
		CALL	CEKEJ
		MOVLW	B'00000110'
		MOVWF	PORTB
		BSF		E
		CALL	CEKEJ
		BCF		E
		CALL	CEKEJ
		MOVLW	B'01000001'
		MOVWF	PORTB
		BSF		RS
		CALL	CEKEJ
		BSF		E
		CALL	CEKEJ
		BCF		E
		CALL	CEKEJ
		GOTO	START
		

		END