mov
tmr0h,a
;(high byte)
set
tmr0c.4
;start timer0
loop:
;(3)
;
mov
a,0
;zero table index
mov
tblp,a
;
mov
a,minl
;load display data
mov
disp,a
;(’low’ minute)
call
show_clock
;show displaying up (4th 7-segment)
inc
tblp
;
mov
a,minh
;load displaying data
mov
disp,a
;(’high’ minute)
call
show_clock
;show displaying up (3rd 7-segment)
inc
tblp
;
mov
a,hourl
;load displaying data
mov
disp,a
;(’low’ hour)
call
show_clock
;show displaying up (2nd 7-segment)
inc
tblp
;
mov
a,hourh
;load displaying data
mov
disp,a
;(’high’ hour)
call
show_clock
;show displaying up (1st 7-segment)
jmp
loop
;repeat from loop
;------------------------------------------------------------
cal_number proc
;
inc
minl
;minl+1
mov
a,minl
;
sub
a,0ah
;
sz
acc
;if over 10 minutes?
ret
;no. return
clr
minl
;yes. minl=0
inc
minh
; minh+1
mov
a,minh
;
sub
a,06h
;
sz
acc
;if over 60 minutes?
ret
;no. return
clr
minh
;yes. minh=0
mov
a,hourh
;
sub
a,02h
;
sz
acc
;if over 20 hours?
jmp
h_20
;no. goto h_20
inc
hourl
;yes. hourl+1
mov
a,hourl
;
sub
a,04h
;
sz
acc
;if over 24 hours?
ret
;no. return
clr
hourl
;yes. hourl=0
clr
hourh
;
hourh=0
ret
;return
h_20:
;
inc
hourl
;hour1+1
Chapter 16 Interrupt and timer applications
215
Summary of Contents for HT-IDE
Page 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Page 12: ...HT IDE User s Guide 2 ...
Page 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Page 24: ...HT IDE User s Guide 14 ...
Page 70: ...HT IDE User s Guide 60 ...
Page 76: ...HT IDE User s Guide 66 ...
Page 92: ...HT IDE User s Guide 82 ...
Page 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Page 94: ...HT IDE User s Guide 84 ...
Page 148: ...HT IDE User s Guide 138 ...
Page 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Page 154: ...HT IDE User s Guide 144 ...
Page 192: ...HT IDE User s Guide 182 ...
Page 194: ...HT IDE User s Guide 184 ...
Page 218: ...HT IDE User s Guide 208 ...
Page 235: ...P a r t V Appendix Part V Appendix 225 ...
Page 236: ...HT IDE User s Guide 226 ...
Page 250: ...HT IDE User s Guide 240 ...