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