;›; Procedures ReadSector(BYTE drive, CARD secnum,buf),›; WriteSector(BYTE drive, CARD secnum,buf),›; PutSector(BYTE drive, CARD secnum,buf)›;›; All use drive number [drive] sector number [secnum] and 128 or›; 256 byte buffer [buf]›;›; ReadSector will read a sector, WriteSector will write with verify, and›; PutSector will write without verify.›;›; If using SpartaDOS, the routines will use the High Speed SIO routines vector-›; ed through LSIO. Otherwise, the standard vector ($E459) is used.›;›; By Pab Sungenis - 9 Jy 1993›;››MODULE ; "SECTOR.ACT"››BYTE _ddir=$303, ;Data direction, 64=recv, 128=send› _ddev=$300, ;Device ID ($30+drive)› _ddno=$301, ;Drive number (for redundancy's sake)› _dcmd=$302 ;Command byte ››CARD _dbuf=$304, ;Buffer pointer› _sect=$30A, ;Sector number› SIO ;Address of SIO routine››PROC ChkSparta()›;›; Use this procedure BEFORE ANY I/O IS DONE. It will set the SIO variable to›; the proper value for the DOS type being used.›;›BYTE x BYTE POINTER bp›CARD c CARD POINTER cp› bp=$700 x=bp^› IF x#'S THEN› SIO=$E459› ELSE› cp=10 c=cp^ ;Get value of COMTAB› cp=c-10 ;LSIO pointer is COMTAB-10› SIO=cp^› FI›RETURN››PROC ReadSector(BYTE drive, CARD secnum,buf)› _ddir=64 ;Read data› _dcmd=$52 ;Read sector command ('R)› _dbuf=buf› _sect=secnum› _ddev=$30+drive› _ddno=drive› [$6C SIO]›RETURN››PROC WriteSector(BYTE drive, CARD secnum,buf)› _ddir=128 ;Data is going OUT.› _dcmd=$57 ;Write sector command ('W)› _dbuf=buf› _sect=secnum› _ddev=$30+drive› _ddno=drive› [$6C SIO]›RETURN››PROC PutSector(BYTE drive, CARD secnum,buf)› _ddir=128 ;Data is going OUT.› _dcmd=$50 ;Write w/o verify sector command ('P)› _dbuf=buf› _sect=secnum› _ddev=$30+drive› _ddno=drive› [$6C SIO]›RETURN››