home *** CD-ROM | disk | FTP | other *** search
/ Compute! Gazette 1994 November / 1994-11b.d64 / disk.inquiry (.txt) < prev    next >
Commodore BASIC  |  2022-09-20  |  906b  |  43 lines

  1. 70 rem interrogate disk, files
  2. 80 :
  3. 90 print"[147][144]
  4. 100 [143]  is device present
  5. 110 [143]  p=0 - yes; p<>0 - no
  6. 120 [143]
  7. 130 [159] 15,8,15:[160]15:p[178]128[175]st
  8. 140 [153]"device is ";:[139] p [167] [153]"not ";
  9. 150 [153]"present"
  10. 160 :
  11. 170 [139] p [167] [128]:[143] if no drive, stop
  12. 180 :
  13. 190 :
  14. 200 [143]  is write protect on
  15. 210 [143]  w=0 - yes; w<>0 - no
  16. 220 [143]
  17. 230 [159] 15,8,15
  18. 240 [152]15,"m-r"[199](0)[199](28)
  19. 250 [161]#15,x$:w[178][198](x$[170][199](0))[175]16
  20. 260 [160] 15
  21. 270 [153]"write protect is ";:[139] w [167] [153]"not ";
  22. 280 [153]"present"
  23. 290 :
  24. 300 [143] return disk blocks available
  25. 310 [143]
  26. 320 [159] 15,8,15
  27. 330 [152]15,"m-e"[199](61)[199](198):[143] check if new disk - if so, read in bam
  28. 340 [152]15,"m-r"[199](250)[199](2):[161]#15,x$:y[178][198](x$[170][199](0)):[143] get lo byte
  29. 350 [152]15,"m-r"[199](252)[199](2):[161]#15,x$:x[178][198](x$[170][199](0)):[143] get hi byte
  30. 360 [160]15
  31. 370 b[178]x[172]256[170]y:[153] b"blocks available"
  32. 380 :
  33. 390 :
  34. 400 [143] print open device #s
  35. 410 [143]
  36. 420 n[178][194](152):[143] # open devices
  37. 430 [153] n"files open":[139] n[178]0 [167]480
  38. 440 [129] i[178]601 [164] 600[170]n
  39. 450 [153]"file number:"[194](i);
  40. 460 [153]"device number:"[194](i[170]10)
  41. 470 [130]
  42. 480 :
  43.