Download Print this page

Motorola EXORdisk II User Manual page 332

Advertisement

INPUT/QUTPUT FUNCTIONS
25.3 -- Device Independent I/O Functions
those
in
the
example given in section 25.3.8; however,
the
se~tor
I/O and update :modes
are
specified
in
the
IOCDTT
entry.
Only
a single sector is used for a sector buffer to
make the management of
logical
sectors
easier
(eliminates
calculation
of
the number of sectors read or written>'
The
logical unit number,
file name,
and suffix are
going
to
be
initialized
b~
an operator-supplied parameter obtained from
the command line.
The system symbols from
the
MDOS
e~uate
file are used throughout this example.
TEXFIL EGU
*
START OF TEXFIL IOCB
FCB
0
IOCSTA
FeB
DTSOPU+DT$SIO+DTSCLS
IOCDTT
FOB
0
IO!:DBP
FOB
0
IOCDBS
FDB
0
IOCDBE
FCC
2,DK
IOCGDW
FCB
'0+0
IOCLUN
DEFAULT
=
0
FCC
8,
IOCNAM
FCC
2JSA
IOCSUF -- DEFAULT
: ;
SA
FDB
0
IOCRIB
FOB
FDSFMA!<8 .
IOCFDF --
ASCII
FOB
0
RESERVED
FDB
0
IOCDEN
FOB
0
lOCSB?
FOB
SECBUF
IOCSBS
FDB
SECBUF+SC$SIZ-l
IOeSBE
FDB
0
IOeSBI
*
SECBUF BSZ
SCSSIZ
SECTOR BUFFER
The
code
that
is
shown
below performs the following
functions.
First, a file name specification which must
have
been
ente~ed
on the
MDOS
command line is extracted from the
command line buffer
and
placed
into
the
IOCB.
This
is
accomplished
with
the
.PFNAM
system function described in
Chapter
27.
Thenl
the
IOCB
is reserved
and
opened.
Next,
one
sector
is
read
from
the
file
and
all
upper
case
alphabetic
characters
are
converted
into
lower
case
characters.
A
special
~heck
is made
ror
punctuation marks
(period,
exclamation point, and question mark)
so
that
the
first alphabetic character following such punctuation is left
upper case.
After all bytes
within
the
sector
have
been
processed,
they are rewritten into the same sector from which
they were read.
The process is repeated until an end-or-file
condition
is encountered.
FinallYI after the file is closed
and
released,
control
is
returned
to
the
MOOS
command
interpreter via the function .MDENT.
Since the rile does not
expandl
it was opened in the
update
mode
so
that
sectors
could
be
both read from and written to the file.
It should
be noted that the logical
sectornu~b~r
should be decremented
before
a
sector is written back from where it was read.
The
error
message functionl
.MDERRI
is used to display
Page
25-59

Advertisement

loading

This manual is also suitable for:

Exordisk iii