syquest.asm
上传用户:xiaoan1112
上传日期:2013-04-11
资源大小:19621k
文件大小:2k
源码类别:

操作系统开发

开发平台:

Visual C++

  1. ;========================================================
  2. COMMENT #
  3. SYQUEST.ASM
  4. Copyright (c) 1991 - Microsoft Corp.
  5. All rights reserved.
  6. Microsoft Confidential
  7. =================================================
  8.  Function that checks for a Syquest removeable
  9.  hard disk device driver.
  10.  int far SyquestCheck ( void )
  11.  
  12.  ARGUMENTS: NONE
  13.  RETURNS: int - TRUE if Syquest device
  14.       driver is installed
  15.       else FALSE.
  16. ================================================
  17. johnhe - 08-20-90
  18. END COMMENT #
  19. ; =======================================================
  20. INCLUDE model.inc
  21. ; =======================================================
  22. .DATA
  23. SyquestStr db 'SYQ'
  24. LEN_SYQUEST_STR EQU $-SyquestStr
  25. .Code
  26. ; =======================================================
  27. SyquestCheck PROC FAR USES SI DI DS ES
  28. ASSUME ES:NOTHING
  29. mov AH,52h
  30. int 21h ; ES:BX --> first DBP
  31. push BX ; Save offset
  32. mov AH,30h
  33. int 21h ; AL == Major version
  34. pop DI ; Restore DPB offset to BX
  35. add DI,17h ; DOS 2.x offset of NULL device is 17h
  36. cmp AL,2 ; See if version is really 2.x
  37. jle @f
  38. add DI,0bh ; Offset for DOS > 2.x is 22h
  39. @@:
  40. mov AX,@DATA
  41. mov DS,AX
  42. mov SI,OFFSET SyquestStr
  43. mov CX,LEN_SYQUEST_STR
  44. cld
  45. NameCmpLoop:
  46. cmp DI,0ffffh ; See if ES:DX is xxxx:ffff
  47. je NoSyquest
  48. SaveSetup:
  49. push CX ; Save name length
  50. push DI ; Save ptr to current device
  51. push SI ; Save ptr to Syquest string
  52. add DI,0ah ; ES:DI --> Device name
  53. repe cmpsb
  54. pop SI
  55. pop DI
  56. pop CX
  57. je IsSyquest
  58. les DI,ES:[DI] ; Load ptr to next device.
  59. jmp SHORT NameCmpLoop
  60. NoSyquest:
  61. xor AX,AX
  62. jmp SHORT SyquestReturn
  63. IsSyquest:
  64. mov AX,1
  65. SyquestReturn:
  66. ret
  67. SyquestCheck ENDP
  68. ; =======================================================
  69. END