jmp
get_key
;yes. get input info
mov
a,0f7h
;(2)
;no. scan fourth row
mov
matrix,a
;hold scan code
mov
pac,a
;output pa.3 0 (latch)
mov
a,pa
;read input state
cpl
acc
;;complement input state
and
a,0f0h
;;
sz
acc
;if any input?
jmp
get_key
;yes. get input info
jmp
keyloop
;repeat from keyloop
get_key:
;get input key info
call
delays
;debounce
mov
a,pa
;test port A
or
a,0fh
;
cpl
acc
;
sz
acc
;any key hold?
jmp
go_on
;yes. go on (some key is pressed)
jmp
keyloop
;no. return to scan key again
go_on:
call
key_in
;(3)
;calculate table index
tabrdl disp
;(10)
;load display data
mov
a,disp
;;output data to port B
mov
pb,a
;(11)
;;
jmp
keyloop
;repeat keyloop
key_in proc
;get key number
mov
a,pa
;;hold port A state
mov
temp,a
;(4)
;;
get_release:
;wait for the key to be released
mov
a,pa
;test port A state
cpl
acc
;
and
a,0f0h
;
sz
acc
;(6)
;if release?
jmp
get_release
;no. keep up waiting
mov
a,0fh
;yes. calculate key number
andm
a,matrix
;(7)
;mask low nibble of scan code
mov
a,0
;keep table index at register A
get_row:
;calculate row number
rrc
matrix
;check each bit to get row number
snz
status.0
;
jmp
get_next
;if zero goto get_next
clr
c
;
add
a,4h
;(8)
;table index +4 (4 keys a row)
jmp
get_row
;continue calculating
get_next:
;
mov
tblp,a
;hold table index at register TBLP
mov
a,0efh
;
mov
mask,a
;mask=0111 1111
mov
a,0fh
;
orm
a,temp
;temp=XXXX 1111
HT-IDE User’s Guide
194
Содержание 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 ...