Code: Select all
status equ 0x03
pcl equ 0x02
portb equ 0x06
portc equ 0x07
portd equ 0x08
trisb equ 0x86
trisc equ 0x87
trisd equ 0x88
ssd1 equ 0x23
ssd2 equ 0x24
ssd3 equ 0x25
start
call sys_init
goto main
main call ssd_1
call ssd_2
call ssd_3
goto main
table addwf pcl,f
retlw 0x3f
retlw 0x06
retlw 0x5b
retlw 0x4f
retlw 0x66
retlw 0x6d
retlw 0x7d
retlw 0x07
retlw 0x7f
retlw 0x6f
ssd_1 clrf portb
movlw b'00000001'
movwf portc
movf ssd1,w
call table
movwf portb
;movlw b'00000001'
;movwf portc
incf ssd1
movf portb,w
xorlw 0x6f
btfss status,2
return
incf ssd1
return
ssd_2 clrf portb
movlw b'00000010'
movwf portc
movf ssd2,w
call table
movwf portb
;movlw b'00000010'
;movwf portc
movf portb,w
xorlw 0x6f
btfss status,2
return
;incf ssd2
clrf ssd1
return
ssd_3 clrf portb
movlw b'00000100'
movwf portc
movf ssd3,w
call table
movwf portb
;movlw b'00000100'
;movwf portc
movf portd,w
xorlw 0x7d
btfss status,2
return
incf ssd2
clrf ssd1
clrf ssd2
return
sys_init
bsf status,5
clrf trisb
clrf trisc
clrf trisd
bcf status,5
clrf portb
clrf portc
clrf portd
clrf ssd1
clrf ssd2
clrf ssd3
return
end