-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathidlesf.src
138 lines (110 loc) · 3.4 KB
/
idlesf.src
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
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
.page
.subttl 'idlesf.src'
; idle loop, waiting for something to do
idle
cli
; release all bus lines
lda pb ; clock and data high
and #$e5 ; clock high
sta pb ; data high,atna hi
lda cmdwat ; test for pending command
beq idl1 ; no command waiting
lda #0
sta cmdwat
nop ; *** rom ds -06 *** / fill
nop ; *** rom ds -06 *** / fill
; sta nmiflg ; clear debounce
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
jmp ptch19 ; *rom ds 01/23/85*
; jsr parsxq ; parse and xeq command
rtch19 ; return
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
idl1 cli ; test for drive running or openfile
lda atnpnd
beq idl01
;<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>
jmp ptch30 ; *rom ds 02/04/85*
; 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
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