Chapter
1
I
System
Calls
Calls
AL
=
6
and
AL
=
7:
These calls allow you
to
check if a file handle is ready
for input or output. Checking the status
of
handles open
to
a device is the intended use of these calls. Checking
the status of
a
handle open
to
a disk file is also allowed,
and
is
defined
as
follows:
Input: Always ready (AL
=
FFH) until end
of
file is
reached, then always not ready (AL
=
00H) un-
less the current position is changed via the Move
a
File Pointer function call
(42H).
Output: Always ready (even if disk is full).
Note:
The status is defined at the time the system is
called. In future versions
of
MS-DOS, by the time control
is returned
to
the user from the system, the status re-
turned may not correctly reflect the true current state
of
the device or file.
Entry Conditions:
AH
=
44H
BX
=
handle
BL
=
drive (0=default,
1
=A,
etc.) (for
calls
AL=4,
5)
DS:DX
=
pointer to data or buffer
CX
=
number of bytes to read or write
AL
=
function
code
(0-7; see below)
Exit Conditions:
Carry set:
Carry not set:
AX
=
error
code
For
calls AL
=
2,
3,
4,
5:
For calls AL
=
6,
7:
or
AX
=
number of bytes transferred
AX
=
OOH (not ready)
AX
=
FFH (ready)
118