Download Print this page

Motorola EXORdisk II User Manual page 345

Advertisement

INPUTIOUTPUT PROVISIONS
26.2 -- Device Independent liD
device driver in the uB" accumulator.
For devices
that
can
process
both input and outputJ
the IaCE must be interrogated
("10"
of
IOCDTT)
by
the
device
driver
to
determine
which
function
is
to
be
performed.
Since the index register is
re~uired
to execute the Jump to subroutine
instructionJ
the
address
of the
IOCB
is passed to the device driver using the
Tollo~ing
convention:
IOC?TR
~SR
FDB
BCS
FDB
DV$10,X
IOCPTR
ERROR
IOCB
CALL TO DRIVER
POINTER TO
IOCB~S
POINTER
RETURN
HERE
FROM DRIVER
. ADDRESS OF IOCB
With this convention,
the address pushed on the stack as
a result of executing the Jump to subroutine instruction will
point to the double byte which contains
a
pointer.
It
is
the
data
at
the
address
identified
by
the pointer that
is
the
actual address of
the IOCB
itselr.
As a resultJ
the
device
driver
cannot
Just
execute
a
return
from
subroutine
inst~uction
to get back to the I/O
runction.
This
calling
sequence applies to all entry points into all device
d~ivers.
Before
returning to the
lID
function,
the
devic~
d~iver
must set an
erro~
status condition indicating
the
state
of
the
performed
action.
Two things must be configured
by
the
drivel" to indicate an el'ro1".
Fil'stl
the
IOCSTA
byte
of
the
lOeB
must
be initialized with one of the
standa~d
liD
el"~or
statuses (section
25.3.
1.
1),
Second,
the
carry
condition
code
must
be
set
to
one.
If no error occur1"ed, only the
carry condition code must be set to zero.
The
IOCSTA
entry
of
the
IOeB
need
not
be
changed
to
zero since the
I/O
function will set a normal return status before exiting.
The
"A"
and
"X"
registers
need not be preserved by the device
drive~
in any case.
The liB" register returns
the
character
received
if
the
device driver was called upon for an input
request.
26.2.3
Example of device d1"iver
The
following
example
illustT'ates
a
CDB
and
its
associated
device
driver
ror a high-speed papertape reader
(specifically,
the EXDRtape
reade~).
The system symbols from
the
MDOS
equate
file
a~e
used
throughout
this example.
First,
the
CDB
is shoUJn:
Page
26-10

Advertisement

loading

This manual is also suitable for:

Exordisk iii