home *** CD-ROM | disk | FTP | other *** search
/ C!T ROM 5 / ctrom5b.zip / ctrom5b / PROGRAM / ASM / ALIB30B / SYS3.ASM < prev    next >
Assembly Source File  |  1994-10-15  |  2KB  |  104 lines

  1.     page    66,132
  2. ;******************************** SYS3.ASM   *********************************
  3.  
  4. LIBSEG           segment byte public "LIB"
  5.         assume cs:LIBSEG , ds:nothing
  6.  
  7. ;----------------------------------------------------------------------------
  8. .xlist
  9.     include  mac.inc
  10.     include  common.inc
  11. .list
  12. comment 
  13. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -( SYSTEM  )
  14. COUNT_FLOP_DRIVES - count the number of floppy disk drives intalled
  15. ;
  16. ; inputs:    no parameters
  17. ; output:    AX = number of floppy drives
  18. ;* * * * * * * * * * * * * *
  19. 
  20.     public    COUNT_FLOP_DRIVES
  21. COUNT_FLOP_DRIVES    PROC    FAR
  22.      int     11h
  23.      SHR     AX,1
  24.      JB      CF_FND        ;JMP IF FLOPPY FOUND
  25.      XOR     AX,AX
  26.      RETF
  27. CF_FND:
  28.      PUSH    CX
  29.      AND     AX,0060h
  30.      MOV     CL,05
  31.      SHR     AX,CL
  32.      INC     AX
  33.      POP     CX
  34.      RETF
  35. COUNT_FLOP_DRIVES    ENDP
  36. comment 
  37. ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -( SYSTEM  )
  38. GET_DRV_TYPE - determine drive type
  39. ;
  40. ; inputs:    DL = drive number (0 = drive A:)
  41. ; output:    AX = floppy drive type
  42. ;             0 = invalid drive number
  43. ;             1 = 360k
  44. ;             2 = 1.2M
  45. ;             3 = 720k
  46. ;             4 = 1.44M
  47. ;* * * * * * * * * * * * * *
  48. 
  49.     public    GET_DRV_TYPE
  50. GET_DRV_TYPE    PROC    FAR
  51.      APUSH   BX,CX,DX,DI,SI,ES
  52.      MOV     SI,DX
  53.      MOV     AH,08
  54.      INT     13h
  55.      JAE     gdt_2
  56.      MOV     AH,15h
  57.      MOV     DX,SI
  58.      INT     13h
  59.      JAE     gdt_1
  60.      MOV     DX,SI
  61.      INT     11h
  62.      MOV     DH,AL
  63.      XOR     AX,AX
  64.      TEST    DH,01
  65.      JZ      gdt_exit
  66.      ROL     DH,1
  67.      ROL     DH,1
  68.      AND     DH,03
  69.      INC     DH
  70.      CMP     DL,DH
  71.      RCL     AL,1
  72.      JMP     gdt_exit
  73. gdt_1:
  74.      XOR     AL,AL
  75.      XCHG    AL,AH
  76.      JMP     gdt_exit
  77. gdt_2:
  78.      JCXZ    gdt_3
  79.      ADD     AL,BL
  80.      JNZ     gdt_exit
  81.      MOV     AX,CX
  82.      MOV     CX,0005
  83.      CMP     AX,4F12h
  84.      LOOPZ   gdt_3
  85.      CMP     AX,4F09h
  86.      LOOPZ   gdt_3
  87.      CMP     AX,4F0Fh
  88.      LOOPZ   gdt_3
  89.      CMP     AX,2709h
  90.      LOOPZ   gdt_3
  91. gdt_3:
  92.      MOV     AX,CX
  93. gdt_exit:
  94.      APOP    ES,SI,DI,DX,CX,BX
  95.      RETF
  96. GET_DRV_TYPE    ENDP
  97.  
  98.  
  99. LIBSEG    ENDS
  100.     end
  101.