annotate level1/modules/scf.asm @ 2242:2a889a511f0a

Adding Aaron Wolfe's DriveWire work
author boisy
date Thu, 24 Dec 2009 01:16:31 +0000
parents 10957d54bf16
children 033778f5de99
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * SCF - OS-9 Level One V2 SCF file manager
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 201
diff changeset
6 * Edt/Rev YYYY/MM/DD Modified by
10957d54bf16 Made all modules rev 0
boisy
parents: 201
diff changeset
7 * Comment
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
8 * ------------------------------------------------------------------
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 201
diff changeset
9 * 10 ????/??/??
10957d54bf16 Made all modules rev 0
boisy
parents: 201
diff changeset
10 * From Tandy OS-9 Level One VR 02.00.00
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12 nam SCF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 ttl OS-9 Level One V2 SCF file manager
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 use scfdefs
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 tylg set FlMgr+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 atrv set ReEnt+rev
1287
10957d54bf16 Made all modules rev 0
boisy
parents: 201
diff changeset
22 rev set $00
201
668388823050 Fixed headers to be consistent
boisy
parents: 184
diff changeset
23 edition set 10
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
26
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
27 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 name fcs /SCF/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 start lbra Create
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 lbra Open
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
34 lbra MakDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 lbra ChgDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
36 lbra Delete
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
37 lbra Seek
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
38 lbra Read
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 lbra Write
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40 lbra ReadLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 lbra WriteLn
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 lbra GetStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43 lbra PutStat
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
44 lbra Term
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
45
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
46 L0038 puls y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
47
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
48
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
49 * ChgDir/MakDir entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
50 ChgDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
51 MakDir comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
52 ldb #E$BPNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
53 L003D rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
54
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
55
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
56 * Open/Create entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
57 Open
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
58 Create ldx PD.DEV,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
59 stx <$3B,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
60 ldu PD.RGS,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
61 pshs y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
62 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
63 os9 F$PrsNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 bcs L0038
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
65 lda -1,y get last char
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 bmi L0059 branch if hi bit set
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
67 leax ,y else point X at last char + 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 os9 F$PrsNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 bcc L0038
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 L0059 sty R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
71 puls y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
72 lda #READ.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 bita PD.MOD,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
74 beq L00A2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
75 ldd #$0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 os9 F$SRqMem allocate buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 bcs L003D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 stu PD.BUF,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 bsr L0091
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 * cute message
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
83 cute fcb $62,$1B,$59,$6B,$65,$65,$2A,$11,$1C,$0D,$0F
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 fcb $42,$0C,$6C,$62,$6D,$31,$13,$0F,$0B,$49,$0C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 fcb $72,$7C,$6A,$2B,$08,$00,$02,$11,$00,$79
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 * put cute message into our newly allocated PD buffer
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
88 L0091 puls x get PC into X
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 L0094 eora ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
91 sta ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 decb
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
93 cmpa #C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
94 bne L0094
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
95 L009D sta ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
96 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
97 bne L009D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
98 L00A2 ldu PD.DEV,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 beq MakDir
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
100 ldx V$STAT,u X = static storage ptr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
101 lda <PD.PAG,y get page len
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
102 sta V.LINE,x store in static
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
103 ldx V$DESC,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 ldd <PD.D2P,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
105 beq L00C6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 leax d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
107 lda PD.MOD,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
109 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
110 lsra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
111 rolb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
112 rola
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
113 rorb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
114 rola
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
115 os9 I$Attach attach to DEV2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
116 bcs L00FD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 stu PD.DV2,y save dev entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
118 L00C6 ldu V$STAT,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 pshs b,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 ldx <V.PDLHd,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 bne L00D9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 sty <V.PDLHd,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
125 bra L00E9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
126 L00D7 tfr d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 L00D9 ldb <$3F,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 bne L00E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 inc 1,s in B on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 L00E0 ldd <$3D,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 bne L00D7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 sty <$3D,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 L00E9 lda #$29
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 inc 2,s inc B on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 lbsr L01BD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 lda 2,s get B on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
138 leas 3,s clean up stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 deca
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 bne L00FC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 lbra L01B2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 L00FC clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 L00FD rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
146 * term routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 Term tst PD.CNT,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 beq L0104 branch if count is zero
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 * seek/delete routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 Seek
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 Delete clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 L0104 ldu PD.DV2,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 beq L010B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 os9 I$Detach
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 L010B ldu PD.BUF,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
160 beq L0115
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 ldd #$0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 os9 F$SRtMem
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 L0115 ldx #$0001
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 lda #$2A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 pshs x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 ldu PD.DEV,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
167 ldu V$STAT,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 ldx <V.PDLHd,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 ldd <$3D,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 cmpy <V.PDLHd,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 bne L013A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 std <V.PDLHd,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 bne L0143
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174 clr 2,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 bra L0143
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 L0135 ldx <$3D,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 beq L0147
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178 L013A cmpy <$3D,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
179 bne L0135
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
180 std <$3D,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
181 L0143 sty <$3D,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
182 L0147 lbsr L01BD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
183 leas 3,s fix stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
184 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
185
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
186
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
187 * getstat routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
188 GetStat lda <$3F,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
189 lbne L0404
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
190 ldx PD.RGS,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
191 lda R$B,x get status code
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
192 cmpa #SS.Opt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
193 bne L0179 branch if not
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
194 pshs y,x,a
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
195 lda #SS.ComSt call driver's SS.ComSt
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
196 sta R$B,x
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
197 ldu R$Y,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
198 pshs u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
199 bsr L0179
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
200 puls u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
201 puls y,x,a
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
202 sta R$B,x
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
203 ldd R$Y,x
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
204 stu R$Y,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
205 bcs L0177
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
206 std <$34,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
207 L0177 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
208 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
209 L0179 ldb #$09 getstat offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
210 JsrDrvr pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
211 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
212 ldx PD.DEV,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
213 ldu V$STAT,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
214 ldx V$DRIV,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
215 addd M$Exec,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
216 leax d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
217 puls a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
218 jmp ,x jump into driver
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
219
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
220
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
221 * putstat routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
222 PutStat lbsr L03E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
223 L018F bsr L0198
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
224 pshs b,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
225 lbsr L0391
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
226 puls pc,b,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
227 L0198 lda R$B,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
228 ldb #$0C setstat offset
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
229 cmpa #SS.Opt SS.Opt?
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
230 bne JsrDrvr jsr into driver
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
231 * copy passed options to path desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
232 pshs y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
233 ldx R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
234 leay <PD.OPT,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
235 ldb #OPTCNT
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
236 L01A9 lda ,x+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
237 sta ,y+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
238 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
239 bne L01A9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
240 puls y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
241
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
242 L01B2 ldx <$34,y
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
243 lda #SS.ComSt
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
244 pshs x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
245 bsr L01BD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
246 puls pc,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
247 L01BD pshs u,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
248 ldx PD.RGS,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
249 ldu R$Y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
250 lda R$B,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
251 pshs u,y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
252 ldd <$10,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
253 std R$Y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
254 lda $0F,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
255 sta R$B,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
256 ldb #$0C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
257 lbsr L03E5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
258 bsr L018F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
259 puls u,y,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
260 stu R$Y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
261 sta R$B,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
262 bcc L01E6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
263 cmpb #E$UnkSvc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
264 orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
265 bne L01E6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
266 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
267 L01E6 puls u,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
268 L01E8 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
269
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
270
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
271 * read routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
272 Read lbsr L03E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
273 bcs L01E8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
274 inc PD.RAW,y
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
275 ldx R$Y,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
276 beq L0235
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
277 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
278 ldx #$0000
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
279 ldu R$X,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
280 lbsr L0348
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
281 bcs L020A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
282 tsta
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
283 beq L0220
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
284 cmpa <PD.EOF,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
285 bne L0218
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
286 L0208 ldb #E$EOF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
287 L020A leas 2,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
288 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
289 bsr L0231
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
290 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
291 puls pc,b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
292
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
293 L0213 lbsr L0348
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
294 bcs L020A
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
295 L0218 tst <PD.EKO,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
296 beq L0220
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
297 lbsr L046C
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
298 L0220 leax 1,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
299 sta ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
300 beq L022B
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
301 cmpa <PD.EOR,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
302 beq L022F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
303 L022B cmpx ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
304 bcs L0213
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
305 L022F leas $02,s
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
306 L0231 ldu PD.RGS,y
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
307 stx R$Y,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
308 L0235 lbra L0391
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
309
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
310
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
311 * readln routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
312 ReadLn lbsr L03E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
313 bcs L01E8
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
314 ldx R$Y,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
315 beq L0231
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
316 tst R$Y,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
317 beq L0248
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
318 ldx #256
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
319 L0248 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
320 ldd #$FFFF
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
321 std PD.MAX,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
322 lbsr L030D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
323 L0252 lbsr L0348
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
324 bcs L02C8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
325 tsta
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
326 beq L0265
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
327 ldb #$29
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
328 L025C cmpa b,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
329 beq L0285
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
330 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
331 cmpb #$31
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
332 bls L025C
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
333 L0265 cmpx PD.MAX,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
334 bls L026B
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
335 stx PD.MAX,y
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
336 L026B leax 1,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
337 cmpx ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
338 bcs L027B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
339 lda <$33,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
340 lbsr L046C
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
341 leax -1,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
342 bra L0252
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
343 L027B lbsr L0369
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
344 sta ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
345 lbsr L0379
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
346 bra L0252
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
347 L0285 pshs pc,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
348 leax >L0298,pcr
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
349 subb #$29
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
350 lslb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
351 leax b,x
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
352 stx 2,s
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
353 puls x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
354 jsr [,s++]
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
355 bra L0252
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
356 L0298 bra L0313
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
357 bra L02FD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
358 bra L02AA
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
359 bra L02BE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
360 bra L02D9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
361 bra L02E3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
362 puls pc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
363 bra L02FD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
364 bra L02FD
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
365 L02AA leas 2,s
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
366 sta ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
367 lbsr L0379
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
368 ldu R$Y,y
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
369 leax 1,x
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
370 stx R$Y,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
371 bsr L0332
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
372 leas 2,s
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
373 lbra L0391
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
374 L02BE leas 2,s
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
375 leax ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
376 lbeq L0208
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
377 bra L0265
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
378
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
379 L02C8 pshs b
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
380 lda #C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
381 sta ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
382 bsr L02D5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
383 puls b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
384 lbra L020A
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
385 L02D5 lda #C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
386 bra L032F
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
387 L02D9 lda <PD.EOR,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
388 sta ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
389 bsr L030D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
390 L02E0 lbsr L037E
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
391 L02E3 cmpx PD.MAX,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
392 beq L02FA
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
393 leax 1,x
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
394 cmpx 2,s
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
395 bcc L02F8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
396 lda ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
397 beq L02E0
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
398 cmpa <PD.EOR,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
399 bne L02E0
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
400 leau -1,u
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
401 L02F8 leax -1,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
402 L02FA rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
403 L02FB bsr L0317
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
404 L02FD leax ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
405 beq L030D
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
406 tst <PD.DLO,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
407 beq L02FB
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
408 tst <PD.EKO,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
409 beq L030D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
410 bsr L02D5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
411 L030D ldx #$0000
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
412 ldu PD.BUF,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
413 L0312 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
414 L0313 leax ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
415 beq L02FA
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
416 L0317 leau -1,u
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
417 leax -1,x
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
418 tst <PD.EKO,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
419 beq L0312
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
420 tst <PD.BSO,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
421 beq L032C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
422 bsr L032C
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
423 lda #C$SPAC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
424 lbsr L046C
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
425 L032C lda <PD.BSE,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
426 L032F lbra L046C
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
427 L0332 ldx R$X,u
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
428 ldu PD.BUF,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
429 L0336 lda ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
430 sta ,x+
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
431 cmpa <PD.EOR,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
432 bne L0336
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
433 rts
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
434
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
435 L0340 pshs u,y,x
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
436 ldx PD.DV2,y
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
437 ldu PD.DEV,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
438 bra L0350
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
439
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
440 L0348 pshs u,y,x
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
441 ldx PD.DEV,y
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
442 ldu PD.DV2,y U now points to dev table entry of device 2
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
443 beq L0357
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
444 L0350 ldu V$STAT,u U now points to static storage of device 2
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
445 ldb <PD.PAG,y
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
446 stb V.LINE,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
447 L0357 leax ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
448 beq L0367
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
449 tfr u,d D now holds pointer to static storage of device 2
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
450 ldu V$STAT,x U now holds ???
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
451 std V.DEV2,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
452 ldu #$0003
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
453 lbsr L04D3
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
454 L0367 puls pc,u,y,x
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
455
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
456 L0369 tst <PD.UPC,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
457 beq L0378
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
458 cmpa #'a
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
459 bcs L0378
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
460 cmpa #'z
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
461 bhi L0378
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
462 suba #32
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
463 L0378 rts
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
464 L0379 tst <PD.EKO,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
465 beq L0378
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
466 L037E cmpa #C$SPAC
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
467 bcc L0386
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
468 cmpa #C$CR
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
469 bne L0389
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
470 L0386 lbra L046C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
471 L0389 pshs a
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
472 lda #C$PERD
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
473 bsr L0386
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
474 puls pc,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
475
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
476 L0391 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
477 lda P$ID,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
478 ldx PD.DEV,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
479 bsr L039B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
480 ldx PD.DV2,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
481 L039B beq L03A5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
482 ldx V$STAT,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
483 cmpa V.BUSY,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
484 bne L03A5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
485 clr V.BUSY,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
486 L03A5 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
487
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
488 * A = PID
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
489 * X = dev entry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
490 * Y = path desc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
491 L03A6 pshs x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
492 ldx V$STAT,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
493 lda V.BUSY,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
494 beq L03C8
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
495 cmpa ,s compare to A on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
496 beq L03DD branch if same
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
497 pshs a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
498 bsr L0391
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
499 puls a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
500 os9 F$IOQu
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
501 inc PD.MIN,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
502 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
503 ldb <P$Signal,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
504 puls x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
505 beq L03A6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
506 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
507 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
508 L03C8 lda ,s get passed PID on stack
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
509 sta V.BUSY,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
510 sta V.LPRC,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
511 lda <PD.PSC,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
512 sta V.PCHR,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
513 ldd <PD.INT,y get int/qut
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
514 std V.INTR,x save in static
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
515 ldd <PD.XON,y get xon/xoff
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
516 std V.XON,x save in static
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
517 L03DD clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
518 puls pc,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
519
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
520 L03E0 lda <$3F,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
521 bne L0402
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
522 L03E5 ldx <D.Proc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
523 lda P$ID,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
524 clr PD.MIN,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
525 ldx PD.DEV,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
526 bsr L03A6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
527 bcs L03FF
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
528 ldx PD.DV2,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
529 beq L03F9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
530 bsr L03A6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
531 bcs L03FF
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
532 L03F9 tst PD.MIN,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
533 bne L03E0
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
534 clr PD.RAW,y
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
535 L03FF ldu PD.RGS,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
536 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
537 L0402 leas 2,s
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
538 L0404 ldb #E$HangUp
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
539 cmpa #$02
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
540 bcs L0411
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
541 lda PD.CPR,y
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
542 ldb #S$Kill
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
543 os9 F$Send
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
544 L0411 inc <$3F,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
545 orcc #Carry
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
546 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
547
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
548
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
549 * writeln routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
550 WriteLn bsr L03E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
551 bra L041F
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
552
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
553
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
554 * write routine
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
555 Write bsr L03E0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
556 inc PD.RAW,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
557 L041F ldx R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
558 beq L0461
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
559 pshs x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
560 ldx #$0000
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
561 ldu R$X,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
562 L042A lda ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
563 tst PD.RAW,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
564 bne L0444
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
565 lbsr L0369
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
566 cmpa #C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
567 bne L0444
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
568 lda #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
569 tst <PD.ALF,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
570 bne L0444
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
571 bsr L047A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
572 bcs L0464
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
573 lda #C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
574 L0444 bsr L047A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
575 bcs L0464
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
576 leax 1,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
577 cmpx ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
578 bcc L045B
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
579 lda -1,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
580 beq L042A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
581 cmpa <PD.EOR,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
582 bne L042A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
583 tst PD.RAW,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
584 bne L042A
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
585 L045B leas 2,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
586 L045D ldu PD.RGS,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
587 stx R$Y,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
588 L0461 lbra L0391
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
589 L0464 leas 2,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
590 pshs b,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
591 bsr L045D
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
592 puls pc,b,cc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
593
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
594 L046C pshs u,x,a
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
595 ldx PD.DV2,y
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
596 beq L0478
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
597 cmpa #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
598 beq L04A9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
599 L0476 bsr L04D0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
600 L0478 puls pc,u,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
601
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
602 L047A pshs u,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
603 ldx PD.DEV,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
604 cmpa #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
605 bne L0476
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
606 ldu V$STAT,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
607 tst V.PAUS,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
608 bne L0497
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
609 tst PD.RAW,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
610 bne L04A9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
611 tst <PD.PAU,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
612 beq L04A9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
613 dec V.LINE,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
614 bne L04A9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
615 bra L04A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
616 L0497 lbsr L0340
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
617 bcs L04A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
618 cmpa <PD.PSC,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
619 bne L0497
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
620 L04A1 lbsr L0340
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
621 cmpa <PD.PSC,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
622 beq L04A1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
623 L04A9 ldu V$STAT,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
624 clr V$USRS,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
625 lda #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
626 bsr L04D0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
627 tst PD.RAW,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
628 bne L04CE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
629 ldb <PD.NUL,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
630 pshs b
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
631 tst <PD.ALF,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
632 beq L04C5
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
633 lda #C$LF
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
634 L04C1 bsr L04D0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
635 bcs L04CC
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
636 L04C5 lda #C$NULL
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
637 dec ,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
638 bpl L04C1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
639 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
640 L04CC leas 1,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
641 L04CE puls pc,u,x,a
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
642
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
643 L04D0 ldu #$0006
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
644 L04D3 pshs u,y,x,a
184
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
645 ldu V$STAT,x
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
646 clr V.WAKE,u
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
647 ldx V$DRIV,x
34ecc559ccd7 Extensive comments added to scf.asm
boisy
parents: 0
diff changeset
648 ldd M$Exec,x
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
649 addd $05,s
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
650 leax d,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
651 lda ,s+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
652 jsr ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
653 puls pc,u,y,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
654
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
655 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
656 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
657 end