home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / PROG / FTDRV.ZIP / FLOPPY.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-02-15  |  1.9 KB  |  93 lines

  1. ; File......: FLOPPY.ASM
  2. ; Author....: Ben Echols
  3. ; Date......: $Date:$
  4. ; Revision..: $Revision:$
  5. ; Log file..: $Logfile:$
  6. ; The original author, has given me consent to place this file into
  7. ; public domain (he is my brother-in-law)... Kevin S. Gallagher
  8. ;
  9. ; Modification history:
  10. ; ---------------------
  11. ;
  12. ; $Log:$
  13.  
  14. ;  $DOC$
  15. ;  $FUNCNAME$
  16. ;      FT_NUMDRV()
  17. ;  $CATEGORY$
  18. ;      disks
  19. ;  $ONELINER$
  20. ;      Returns the actual number of floppy disk drives present.
  21. ;  $SYNTAX$
  22. ;     FT_NUMDRV()
  23. ;  $ARGUMENTS$
  24. ;     None
  25. ;  $RETURNS$
  26. ;     - Number of floppy disk drives
  27. ;  $DESCRIPTION$
  28. ;     
  29. ;  $EXAMPLES$
  30. ;     FT_NUMDRV()
  31. ;  $END$
  32.  
  33.  
  34. Public  FT_NUMDRV
  35.  
  36. extrn   __retni:far
  37.  
  38. _NanFor Segment Word PUBLIC 'CODE'
  39.         Assume  CS:_NanFor
  40.  
  41. ;////////////////////////////////////////////////////////////////////////////
  42. ;/ Function:      FT_NUMDRV;
  43. ;/
  44. ;/ Description:   This gets the number of floppy disk drives from the 
  45. ;/                equipment word
  46. ;/
  47. ;/ Inputs:        None
  48. ;/
  49. ;/ Outputs:       INT - number of floppy disk drives.
  50. ;/
  51. ;/ History:       08/12/92 -BEN-
  52. ;////////////////////////////////////////////////////////////////////////////
  53. FT_NUMDRV       proc    far
  54.  
  55.         push    ax
  56.         push    cx
  57. ;
  58. ;       Get the equipment word
  59. ;       Check bit 0 to see if drives installed
  60. ;       If so, shift the two drive bits right,
  61. ;               mask them,
  62. ;               and add 1.
  63. ;
  64.         int     11h
  65.         push    ax
  66.         and     ax, 1
  67.         jnz     drvnum
  68.         pop     ax
  69.         sub     ax, ax
  70.         jmp     done
  71. drvnum:
  72.         pop     ax
  73.         mov     cl, 6
  74.         shr     ax, cl
  75.         and     ax, 3
  76.         add     ax, 1
  77. done:
  78.         push    ax
  79.         call    __retni
  80.         add     sp, 2
  81.  
  82.         pop     cx
  83.         pop     ax
  84.  
  85.         ret
  86.  
  87. FT_NUMDRV       endp
  88.  
  89. _NanFor         ends
  90.  
  91. end
  92.