Codigo:
list p=16F628A
#INCLUDE <P16F628A.INC>
indo equ 00h
pc equ 02h
status equ 03h
fsr equ 04h
ptoa equ 05h
ptob equ 06h
rota equ 0fh
trisa equ 85h
trisb equ 86h
dig1 equ 10h
dig2 equ 11h
dig3 equ 12h
dig4 equ 13h
loops equ 1dh
loops2 equ 1eh
pulso equ 1fh
z equ 02h
ram equ 05h
c equ 00h
w equ 00h
org 00h
goto Inicio
org 04h
btfss intcon,1
goto sale
incf pulso
btfsc portb,0
goto $-1
bcf intcon,1
retfie
org 10h
inicio bsf status, ram
movlw b"00010000"
movwf trisa
movlw 00h
movwf trisb
bcf status, ram
clrf dig1
clrf dig2
clrf dig3
clrf dig4
clrf pulso
movlw 00
movwf ptoa
movf pulso,w
addwf pcl,f
goto inicio
goto empe
goto ciclo
empe call subir
movlw 08h
movwf rota
movlw dig1
movwf fsr
disp movlw 00h
movwf ptob
movf rota, w
movwf ptoa
movf indo, w
call tabla
movwf ptob
movlw 03h
call retardo
btfsc rota, 0
goto empe
bcf status, c
rrf rota
incf fsr
goto disp
retardo
movwf loops
top2 movlw d"110"
movwf loops2
top nop
nop
nop
nop
nop
nop
decfsz loops2
goto top
decfsz loops
goto top2
retlw 0
s1000
clrf dig2
incf dig1
movf dig1, w
xorlw 0ah
btfsc status, z
clrf dig1
return
s100
clrf dig3
incf dig2
movf dig2, w
xorlw 0ah
btfsc status, z
call s1000
return
s10
clrf dig4
incf dig3
movf dig3, w
xorlw 0ah
btfsc status, z
call s100
return
subir
incf dig4
movf dig4, w
xorlw 0ah
btfsc status, z
call s10
movlw d"250"
call retardo
return
tabla
addwf pc
retlw b"00111111"
retlw b"00011000"
retlw b"01110110"
retlw b"01111100"
retlw b"01011001"
retlw b"01101101"
retlw b"01101111"
retlw b"00111000"
retlw b"01111111"
retlw b"01111101"
ciclo nop
nop
nop
nop
goto ciclo
end