Download Print this page

Motorola EXORdisk II User Manual page 335

Advertisement

INPUT/OUTPUT FUNCTIONS
25.3
~=
Device Independent 110 Functions
CMPA
#
'!
EXCLAMATION
BEG
SETFLG
CMPA
#'?
GUEST ION
BNE
CONEX2
SETFLG INC
UCFLG
BRA
CONEX2
. .
*'
SAVE SOME
ROOM
FOR
STACK
..
BSZ
80
STACK
POINTER SET HERE BY LOAD
..
END
START
25.3.10 Error handling
All
o~
the I/O Tunctions discussed in this section use
the lOeB.
The first entry of the IOCB will contain an
error
status
upon
returning
from
one
of
these functions.
The
calling program is responsible
Tor
processing
these
error
conditions.
If
the
error
status
is
to
be
decoded and
displayed as a message on
the
system
console,
the
system
error
message
function,
.MDERR,
can be used.
This function
is
,described
in
detail
in
Chapter
27;
hOUlever,
it
should
be
not~d
here that a common mistake is made in calling the errol'
message function with the value returned in the
B
accumulator
by the
I/O
fu~ctions.
It is true that'this value is the same
as IaCSTA's contents;
however this is not the parameter
that
should
be
used
to
invoke the error message function.
The
errol' message function will decode
the
contents
of
IOCSTA
only if it is called with the
B
accumulator equal to zero and
with the
X
register pointing to the
IOCB.
None
of the
IIO
functions
described
here
will
return
control to the calling program ir a diskette controller errol'
is detected (only applicable
ir
the
device
type
is
OK),
These
errors
are fatal errors and will cause the program to
be aborted
(i.
e.
I
the files will not be
closed>.
An
error
message
is
displayed
on
the
system console before giving
control to
MDOS.
In
order
to
guarantee
the
integrity
of
data
riles
(especially
on
the
diskette),
it cannot
be
stressed often
enough that it is necessary Tor the calling program to
check
for
an
errol'
condition
after
each
I/O runction call.
A
common mistake is to Tail to check
ro~
e~~o~s
afte~
a
~ile
has
been
closed.
Since output can still take place during
the closing}
data at the end
o~
the file can be lost
without
being
apparent.
Another common mistake is to initialize the
IOCB
with the
1I0U
flag
o~
IOCDTT and the
IIRI!
flag
of
IOCLUN
in
the
wrong
sense.
If
the
"R"
flag is cleared
b~¥ore
the
IOCB
is reseT"¥-ed,
the ..
a ..
flag
Ulill be properly
set
by
the
functions themselves.
Page
25-62

Advertisement

loading

This manual is also suitable for:

Exordisk iii