---
~~-------------------
~
945423-9701
ERASE
ERASE
FIELD
INPUT
80
8'
,.
9A
4--
HOME
-
88
82
8A
'N5
•
DEL
CHAR
CHAR
86
88
8'
(8)
134325
SPACE
20
0
30
B
'8
,5
,6
"
.
2E
Figure 3-9. Keyboard Showing Shift Mode Character Positions and Hexadecimal Codes
3.6.1 POLLING ROUTINE. Because it
is
possible for more
than
one keyboard/display
to
share
an interrupt level, it
is
necessary
to
poll a multiple-terminal system
to
determine which terminal
has interrupted the
CPU. The following code performs such a polling function.
R12
EQU
12 Workspace register 12
KBASE
DATA >80,>AO,>CO, ...
Keyboard character base
NBASES EQU $-KBASE
KBDRDY EQU
>F
Keyboard Data Ready
POLL
L1
Rl,NBASES
POLLUP
MOV
@KBASE-2(1),RI2
Transfer keyboard character base to
workspace register 12.
TB
KBDRDY
Poll for interrupt.
JEQ
CHRPRS Proceed
to
character reading sequence.
DECT
Rl
JNE POLLUP
RT
3.6.2 READ KEYBOARD. When
the
operator presses a key on the keyboard and the computer
detects
the
resulting data,
the
I/O service routine for the terminal takes control. The I/O service
routine first examines the keyboard code representing
the
character, and then branches to
the
program code
that
performs
the
desired function. Typically, the examination process necessary
to
determine the function
of
a keyboard code consists
of
executing a series
of
compare
instructions and branch instructions
or
using a jump table. The following program code
is
an
example
of
the procedure necessary to read a keyboard character and to prepare it for
examination.
The following code reads keyboard data in either interrupt-driven
or
noninterrupt-driven modes.
For
interrupt-driven operation,
the
polling code shown in
the
previous paragraph must be used
prior to this code.
3-15
Digital Systems Division