Microcontroladores
CONTADOR_2 EQU 21h;
CONTADOR_3 EQU 22h;
BSF STATUS,RP0;
CLRF INTCON;
CLRF OPTION_REG;
MOVLW 0FFh;
MOVWF TRISB;
MOVLW 00h;
MOVWF TRISC;
MOVWF TRISD;
BCF STATUS,RP0;
MOVLW 00h;
MOVWF PORTC;
MOVWF PORTD;
INICIO
BTFSS PORTB,0;
CALL BOLA;
BTFSS PORTB,1;
CALL DADO;
BTFSS PORTB,2;
CALL CASA;
BTFSS PORTB,3;
CALL FITA;
BTFSS PORTB,4;
CALL DESLIGA;
GOTO INICIO;
BOLA
MOVLW 0Eh;
MOVWF PORTD;
MOVLW 7Ch;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Dh;
MOVWF PORTD;
MOVLW 3Fh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Bh;
MOVWF PORTD;
MOVLW 38h;
MOVWF PORTC;
CALL TEMPO;
MOVLW 07h;
MOVWF PORTD;
MOVLW 77h;
MOVWF PORTC;
CALL TEMPO;
BTFSS PORTB,0;
CALL BOLA;
BTFSS PORTB,1;
CALL DADO;
BTFSS PORTB,2;
CALL CASA;
BTFSS PORTB,3;
CALL FITA;
BTFSS PORTB,4;
CALL DESLIGA;
GOTO BOLA;
RETURN;
DADO
MOVLW 0Eh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Dh;
MOVWF PORTD;
MOVLW 0F7h;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Bh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 07h;
MOVWF PORTD;
MOVLW 3Fh;
MOVWF PORTC;
CALL TEMPO;
BTFSS PORTB,0;
CALL BOLA;
BTFSS PORTB,1;
CALL DADO;
BTFSS PORTB,2;
CALL CASA;
BTFSS PORTB,3;
CALL FITA;
BTFSS PORTB,4;
CALL DESLIGA;
GOTO BOLA;
RETURN;
CASA
MOVLW 0Eh;
MOVWF PORTD;
MOVLW 0EEh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0B6h;
MOVWF PORTD;
MOVLW 0EEh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Bh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 07h;
MOVWF PORTD;
MOVLW 3Fh;
MOVWF PORTC;
CALL TEMPO;
BTFSS PORTB,0;
CALL BOLA;
BTFSS PORTB,1;
CALL DADO;
BTFSS PORTB,2;
CALL CASA;
BTFSS PORTB,3;
CALL FITA;
BTFSS PORTB,4;
CALL DESLIGA;
GOTO BOLA;
RETURN;
FITA
MOVLW 0Eh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Dh;
MOVWF PORTD;
MOVLW 0F7h;
MOVWF PORTC;
CALL TEMPO;
MOVLW 0Bh;
MOVWF PORTD;
MOVLW 5Eh;
MOVWF PORTC;
CALL TEMPO;
MOVLW 07h;
MOVWF PORTD;