home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / basic / library / qb_pds / dos / bdisk / bdisk.inc < prev    next >
Encoding:
Text File  |  1987-12-04  |  2.3 KB  |  84 lines

  1.         .XLIST
  2. ;========================================================================
  3. ; BDISK Library Assembler Interface
  4. ;
  5. ; Declares all necessary information for easily interfacing with the
  6. ; BDISK library routines.  Just include the following line in the
  7. ; assember source code:
  8. ;
  9. ;     INCLUDE bdisk.inc
  10. ;
  11. ; AX always returns an error code (0 if no error).  All other registers
  12. ; are preserved.  Note: BP may not be used to pass parameters using
  13. ; the macros (it is used in loading the stack).  MASM version 5.00 is
  14. ; required.
  15.  
  16.         INCLUDE stddef.inc
  17.  
  18. ; Tell linker what library to include.
  19.  
  20.         INCLUDELIB bdisk
  21.  
  22. ; Declare the external routines and data.
  23.  
  24.         .DATA
  25.         EXTRN _BootSec:BYTE
  26.         .CODE
  27.         EXTRN _SetBase:FAR, _ResBase:FAR
  28.         EXTRN _SecRed:FAR, _SecVer:FAR, _SecWrt:FAR, _TrkFrm:FAR
  29.  
  30. ; Reset the floppy disk data. Should be used before the other disk
  31. ; routines. Data is restored with ResBase.
  32.  
  33. setbase MACRO trksize, secsize
  34.         push bp
  35.         ldargs <trksize, secsize>
  36.         call _SetBase
  37.         pop bp
  38.         ENDM
  39.  
  40. ; Restore the floppy disk data.  Should be used after SetBase and any
  41. ; other BDISK routines, but before disk accesses by DOS or other programs.
  42.  
  43. resbase MACRO
  44.         call _ResBase
  45.         ENDM
  46.  
  47. ; Read an absolute sector.
  48.  
  49. secred  MACRO drive, head, track, sector, count, segment, offset
  50.         push bp
  51.         ldargs <drive, head, track, sector, count, segment, offset>
  52.         call _SecRed
  53.         pop bp
  54.         ENDM
  55.  
  56. ; Verify an absolute sector.
  57.  
  58. secver  MACRO drive, head, track, sector, count
  59.         push bp
  60.         ldargs <drive, head, track, sector, count>
  61.         call _SecVer
  62.         pop bp
  63.         ENDM
  64.  
  65. ; Write an absolute sector.
  66.  
  67. secwrt  MACRO drive, head, track, sector, count, segment, offset
  68.         push bp
  69.         ldargs <drive, head, track, sector, count, segment, offset>
  70.         call _SecWrt
  71.         pop bp
  72.         ENDM
  73.  
  74. ; Format a track.  The track size and sector size (normal is 9 sec/trk
  75. ; and 512 bytes/sec) should be the same as set by SetBase.
  76.  
  77. trkfrm  MACRO drive, head, track, trksize, secsize
  78.         push bp
  79.         ldargs <drive, head, track, trksize, secsize>
  80.         call _TrkFrm
  81.         pop bp
  82.         ENDM
  83.         .LIST
  84.