-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path7segmentscroll.asm
73 lines (70 loc) · 1.14 KB
/
7segmentscroll.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
;asigns label to memories
portb equ 06h
pcl equ 02h
porta equ 05h
status equ 03h
pointer1 equ 0dh
pointer2 equ 0eh
temp1 equ 1ah
temp2 equ 1bh
bsf status,5
movlw 00h
movwf portb ;sets input and output ports
movwf porta
bcf 03h,5
movlw 00h
movwf porta
movwf portb
start
call iterate1
goto start
iterate1
movf pointer1,0
call lookup
movwf temp1
incf pointer1,1 ;pointer to the value contained in the table is incremented
movlw 00h
movwf pointer2
call iterate2
btfss pointer1,3 ;checks if the 3rd bit is set so as to reset count
goto iterate1
return
iterate2
movf pointer2,0
call lookup
movwf temp2
call times
incf pointer2,1 ;pointer to the value contained in the table is incremented
btfss pointer2,3 ;checks if the 3rd bit is set so as to reset count
goto iterate2
movlw 00h
movwf pcl
return
lookup ;the lookup table
addwf pcl,1
retlw 0c0h
retlw 0f9h
retlw 0a4h
retlw 0b0h
retlw 99h
retlw 92h
retlw 82h
retlw 0f8h
three
movlw D'1'
movwf count2
movlw D'5'
movwf count3
delay
nop
movlw D'165'
movwf count1
times
decfsz count1,1
goto times
decfsz count2,1
goto delay
decfsz count3,1
goto delay
return
end