No me deja adjuntar todo eso
hos copio el asm:
; Declaracion de micro
;-------------------------------------------------------------
list P=16f870
include "P16f870.inc"
; Declaracion de vectores, inicio e interrupcion
;-------------------------------------------------------------
org 0x00
goto inicio
org 0x04
goto interrupcion
org 0x05
; Configuracion del pic
;---------------------------------------------------------------
inicio
bsf STATUS,RP0
clrf TRISC
movlw b"00000110"
movwf ADCON1
clrf TRISA
movlw b"11111111"
movwf TRISB
movlw b"10010111"
movwf OPTION_REG
; Configuracion de vector de interrupcion para interrupcion RB4-7 y RB0
;------------------------------------------------------------------------------
movlw b"00011000"
movwf INTCON
bcf STATUS,RP0
movlw 0x39
movwf FSR
clrf PORTA
clrf PORTB
clrf PORTC
; rutina principal
;-------------------------------------------------------------------
contador equ 0x20
contador2 equ 0x21
alarma equ 0x22
alarma2 equ 0x23
dani equ 0x24
tabla equ 0x25
tabla2 equ 0x26
flag equ 0x38
variable1 equ 0x39
variable2 equ 0x3a
variable3 equ 0x3b
bsf INTCON,GIE
taqui clrf tabla2
movlw d"4"
movwf tabla
clrf flag
aqui btfsc flag,0
goto comprobar
movlw d"3"
movwf contador
clrf contador2
alli movfw contador2
call cuenta
movwf PORTA
talla incf contador2
decfsz contador
goto alli
goto aqui
; tabla de salidas
;-------------------------------------------------------------------
cuenta:
addwf PCL,F
retlw b"00000001"
retlw b"00000010"
retlw b"00000100"
return
; inicio de codigo de interrupcion
;-------------------------------------------------------------------
interrupcion
bcf INTCON,GIE
; Rutina de visualizacion de tecla
;-------------------------------------------------------------------
fila1 btfss PORTB,4
goto fila2
call delay
btfss PORTB,4
retfie
btfss PORTA,0
goto columna2
movlw d"1"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bsf flag,0
bcf INTCON,RBIF
retfie
columna2
btfss PORTA,1
goto columna3
movlw d"2"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
columna3
movlw d"3"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
fila2
btfss PORTB,5
goto fila3
call delay
btfss PORTB,5
retfie
btfss PORTA,0
goto columna2b
movlw d"4"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
columna2b
btfss PORTA,1
goto columna3b
movlw d"5"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
columna3b
movlw d"6"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
fila3
btfss PORTB,6
goto fila4
call delay
btfss PORTB,6
retfie
btfss PORTA,0
goto columna2c
movlw d"7"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
columna2c
btfss PORTA,1
goto columna3c
movlw d"8"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
columna3c
movlw d"9"
movwf PORTC
movwf dani
call indirecto
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
fila4
clrf PORTC
call delay2
call delay2
call delay2
clrf PORTC
bcf INTCON,RBIF
retfie
; rutina de almacenaje del dato por direccionamiento indirecto
;----------------------------------------------------------
indirecto
movwf INDF
incf FSR
return
; rutina de retardo
;-------------------------------------------------------------------
delay:
movlw d"100"
movwf contador
bcf INTCON,T0IF
movlw d"100"
movwf TMR0
delay1
btfss INTCON,T0IF
goto delay1
decfsz contador
return
goto delay
delay2:
bcf INTCON,T0IF
movlw d"1"
movwf TMR0
movlw 0xff
movwf alarma
retar movlw 0xff
movwf alarma2
retardo
btfss INTCON,T0IF
goto retardo
decfsz alarma2
goto retardo
decfsz alarma
goto retar
end