Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for chkdrv.scr

(view source code of chkdrv.scr as plain text)

  1. N CHKDRV.COM
  2. A 100
  3. OR   AL,AL   ;AL=0 if 1st drive valid
  4. JZ   010A       ; or FF if invalid
  5. MOV  AL,02      ;Return errorlevel=2
  6. MOV  AH,4C      ;Terminate
  7. INT  21         ; thru DOS
  8. MOV  DL,[005C]  ;Get drive number+1
  9. DEC  DL         ; subtract 1
  10. JNS  0116       ; not negative if okay
  11. MOV  AL,03      ;Return errorlevel=3
  12. JMP  0106       ; exit
  13. MOV  AH,04      ;Verify diskette fn
  14. MOV  AL,01      ; 1 sector
  15. MOV  CH,00      ; track 0
  16. MOV  CL,01      ; sector 1
  17. MOV  DH,00      ; side 0
  18. INT  13         ; thru BIOS
  19. JNC  012C       ;NoCarry=okay
  20. MOV  AH,00      ;Reset diskette
  21. INT  13         ; thru BIOS
  22. MOV  AL,01      ;Return errorlevel=1
  23. JMP  0106       ; exit
  24. MOV  AL,00      ;Return errorlevel=1
  25. JMP  0106       ; exit
  26.  
  27. RCX
  28. 30
  29. W
  30. Q
  31.  

page last uploaded: 2017-08-21, 14:26