Atari ST series Technical Reference Manual page 60

Hide thumbs Also See for ST series:
Table of Contents

Advertisement

The function used to read sectors is called Floprd(), and it's
called this way:
int status devnum, secnum, tracknum, sidenum, numsecs;
long buf, resvd;
status = Floprd(buf, resvd, devnum, secnum, tracknum,
sidenum, numsecs);
All of the parameters have the same meaning as in
Flopwr( ), above. Buf contains the address for the memory
buffer where the data read from the sectors will be stored.
Resvd is a longword reserved for future use, which is cur­
rently ignored, but must be present. Devnum refers to the
drive (0 = A, 1 = B). Secnum is the sector number at which
to begin reading. Tracknum is the number of the disk track,
and sidenum is the side of the disk from which to read (0 or
1). Numsecs is the number of sequential sectors of data to
read. In the case of Floprd(), the data will be read from the
sectors. Flopver() not only reads the data, but compares the
data that was read to the data still on the disk. Tracks are
automatically verified as part of the Flopfmt() function. Also,
sectors written with the BIOS function Rwabs() are automat­
ically verified if the system variable fverify (at location 1092,
$444) is set to a nonzero value, which is the default condi­
tion.
An error code is returned in status. If the status is 0, the
operation was successful. Any other return represents a sys­
tem error. For information on system errors codes, see Ap­
pendix D.
XFORMAT.C (Program 3-3) gives an example of how to
format a double-sided disk with the XBIOS disk functions.
Program 3-3. XFORMAT.C
/*
XFORMAT.C— Simple double-sided
/*
floppy format using XBIOS routines
/*
/*
/**********************************************/
flinclude <osbind.h>
int b u f [4096];
/* buffer for track formatting, etc.
main()
{
int status, sector, track, side;
/* prompt for disk and wait for key press */
52
CHAPTER 3
/* For XBIOS macro definitions */
*/
*/
*/
*/
*/

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents