Download Print this page

Motorola EXORdisk II User Manual page 323

Advertisement

INPUT/OUTPUT FUNCTIONS
25.3 -- Device Independent
1/0
Functions
consisted
of
only
a
carriage
return,
the
IOCB
is closed,
released,
and
control
returned
to
the
MDOS
command
interpreter
(via
the
function
.MDENT).
ather~ise,
the
entered line is written into the diskette
file.
The
input
process is repeated until only a carriage return is entered.
'"""\
The
error
message function,
.
MDERR,
is used to disp lay
standard error messages if an invalid file name specification
is
entered,
if a
file name is miSSing,
or
if'
one of the I/O
functions retu.'rns an error condition (e.
g.
I
if the file
name
already
exists in the directory,
or
i~
insu~ficient
diskette
space is available>.
The function. ADBX is used to
add
the
contents of the
B
accumulator to the index register.
Both of
these functions are discussed
in
detail
in
Chapter
27.
In this example,
the assumption is
made
that the program
i
s
i
nv
0
ked
r
l' 0
m
the
MDOS
comma n d 1
i
n e .
Th us,
i
t mu s t b e
origined to load above location
$lFFF.
The stack pointer
is
automatically
initialized
through
the
loading
process to
point to the last-loaded program location.
The
stack
area
has
been
set
up
so
that
the
de~ault
value
o~
the stack
pointer can
be
used without having to execute
a
load
stack
pointer
inst~uction.
* *
DEFINE SOME WORKING STORAGE
*
PFNPAK FDB
PROMPT FeB
*
0,0
': , EDT
PROCESS FILE NAME PACKET
INPUT PROMPT
*
EXTRACT THE FILE NAME FROM THE COMMAND LINE
*
START
*
ERRl
ERR2
*
LDX
STX
LDX
STX
LDX
SCALL
TSTB
BEG
ASLB
BCS
LDAB
BRA
LDAB
SCALL
BRA
ERR3.
CLRB
BRA
*
#OUT?UT+IDCLUN .
PFNPAK+2
DESTINATION OF FILE NAME
CBUFP$
POINTER INTO CMD BUFFER
PFNPA~
SOURCE OF FILE NAME
#PFNPAK
.PFNAM
STARTA
ERR
1
#7
ERR2
#5
. MDERR
MDOS
ERR2
FORMAT STANDARD FILE NAME
CHECK FOR ERRORS
EO
=)
GOOD NAME
CS
=)
NAME MISSING
ILLEGAL NAME MSG NUMBER
NAME REGUIRED MSG NUMBER
DISPLAY STD ERROR MSG
EXIT THE PROGRAM
I/O ERR MSG·NUMBER; DECODED
FROM IOCSTA
*
OPEN AND RESERVE THE
loeB --
CREATE THE OUTPUT FILE
*
Page
25-50
/
.I

Advertisement

loading

This manual is also suitable for:

Exordisk iii