
jmp
d3
ret
delays endp
org
300h
;TABLE
; RYG
RYG
dc
0EBh
;1110 1011 G R
dc
0FBh
;1111 1011 O R
dc
0EBh
;1110 1011 G R
dc
0FBh
;1111 1011 O R
dc
0EBh
;1110 1011 G R
dc
0FBh
;1111 1011 O R
dc
0EBh
;1110 1011 G R
dc
0FBh
;1111 1011 O R
dc
0DBh
;1101 1011 Y R
dc
0BEh
;1011 1110 R G
dc
0BFh
;1011 1111 R O
dc
0BEh
;1011 1110 R G
dc
0BFh
;1011 1111 R O
dc
0BEh
;1011 1110 R G
dc
0BFh
;1011 1111 R O
dc
0BEh
;1011 1110 R G
dc
0BFh
;1011 1111 R O
dc
0BDh
;1011 1101 R Y
end
Program description
The program begins (1) by setting the value of the port control register to
determine which port bits are output and inputs. In this case each port bit
of port control register PAC is set to 0 as all bits in this port are used as
outputs. As the illuminated condition of the red, yellow and green lights is
fixed a table read instruction can be used to determine their values as
shown in section (2), however the values must first be setup. Because the
last page TABRDL instruction is used the table data is setup from address
300h. The highest address is 3FFh. In section (5) the table pointer is
incremented. In section (2) the display status of the LEDs is obtained from
the table, this value being placed on the output port as shown in (3). Due
to different timing delays being required for correct traffic light operation
several procedures exist within the program to provide different timings as
shown in (4) delayl, (7) delaym and (6) delays.
Chapter 15 Input/Output Applications
191
Содержание 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 ...