Basic
I/O
System (BIOS) Functions
5-14
SET
DMA
OFFSET
ADDRESS
ENTRY
CX:
DMA
Offset
FUNCTION
12
SETDMA
RETURN
This function sets the
DMA
Offset Address. Register
CX
contains the
DMA
(Direct
Memory
Address) offset for subsequent
READ
or
WRITE
operations.
For
exam-
ple,
if
CX
is
80H when
SETDMA
is
called, all subsequent
READ
operations read
their
data
into 80H
through
OFFH offset from the
current
DMA
segment base,
and
all subsequent
WRITE
operations get their
data
from
that
address, until the next
calls to
SETDMA
and
SETDMAB
occur. This
data
is then transferred
to
the
DMA
buffer addressed by the
SETDMA
and
SETDMAB commands.
READ
SELECTED
SECTOR
ENTRY
FUNCTION
13
READ
RETURN
AL: Return Code
OH,OFFH
Assuming the drive has been selected, the track has been set, the sector has been set,
and
the
DMA
offset
and
segment base have been specified, the
READ
subroutine
attempts
to read based
on
these parameters by calling
R_
W
_COMMON
for
diskette
I/O
or
R_
W
_COMMONHD
for
hard
disk
I/O.
It
returns zero in register
AL
if the read
is
successful.
If
the read
is
not
successful, it returns OFFH in register
AL.
This routine first calculates the physical sector address from the logical track
address given by the
BDOS. It then determines whether the requested record
already exists in the
work
buffer.
If
the record is not in the buffer, the routine calls
the
appropriate
routine
to
read from the disk medium
to
a buffer.
R_
W
_COM-
MON
reads
128
bytes from a single density diskette,
and
256 bytes from double
density diskette.
R_
W
_COMMONHD
reads 8K bytes (multisector read) from the
disk
to
the work buffer. Finally, the requested record is moved from the work buffer
to
the user-specified
DMA
address.