LIST P=16F84
INCLUDE "P16F84.INC"
SAY1 EQU H'0C'
SAY2 EQU H'0D'
SAY EQU H'0E'
CLRF PORTB
BSF STATUS, 5
CLRF TRISB
MOVLW H'FF'
MOVWF TRISA
BCF STATUS, 5
BASLA1
BTFSC PORTA, 0
GOTO BASLA2
CALL SAYACAK1
BASLA2
BTFSC PORTA, 1
GOTO BASLA1
CALL SAYACAK2
SAYACAK1
MOVF SAY, W
ANDLW b'00001111'
CALL TABLO1
MOVWF PORTB
BTFSC PORTA, 2
GOTO DEVAM
CLRF SAY
GOTO SON
DEVAM
INCF SAY, 1
CALL GECIKME
GOTO SAYACAK1
TABLO1
ADDWF PCL, 1
RETLW b'0111111'
RETLW b'0000110'
RETLW b'1011011'
RETLW b'1001111'
RETLW b'1100110'
RETLW b'1101101'
RETLW b'1111101'
RETLW b'0000111'
RETLW b'1111111'
RETLW b'1101111'
RETLW b'1110111'
RETLW b'1111100'
RETLW b'0111001'
RETLW b'1011110'
RETLW b'1111001'
RETLW b'1110001'
SAYACAK2
MOVF SAY, W
ANDLW b'00001111'
CALL TABLO2
MOVWF PORTB
BTFSC PORTA, 2
GOTO DEVAM1
CLRF SAY
GOTO SON
DEVAM1
INCF SAY, 1
INCF SAY, 1
CALL GECIKME
GOTO SAYACAK2
TABLO2
ADDWF PCL, 1
RETLW b'0111111'
RETLW b'0000110'
RETLW b'1011011'
RETLW b'1001111'
RETLW b'1100110'
RETLW b'1101101'
RETLW b'1111101'
RETLW b'0000111'
RETLW b'1111111'
RETLW b'1101111'
RETLW b'1110111'
RETLW b'1111100'
RETLW b'0111001'
RETLW b'1011110'
RETLW b'1111001'
RETLW b'1110001'
GECIKME
MOVLW H'FF'
MOVWF SAY1
DONGU1
MOVLW H'FF'
MOVWF SAY2
DONGU2
DECFSZ SAY2, F
GOTO DONGU2
DECFSZ SAY1, F
GOTO DONGU1
RETURN
SON
END