-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathidle
57 lines (57 loc) · 1.1 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
.PAGE 'IDLE'
.SKIP3
; IDLE LOOP, WAITING FOR SOMETHING TO DO
IDLE LDA CMDWAT ; TEST FOR PENDING COMMAND
BEQ IDLE2 ; NO COMMAND WAITING
SEI
LDA #0
STA CMDWAT
STA NMIFLG ;CLEAR DEBOUNCE
JSR PARSXQ ; PARSE AND XEQ COMMAND
IDLE2 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
FILO1 LDX TEMP+3 ;LOOK THRU LINTAB
LDA LINTAB,X ;FOR ACTIVE FILE
CMP #$FF
BEQ FILO2
AND #$3F
STA LINDX
JSR GETACT
TAX
LDA LSTJOB,X ;DETERMINE WHICH DRV IT IS ON
AND #1
TAX
INC TEMP,X
FILO2 DEC TEMP+3 ;SET FLAG INDICATING DRV
BPL FILO1 ;HAS FILE OPEN
TSTFIL LDY #BFCNT-1 ;LOOK THRU JOB QUE FOR
FIL5 LDA JOBS,Y ; FOR JOBS STILL RUNNING
BPL FIL6
AND #1
TAX
INC TEMP,X ;SET FLAG INDICATING DRIVE
FIL6 DEY ;IS ACTIVE
BPL FIL5
LDA PBD2
AND #255-LED1-LED0
PHA
LDA TEMP
BEQ FILO3
PLA ;TURN ON LED IF DRIVE FLAG
ORA #LED0 ; IF NOT 0
PHA
FILO3 LDA TEMP+1
BEQ FILO4
PLA
ORA #LED1
PHA
FILO4
PLA
STA PBD2
JMP IDLE2 ;BACK TO TOP OF LOP
;
.END