-
Notifications
You must be signed in to change notification settings - Fork 84
/
idle
73 lines (73 loc) · 1.22 KB
/
idle
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
.PAGE 'IDLE'
.SKIP3
; IDLE LOOP, WAITING FOR SOMETHING TO DO
IDLE LDA CMDWAT ; TEST FOR PENDING COMMAND
BEQ IDL1 ; NO COMMAND WAITING
SEI
LDA #0
STA CMDWAT
STA NMIFLG ;CLEAR DEBOUNCE
JSR PARSXQ ; PARSE AND XEQ COMMAND
IDL1 CLI ;TEST FOR DRIVE RUNNING OR OPENFILE
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
LDA LEDPRT
AND #$FF-LED1-LED0
PHA
LDA #0
STA DRVNUM
LDA TEMP
BEQ IDL7
LDA WPSW
BEQ IDL6
SEI
JSR CLDCHN
CLI
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
SEI
JSR CLDCHN
CLI
IDL8
PLA
ORA #LED1
PHA
IDL9
PLA
STA LEDPRT
JMP IDL1 ;BACK TO TOP OF LOP
;
.END