home *** CD-ROM | disk | FTP | other *** search
- .XLIST
- ;========================================================================
- ; BDISK Library Assembler Interface
- ;
- ; Declares all necessary information for easily interfacing with the
- ; BDISK library routines. Just include the following line in the
- ; assember source code:
- ;
- ; INCLUDE bdisk.inc
- ;
- ; AX always returns an error code (0 if no error). All other registers
- ; are preserved. Note: BP may not be used to pass parameters using
- ; the macros (it is used in loading the stack). MASM version 5.00 is
- ; required.
-
- INCLUDE stddef.inc
-
- ; Tell linker what library to include.
-
- INCLUDELIB bdisk
-
- ; Declare the external routines and data.
-
- .DATA
- EXTRN _BootSec:BYTE
- .CODE
- EXTRN _SetBase:FAR, _ResBase:FAR
- EXTRN _SecRed:FAR, _SecVer:FAR, _SecWrt:FAR, _TrkFrm:FAR
-
- ; Reset the floppy disk data. Should be used before the other disk
- ; routines. Data is restored with ResBase.
-
- setbase MACRO trksize, secsize
- push bp
- ldargs <trksize, secsize>
- call _SetBase
- pop bp
- ENDM
-
- ; Restore the floppy disk data. Should be used after SetBase and any
- ; other BDISK routines, but before disk accesses by DOS or other programs.
-
- resbase MACRO
- call _ResBase
- ENDM
-
- ; Read an absolute sector.
-
- secred MACRO drive, head, track, sector, count, segment, offset
- push bp
- ldargs <drive, head, track, sector, count, segment, offset>
- call _SecRed
- pop bp
- ENDM
-
- ; Verify an absolute sector.
-
- secver MACRO drive, head, track, sector, count
- push bp
- ldargs <drive, head, track, sector, count>
- call _SecVer
- pop bp
- ENDM
-
- ; Write an absolute sector.
-
- secwrt MACRO drive, head, track, sector, count, segment, offset
- push bp
- ldargs <drive, head, track, sector, count, segment, offset>
- call _SecWrt
- pop bp
- ENDM
-
- ; Format a track. The track size and sector size (normal is 9 sec/trk
- ; and 512 bytes/sec) should be the same as set by SetBase.
-
- trkfrm MACRO drive, head, track, trksize, secsize
- push bp
- ldargs <drive, head, track, trksize, secsize>
- call _TrkFrm
- pop bp
- ENDM
- .LIST
-