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.

idlesf.src 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. .page 'idle...sf'
  2. ; idle loop, waiting for something to do
  3. idle
  4. cli
  5. ; release all bus lines
  6. lda pb ; clock and data high
  7. ; data high,atna hi
  8. and #$e5 ; clock high
  9. sta pb
  10. ;
  11. lda cmdwat ; test for pending command
  12. beq idl1 ; no command waiting
  13. lda #0
  14. sta cmdwat
  15. sta nmiflg ; clear debounce
  16. jsr parsxq ; parse and xeq command
  17. idl1 cli ; test for drive running or openfile
  18. lda atnpnd
  19. beq idl01
  20. ;##### GCB 11/20/86 serial bus bug. Clear 6522 int flag. #################
  21. jmp ptch16
  22. ; jmp atnsrv ; service atn irq
  23. ;##########################################################################
  24. idl01
  25. cli
  26. lda #14
  27. sta temp+3
  28. lda #0 ; if file open, turn on act led
  29. sta temp
  30. sta temp+1
  31. idl2 ldx temp+3 ; look thru lintab
  32. lda lintab,x ; for active file
  33. cmp #$ff
  34. beq idl3
  35. and #$3f
  36. sta lindx
  37. jsr getact
  38. tax
  39. lda lstjob,x ; determine which drv it is on
  40. and #1
  41. tax
  42. inc temp,x
  43. idl3 dec temp+3 ; set flag indicating drv
  44. bpl idl2 ; has file open
  45. ldy #bfcnt-1 ; look thru job que for
  46. idl4 lda jobs,y ; for jobs still running
  47. bpl idl5
  48. and #1
  49. tax
  50. inc temp,x ; set flag indicating drive
  51. idl5 dey ; is active
  52. bpl idl4
  53. sei
  54. ; dont allow irq when reading ledprt **********************
  55. lda ledprt
  56. and #$ff-led0
  57. pha
  58. lda drvnum
  59. sta r0
  60. lda #0
  61. sta drvnum
  62. lda temp
  63. beq idl7
  64. lda wpsw
  65. beq idl6
  66. jsr cldchn
  67. idl6
  68. pla ; turn on led if drive flag
  69. ora #led0 ; if not 0
  70. pha
  71. idl7
  72. inc drvnum
  73. lda temp+1
  74. beq idl9
  75. lda wpsw+1
  76. beq idl8
  77. jsr cldchn
  78. idl8
  79. pla
  80. ora #led1
  81. pha
  82. idl9
  83. lda r0
  84. sta drvnum
  85. pla
  86. ldx erword
  87. beq idl12 ; no error flashing
  88. ;
  89. lda ledprt ; use current leds
  90. cpx #$80
  91. bne idl10 ; not ist time
  92. ;
  93. ;pha
  94. ;beep here**************
  95. ;pla
  96. jmp idl11
  97. ;
  98. idl10
  99. ldx timer1
  100. bmi idl12 ; still timing
  101. ;
  102. ldx #$a0 ; count 8 msec
  103. stx timer1
  104. idl11
  105. dec erword ; count units of 8 msec
  106. bne idl12 ; keep counting
  107. ;
  108. eor erled ; toggle led
  109. ldx #16 ; count 16 units
  110. stx erword
  111. idl12
  112. sta ledprt ; set leds
  113. jmp idl1 ; back to top of lop
  114. ;
  115. ; .end