BIOS Cassette Logic
Software Algorithms - Interrupt
Hex
15
The cassette routine
is
called by the request type in AH. The
address of the bytes to be read from or written to the tape
is
specified ES:BX and the number of bytes to be read or written
is
specified
by
ex. The number of bytes read
is
returned in DX.
The read block and write block automatically turn the cassette
motor
on
at
the start and off at the end. The request types in
AH
and the cassette status descriptions follow:
Request
Type
Function
AH
= 0 Turn Cassette
Motor
On
AH
= 1 Turn Cassette
Motor
Off
AH = 2 Read Tape Block
Read CX
bytes
into
memory
starting
at
Address ES:BX
Return actual
number
of
bytes
read in DX
Return Cassette
Status
in
AH
AH = 3
Write
Tape Block
Write
CX
bytes
onto
cassette
starting
at
Address DS:BX
Return Cassette
Status
in
AH
Cassette
Status
Description
AH
=
00
No Errors
AH
= 01 Cyclic Redundancy Check (CRC) Error in Read Block
AH
=
02
No Data Transitions
AH
=
04
No Leader
AH
=
80
Invalid Command
Notes: The carry flag will be
set
on
any
error.
Cassette Write
The write-block routine writes a tape block onto the cassette tape.
The tape block
is
described in
"Data
Record Architecture" later
in this section.
The write-block routine turns
on
the cassette drive motor and a
synchronization bit(O) and then writes the leader(256 bytes of all
l's)
to the tape. Next, the routine writes the number of data
System BIOS
5-25