second db ?
;hold second
minl
db ?
;hold minute low byte
minh
db ?
;hold minute high byte
hourl
db ?
;hold hour low byte
hourh
db ?
;hold hour high byte
count1 db ?
;delay counter
mask
db ?
;hold mask
disp
db ?
;hold display data
;------------------------------------------------------------
code .section at 0 ’code’
;== program section ==
org
00h
;
jmp
start
;
org
04h
;external interrupt subroutine
reti
;for safeguard
org
08h
;timer/event 0 interrupt subroutine
inc
second
;1 (unit: 0.5second)
cpl
pb
;flash ’dot’(on 0.5s then off 0.5s)
reti
;end ISR
org
0ch
;timer/event 1 interrupt subroutine
reti
;for safeguard
start:
;
clr
intc
;initialize registers
clr
tmr0c
;to guarantee performance
clr
tmr0h
;(interrupts)
clr
tmr0l
;
clr
tmr1c
;
clr
tmr1
;
set
pac
;(ports)
set
pbc
;(input mode)
set
pcc
;
set
pdc
;
main:
clr
pac
;(1)
;set port A to output port
mov
a,7fh
;set port B to input port
mov
pbc,a
;exclude pb.7
clr
pb
;(2)
;zero variables
clr
pa
;
clr
minl
;
clr
minh
;
clr
hourl
;
clr
hourh
;
clr
second
;
mov
a,05h
;enable timer0
mov
intc,a
;
mov
a,80h
;set timer0 mode (internal clock)
mov
tmr0c,a
;
mov
a,0b0h
;(5)
;load timer0 counter (0.5 second)
mov
tmr0l,a
;(low byte)
mov
a,3ch
;
HT-IDE User’s Guide
214
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 ...