el código assembler es el siguiente:
list p=16f870
include <p16f870.inc>
__config ( _WDT_OFF & _HS_OSC )
temp equ 0x22
org 0x00
goto inicio
org 0x04
btfss INTCON,1
goto fin
movwf temp
inicio_int
bcf STATUS,6 ;
bcf STATUS,5 ;Va al banco 0 de memoria
movlw b'00000010' ; retorna al primer display
movwf PORTC ;
movlw b'000' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
btfsc PORTB,2
goto uno
btfsc PORTB,3
goto dos
goto salida
uno ; dirá hola en la lcd
movlw b'00111000' ; selecciona operacion con 8 bit
movwf PORTC ; y dos lineas del display
movlw b'000' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'00001110' ; activa el cursor en el primer
movwf PORTC ; display para escribirlo
movlw b'000' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'00000110' ; se corre al
movwf PORTC ; siguiente display
movlw b'000' ; al escribir en él
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'01001000' ; se escribe H
movwf PORTC ;
movlw b'001' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'01001111' ; se escribe O
movwf PORTC ;
movlw b'001' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'01001001' ; se escribe l
movwf PORTC ;
movlw b'001' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'01000001' ; se escribe A
movwf PORTC ;
movlw b'001' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
goto salida
dos ; dirá chao en la lcd
movlw b'00111000' ; selecciona operacion con 8 bit
movwf PORTC ; y dos lineas del display
movlw b'000' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'00001110' ; activa el cursor en el primer
movwf PORTC ; display para escribirlo
movlw b'000' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'00000110' ; se corre al
movwf PORTC ; siguiente display
movlw b'000' ; al escribir
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'01000011' ; se escribe C
movwf PORTC ;
movlw b'001' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'010000' ; se escribe H
movwf PORTC ;
movlw b'001' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'01000001' ; se escribe A
movwf PORTC ;
movlw b'001' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
movlw b'01001111' ; se escribe O
movwf PORTC ;
movlw b'001' ;
movwf PORTA ;
bsf PORTA,2
bcf PORTA,2
goto salida
salida
bcf INTCON,1
movf temp,0
fin
retfie
inicio
bcf STATUS,6 ;
bcf STATUS,5 ;Va al banco 0 de memoria
clrf PORTA ;limpia el puerto A
clrf PORTB ;limpia el puerto B
clrf PORTC ;limpia el puerto C
bsf STATUS,5 ; Va al banco 1
movlw b'0111'; Define el puerto A
movwf ADCON1 ; como i/o digital
movlw 0x00
movwf TRISA ; Activa el puerto A como salida
movwf TRISC ; Activa el puerto C como salida
movlw 0xFF
movwf TRISB ; Activa el puerto B como entrada
bcf STATUS,5 ; Vuelve al banco 0 que es el banco de trabajo
bsf INTCON,7 ; Activa las interrupciones golbales
bsf INTCON,4 ; Activa interrupcion por entrada en PORTB
;bsf RCSTA,7 ; Activa puerto serie
goto inicio
end
gracias y suerte