mov
a,hourl
;
sub
a,0ah
;
sz
acc
;if over 10 hours?
ret
;no. return
clr
hourl
;yes. hourl=0
inc
hourh
; hourh+1
ret
;return
cal_number endp
;
;------------------------------------------------------------
show_clock proc
;
mov
a,1fh
;load counter
mov
count1,a
;
tabrdl mask
;load mask
mov
a,mask
;(active some 7-segment LED)
or
a,disp
;mask displaying data
mov
pa,a
;(update the 7-segment LED)
d1:
;
snz
pb.0
;(4)
;if key Min. Adj. is being pressed?
jmp
min_inc
;yes. deal with it
snz
pb.1
;(4)
;no. if key Hour Adj is beeing pressed?
jmp
hour_inc
;yes. deal with it
mov
a,second
;no. check sceond overflow
clr
c
;
sub
a,78h
;(6)
;78h=120 (unit: 0.5 second)
sz
acc
;if overflow?
jmp
scan_next
;no. continue scanning
clr
second
;yes. secon=0
call
cal_number ;(7)
;calculate clock digits
ret
;
scan_next:
;
sdz
count1
;if count over (counter-1)
jmp
d1
;no. scan keys again
ret
;yes. return
min_inc:
;
call
delays
;delay for key releasing
snz
pb.0
;if key was released?
jmp
min_inc
;no. test again
call
inc_min
;yes. 1
clr
second
;second=0 (reset secnod)
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
;
hour_inc:
;
call
delays
;delay for key releasing
snz
pb.1
;if key was released?
HT-IDE User’s Guide
216
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 ...