You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

74 lines
1.2KB

  1. .PAGE 'IDLE'
  2. .SKIP3
  3. ; IDLE LOOP, WAITING FOR SOMETHING TO DO
  4. IDLE LDA CMDWAT ; TEST FOR PENDING COMMAND
  5. BEQ IDL1 ; NO COMMAND WAITING
  6. SEI
  7. LDA #0
  8. STA CMDWAT
  9. STA NMIFLG ;CLEAR DEBOUNCE
  10. JSR PARSXQ ; PARSE AND XEQ COMMAND
  11. IDL1 CLI ;TEST FOR DRIVE RUNNING OR OPENFILE
  12. LDA #14
  13. STA TEMP+3
  14. LDA #0 ;IF FILE OPEN, TURN ON ACT LED
  15. STA TEMP
  16. STA TEMP+1
  17. IDL2 LDX TEMP+3 ;LOOK THRU LINTAB
  18. LDA LINTAB,X ;FOR ACTIVE FILE
  19. CMP #$FF
  20. BEQ IDL3
  21. AND #$3F
  22. STA LINDX
  23. JSR GETACT
  24. TAX
  25. LDA LSTJOB,X ;DETERMINE WHICH DRV IT IS ON
  26. AND #1
  27. TAX
  28. INC TEMP,X
  29. IDL3 DEC TEMP+3 ;SET FLAG INDICATING DRV
  30. BPL IDL2 ;HAS FILE OPEN
  31. LDY #BFCNT-1 ;LOOK THRU JOB QUE FOR
  32. IDL4 LDA JOBS,Y ; FOR JOBS STILL RUNNING
  33. BPL IDL5
  34. AND #1
  35. TAX
  36. INC TEMP,X ;SET FLAG INDICATING DRIVE
  37. IDL5 DEY ;IS ACTIVE
  38. BPL IDL4
  39. LDA LEDPRT
  40. AND #$FF-LED1-LED0
  41. PHA
  42. LDA #0
  43. STA DRVNUM
  44. LDA TEMP
  45. BEQ IDL7
  46. LDA WPSW
  47. BEQ IDL6
  48. SEI
  49. JSR CLDCHN
  50. CLI
  51. IDL6
  52. PLA ;TURN ON LED IF DRIVE FLAG
  53. ORA #LED0 ; IF NOT 0
  54. PHA
  55. IDL7
  56. INC DRVNUM
  57. LDA TEMP+1
  58. BEQ IDL9
  59. LDA WPSW+1
  60. BEQ IDL8
  61. SEI
  62. JSR CLDCHN
  63. CLI
  64. IDL8
  65. PLA
  66. ORA #LED1
  67. PHA
  68. IDL9
  69. PLA
  70. STA LEDPRT
  71. JMP IDL1 ;BACK TO TOP OF LOP
  72. ;
  73. .END