Files
RomWBW/branches/dgg/Apps/crossdev/SECTORIO.C
2013-02-16 06:43:52 +00:00

72 lines
1.3 KiB
C
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**************************************************************/
/* sectorio.c 7/30/2012 dwg - read and write physical sectors */
/**************************************************************/
/* 7/30/2012 dwg - wrsector now has c=0 for WRITE call per Wayne */
#include "cpmbios.h"
#include "bioscall.h"
int rdsector(drive,track,sector,buffer)
int drive;
int track;
int sector;
unsigned int buffer;
{
ireghl = pSELDSK;
iregbc = drive;
iregde = 0;
bioscall();
ireghl = pSETTRK;
iregbc = track;
bioscall();
ireghl = pSETSEC;
iregbc = sector;
bioscall();
ireghl = pSETDMA;
iregbc = buffer;
bioscall();
ireghl = pREAD;
bioscall();
return irega;
}
int wrsector(drive,track,sector,buffer)
int drive;
int track;
int sector;
unsigned int buffer;
{
ireghl = pSELDSK;
iregbc = drive;
iregde = 0;
bioscall();
ireghl = pSETTRK;
iregbc = track;
bioscall();
ireghl = pSETSEC;
iregbc = sector;
bioscall();
ireghl = pSETDMA;
iregbc = buffer;
bioscall();
ireghl = pWRITE;
iregbc = 0; /* default to 0 per wayne 7/30.2012 */
bioscall();
return irega;
}
/********************/
/* eof - sectorio.c */
/********************/