org
08h
;timer/event 0 interrupt subroutine
reti
;for safeguard
org
0ch
;timer/event 1 interrupt subroutine
reti
;for safeguard
start:
;
clr
intc
;initialize registers
clr
tmrc
;to guarantee performance
clr
tmr
;(interrupts)
set
pac
;(ports)
set
pbc
;(input mode)
set
pcc
;
main:
mov
a,0
;(1)
;
mov
pac,a
;set port A to output port
mov
pa,a
;zero port A (all light on)
loop:
;light loop
mov
a,0
;;load table-read pointer
mov
tblp,a
;;
tabrdl rglight
;(2)
;load light state by looking up table
mov
a,rglight ;(3)
;;output light state to port A
mov
pa,a
;;
call
delayl
;(4)
;delay for a ’long’ while
inc
tblp
;(5)
;
mov
a,7
;load flash counter
mov
flash,a
;
flash1:
;flash1 loop
tabrdl rglight
;load light state
mov
a,rglight
;;
mov
pa,a
;;output light state to port A
call
delays
;(6)
;delay for a ’little’ while
inc
tblp
;
sdz
flash
;if flash light over?
jmp
flash1
;no. flash again
tabrdl rglight
;(yes. go ahead) load light state
mov
a,rglight
;;output light state to port A
mov
pa,a
;;
call
delaym
;(7)
;delay for a ’medium’ while
inc
tblp
;
;-------------------------------------------;
tabrdl rglight
;load light state
mov
a,rglight
;;output light state to port A
mov
pa,a
;;
call
delayl
;delay for a ’long’ while
inc
tblp
;
mov
a,7
;;load flash counter
mov
flash,a
;;
flash2:
;flash2 loop
Chapter 15 Input/Output Applications
189
Содержание 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 ...