Jdl.5\
______
_
~
945423-9701
3.6.4 READ CHARACTER
FROM SCREEN. When data has been assembled on
the
display
screen, the
computer
may read
that
data and store
it
in memory for use by
other
peripheral
devices
or
for future recall. The following program code may be used
to
transfer the character
from
the
screen
to
the
computer:
R2
EQU
2
Workspace register 2
R12
EQU
12
Workspace register 12
KBASE
DATA
>80
Keyboard character base
WRDSEL
EQU
>F
Select word (0=0; 1=1).
MOY
@KBASE, R12
Transfer keyboard character base
to
workspace register 12.
SBZ
WRDSEL
Select word
O.
STCR
R2,8
Read character.
3.6.5 READ CURSOR POSITION. The program may need to determine and save
the
exact
position
of
the
cursor before it jumps
to
another
part
of
the
display screen
to
read
or
write new
data. The following code allows the program
to
store the present cursor position
so
that
it may
later restore
the
cursor to
that
position:
R2
EQU
2
Workspace register 2
R12
EQU
12
Workspace register 12
KBASE
DATA
>80
Keyboard character base
WRDSEL
EQU
>F
Select word (0=0; 1=1).
MOY
@KBASE, R12
Transfer keyboard character base
to
workspace register 12.
SBO
WRDSEL
Select word 1.
STCR
R2,11
Read cursor position.
3.6.6 RESTORE CURSOR POSITION. The following code may be used
to
return the cursor
to
a position on
the
screen
that
has been previously stored in workspace register
2.
R2
EQU
2
Workspace register 2
R12
EQU
12
Workspace register 12
KBASE
DATA
>80
Keyboard character base
WRDSEL
EQU
>F
Select word (0=0; 1=1).
MOY
@KBASE, R12
Transfer keyboard character base
to
workspace register 12.
SBO
WRDSEL Select word 1.
LDCR
R2,11
Write cursor address.
3.6.7 MOVE CURSOR. The following code sequences move the cursor right
or
left, respec-
tively, in one-position increments.
WRDSEL EQU
>F
Select word (0=0; 1 = 1).
CURSOR
EQU
>A
Move cursor.
*MOYE
CURSOR RIGHT ONE POSITION
SBZ
WRDSEL
Select word
O.
SBZ CURSOR
Move cursor.
*MOYE
CURSOR LEFT ONE POSITION
SBZ
WRDSEL
Select word
O.
SBO CURSOR
Move cursor.
3-17
Digital Systems Division