jmp
hour_inc
;no. test again
call
inc_hour
;yes. hour+1
clr
second
;second=0
clr
tmr0c.4
;stop timer0
mov
a,0b0h
;(5)
;reload timer0 counter
mov
tmr0l,a
;
mov
a,3ch
;(0.5 second)
mov
tmr0h,a
;
set
tmr0c.4
;restart timer0
ret
;
show_clock endp
;
;------------------------------------------------------------
org
0f00h
;mask data
dc
10h,20h,40h,80h
;------------------------------------------------------------
delays proc
;
mov
a,7fh
;load counter
mov
count1,a
;
d2:
;
sdz
count1
;count down count1
jmp
d2
;
ret
;
delays endp
;
;------------------------------------------------------------
inc_hour proc
;
mov
a,hourh
;
sub
a,02h
;
sz
acc
;if over 20 hours
jmp
h_201
;no. goto h_201
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_201:
;
inc
hourl
;hourl+1
mov
a,hourl
;
sub
a,0ah
;
sz
acc
;if over 10 hours?
ret
;no. return
clr
hourl
;yes. hourl=0
inc
hourh
;
hourh=0
ret
;
inc_hour endp
;
;------------------------------------------------------------
inc_min proc
;
Chapter 16 Interrupt and timer applications
217
Содержание HT-IDE
Страница 11: ...P a r t I Integrated Development Environment Part I Integrated Development Environment 1 ...
Страница 12: ...HT IDE User s Guide 2 ...
Страница 20: ...Fig 1 6 Fig 1 7 HT IDE User s Guide 10 ...
Страница 24: ...HT IDE User s Guide 14 ...
Страница 70: ...HT IDE User s Guide 60 ...
Страница 76: ...HT IDE User s Guide 66 ...
Страница 92: ...HT IDE User s Guide 82 ...
Страница 93: ...P a r t I I Development Language and Tools Part II Development Language and Tools 83 ...
Страница 94: ...HT IDE User s Guide 84 ...
Страница 148: ...HT IDE User s Guide 138 ...
Страница 150: ...Fig 12 1 Fig 12 2 HT IDE User s Guide 140 ...
Страница 154: ...HT IDE User s Guide 144 ...
Страница 192: ...HT IDE User s Guide 182 ...
Страница 194: ...HT IDE User s Guide 184 ...
Страница 218: ...HT IDE User s Guide 208 ...
Страница 235: ...P a r t V Appendix Part V Appendix 225 ...
Страница 236: ...HT IDE User s Guide 226 ...
Страница 250: ...HT IDE User s Guide 240 ...