Files
RomWBW/branches/dwg/Apps/crossdev/SECTORIO.C
doug e312ea9d7a this is the first serious commit of the entire apps suite.
not all there yet, but the core apps are, see coreapps.bat.
2013-02-16 05:36:54 +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 */
/********************/