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.

114 lines
1.9KB

  1. .PAGE 'IDLE...SF'
  2. .SKIP3
  3. ; IDLE LOOP, WAITING FOR SOMETHING TO DO
  4. IDLE
  5. CLI
  6. ; RELEASE ALL BUS LINES
  7. LDA PB ;CLOCK AND DATA HIGH
  8. ; DATA HIGH,ATNA HI
  9. AND #$E5 ; CLOCK HIGH
  10. STA PB
  11. ;
  12. LDA CMDWAT ; TEST FOR PENDING COMMAND
  13. BEQ IDL1 ; NO COMMAND WAITING
  14. LDA #0
  15. STA CMDWAT
  16. STA NMIFLG ;CLEAR DEBOUNCE
  17. JSR PARSXQ ; PARSE AND XEQ COMMAND
  18. IDL1 CLI ;TEST FOR DRIVE RUNNING OR OPENFILE
  19. LDA ATNPND
  20. BEQ IDL01
  21. ;
  22. JMP ATNSRV ;SERVICE ATN IRQ
  23. IDL01
  24. CLI
  25. LDA #14
  26. STA TEMP+3
  27. LDA #0 ;IF FILE OPEN, TURN ON ACT LED
  28. STA TEMP
  29. STA TEMP+1
  30. IDL2 LDX TEMP+3 ;LOOK THRU LINTAB
  31. LDA LINTAB,X ;FOR ACTIVE FILE
  32. CMP #$FF
  33. BEQ IDL3
  34. AND #$3F
  35. STA LINDX
  36. JSR GETACT
  37. TAX
  38. LDA LSTJOB,X ;DETERMINE WHICH DRV IT IS ON
  39. AND #1
  40. TAX
  41. INC TEMP,X
  42. IDL3 DEC TEMP+3 ;SET FLAG INDICATING DRV
  43. BPL IDL2 ;HAS FILE OPEN
  44. LDY #BFCNT-1 ;LOOK THRU JOB QUE FOR
  45. IDL4 LDA JOBS,Y ; FOR JOBS STILL RUNNING
  46. BPL IDL5
  47. AND #1
  48. TAX
  49. INC TEMP,X ;SET FLAG INDICATING DRIVE
  50. IDL5 DEY ;IS ACTIVE
  51. BPL IDL4
  52. SEI ; DONT ALLOW IRQ WHEN READING LEDPRT **********************
  53. LDA LEDPRT
  54. AND #$FF-LED0
  55. PHA
  56. LDA DRVNUM
  57. STA R0
  58. LDA #0
  59. STA DRVNUM
  60. LDA TEMP
  61. BEQ IDL7
  62. LDA WPSW
  63. BEQ IDL6
  64. JSR CLDCHN
  65. IDL6
  66. PLA ;TURN ON LED IF DRIVE FLAG
  67. ORA #LED0 ; IF NOT 0
  68. PHA
  69. IDL7
  70. INC DRVNUM
  71. LDA TEMP+1
  72. BEQ IDL9
  73. LDA WPSW+1
  74. BEQ IDL8
  75. JSR CLDCHN
  76. IDL8
  77. PLA
  78. ORA #LED1
  79. PHA
  80. IDL9
  81. LDA R0
  82. STA DRVNUM
  83. PLA
  84. LDX ERWORD
  85. BEQ IDL12 ;NO ERROR FLASHING
  86. ;
  87. LDA LEDPRT ;USE CURRENT LEDS
  88. CPX #$80
  89. BNE IDL10 ;NOT IST TIME
  90. ;
  91. ;PHA
  92. ;BEEP HERE**************
  93. ;PLA
  94. JMP IDL11
  95. ;
  96. IDL10
  97. LDX TIMER1
  98. BMI IDL12 ;STILL TIMING
  99. ;
  100. LDX #$A0 ;COUNT 8 MSEC
  101. STX TIMER1
  102. IDL11
  103. DEC ERWORD ;COUNT UNITS OF 8 MSEC
  104. BNE IDL12 ;KEEP COUNTING
  105. ;
  106. EOR ERLED ;TOGGLE LED
  107. LDX #16 ;COUNT 16 UNITS
  108. STX ERWORD
  109. IDL12
  110. STA LEDPRT ;SET LEDS
  111. JMP IDL1 ;BACK TO TOP OF LOP
  112. ;
  113. .END