Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/deldir.asm @ 2265:581d99904cc5
makefiles updated
author | boisy |
---|---|
date | Mon, 28 Dec 2009 01:29:05 +0000 |
parents | 20841f236e32 |
children |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Deldir - Delete a directory | |
3 * | |
4 * $Id$ | |
5 * | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
6 * Edt/Rev YYYY/MM/DD Modified by |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
7 * Comment |
0 | 8 * ------------------------------------------------------------------ |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
9 * 3 ????/??/?? |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
10 * From Tandy OS-9 Level Two VR 02.00.01. |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
11 * |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
12 * 4 2003/01/14 Boisy G. Pitre |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
13 * Updated to add -e instead of e to dir. |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
14 * |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
15 * 2003/06/21 Boisy G. Pitre |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
16 * Optimized for size. |
0 | 17 |
18 nam Deldir | |
19 ttl Delete a directory | |
20 | |
21 * Disassembled 98/09/10 23:18:11 by Disasm v1.6 (C) 1988 by RML | |
22 | |
23 ifp1 | |
24 use defsfile | |
25 endc | |
26 | |
27 tylg set Prgrm+Objct | |
28 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
29 rev set $00 |
848
c6ebca55eed3
Dir now uses -e and -x and deldir changed accordingly
boisy
parents:
686
diff
changeset
|
30 edition set 4 |
0 | 31 |
32 mod eom,name,tylg,atrv,start,size | |
33 | |
924 | 34 org 0 |
686 | 35 parmptr rmb 2 |
36 fpath rmb 1 | |
37 what2do rmb 1 | |
38 stats rmb 24 | |
0 | 39 u001C rmb 4 |
40 u0020 rmb 4 | |
41 u0024 rmb 10 | |
42 u002E rmb 6 | |
43 u0034 rmb 15 | |
44 u0043 rmb 1 | |
45 u0044 rmb 1 | |
46 u0045 rmb 1 | |
47 u0046 rmb 2 | |
48 u0048 rmb 2 | |
686 | 49 buffer rmb 336 |
0 | 50 size equ . |
51 | |
52 name fcs /Deldir/ | |
53 fcb edition | |
54 | |
686 | 55 start bsr OpenPath |
56 bcs OpenErr | |
57 bsr GetOpts | |
0 | 58 bcc L002B |
686 | 59 lbsr PromptUser |
60 bcs OpenErr | |
0 | 61 lbsr L01C3 |
686 | 62 bcs OpenErr |
0 | 63 lbsr L0242 |
686 | 64 bcs OpenErr |
65 L002B lda <fpath | |
0 | 66 os9 I$Close |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
67 bcs Exit |
686 | 68 ldx <parmptr |
0 | 69 os9 I$Delete |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
70 bcs Exit |
0 | 71 lda ,x |
72 cmpa #C$CR | |
73 bne start | |
74 clrb | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
75 bra Exit |
686 | 76 OpenErr pshs b |
77 lda <fpath | |
0 | 78 os9 I$Close |
79 puls b | |
80 orcc #Carry | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
81 Exit os9 F$Exit |
686 | 82 |
83 | |
84 OpenPath stx <parmptr save parameter pointer | |
0 | 85 lda #READ.+WRITE. |
86 os9 I$Open | |
87 bcs L005D | |
686 | 88 sta <fpath |
0 | 89 bra L0089 |
686 | 90 L005D ldx <parmptr |
0 | 91 lda #DIR.+READ. |
92 os9 I$Open | |
93 bcs L0090 | |
686 | 94 sta <fpath |
95 L0068 ldx <parmptr | |
0 | 96 os9 F$PrsNam |
97 clra | |
98 incb | |
99 std <u0046 | |
100 lda ,y | |
101 cmpa #PDELIM | |
102 bne L0089 | |
103 lda #C$CR | |
104 sta ,y+ | |
105 lda #READ.+WRITE. | |
686 | 106 ldx <parmptr |
0 | 107 os9 I$ChgDir |
108 bcs L0090 | |
686 | 109 sty <parmptr |
0 | 110 bra L0068 |
111 L0089 leax <-u001C,u | |
112 stx <u0044 | |
686 | 113 clr <what2do |
0 | 114 L0090 rts |
686 | 115 |
116 GetOpts lda <fpath | |
0 | 117 ldb #SS.OPT |
686 | 118 leax stats,u |
0 | 119 os9 I$GetStt |
120 bcs L00AB | |
121 ldx <u0044 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
122 lda <PD.ATT,x |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
123 anda #DIR. |
0 | 124 beq L00AA |
125 clrb | |
126 orcc #Carry | |
127 bra L00AB | |
128 L00AA clrb | |
129 L00AB rts | |
686 | 130 |
131 Prompt fcb C$LF | |
0 | 132 fcc "Deleting directory file. " |
133 fcb C$LF | |
134 fcc "List directory, delete directory, or quit ? (l/d/q) " | |
848
c6ebca55eed3
Dir now uses -e and -x and deldir changed accordingly
boisy
parents:
686
diff
changeset
|
135 PromptL equ *-Prompt |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
136 |
686 | 137 Cont fcb C$LF |
0 | 138 fcc "Continue? (y/n) " |
848
c6ebca55eed3
Dir now uses -e and -x and deldir changed accordingly
boisy
parents:
686
diff
changeset
|
139 ContL equ *-Cont |
686 | 140 |
141 PromptUser | |
142 tstb | |
0 | 143 bne L013E |
144 lda #$01 | |
686 | 145 leax <Prompt,pcr |
848
c6ebca55eed3
Dir now uses -e and -x and deldir changed accordingly
boisy
parents:
686
diff
changeset
|
146 ldy #PromptL |
0 | 147 os9 I$WritLn |
148 L011B bcs L013E | |
686 | 149 bsr ReadKey |
0 | 150 bcs L013E |
686 | 151 ldb <what2do |
0 | 152 cmpb #$01 |
153 bne L012A | |
154 clrb | |
155 bra L013E | |
156 L012A bsr L0145 | |
157 L012C bcs L013E | |
686 | 158 leax <Cont,pcr |
848
c6ebca55eed3
Dir now uses -e and -x and deldir changed accordingly
boisy
parents:
686
diff
changeset
|
159 ldy #ContL |
0 | 160 lda #$01 |
161 os9 I$WritLn | |
162 bcs L013E | |
686 | 163 bsr ReadKey |
0 | 164 L013E rts |
686 | 165 DIR fcc "DIR" |
0 | 166 fcb C$CR |
848
c6ebca55eed3
Dir now uses -e and -x and deldir changed accordingly
boisy
parents:
686
diff
changeset
|
167 DIROPTS fcc "-E " |
872 | 168 DIROPTL equ *-DIROPTS |
0 | 169 L0145 pshs u |
686 | 170 leau <buffer,u |
0 | 171 pshs u |
872 | 172 ldb #DIROPTL |
686 | 173 leax <DIROPTS,pcr |
0 | 174 lbsr L0270 |
686 | 175 ldx <parmptr |
0 | 176 ldd <u0046 |
177 decb | |
178 lbsr L0270 | |
179 lda #C$CR | |
180 L015E sta ,u+ | |
181 tfr u,d | |
182 subd ,s | |
183 tfr d,y | |
184 puls u | |
686 | 185 leax <DIR,pcr |
186 lda #Prgrm+Objct | |
0 | 187 clrb |
188 os9 F$Fork | |
189 puls u | |
190 bcs L013E | |
191 os9 F$Wait | |
192 L0178 rts | |
686 | 193 |
194 ReadKey leax <buffer,u | |
0 | 195 ldy #80 |
848
c6ebca55eed3
Dir now uses -e and -x and deldir changed accordingly
boisy
parents:
686
diff
changeset
|
196 clra |
0 | 197 os9 I$ReadLn |
198 bcs L01B8 | |
199 L0187 lda ,x+ | |
686 | 200 cmpa #C$SPAC eat spaces |
0 | 201 beq L0187 |
202 anda #$DF | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
203 cmpa #'Y branch if Y |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
204 beq L01AD |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
205 cmpa #'L branch if L |
0 | 206 beq L01A9 |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
207 cmpa #'D branch if D |
0 | 208 beq L01A5 |
209 bra L01B4 | |
210 L01A5 ldb #$01 | |
211 bra L01AF | |
212 L01A9 ldb #$02 | |
213 bra L01AF | |
214 L01AD ldb #$04 | |
686 | 215 L01AF stb <what2do |
0 | 216 clrb |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
217 * bra L01B8 |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
218 rts |
0 | 219 L01B4 ldb #$01 |
220 orcc #Carry | |
221 L01B8 rts | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
222 |
686 | 223 DelDir fcc "DELDIR" |
0 | 224 fcb C$CR |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
225 |
686 | 226 DotDot fcc ".." |
0 | 227 fcb C$CR |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
228 |
686 | 229 L01C3 ldb <what2do |
0 | 230 bitb #$05 |
231 beq L0210 | |
686 | 232 lda <fpath |
0 | 233 pshs u |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
234 ldu #DIR.SZ*2 |
0 | 235 L01D0 ldx #$0000 |
236 os9 I$Seek | |
237 puls u | |
238 L01D8 bsr L0215 | |
239 bcs L0209 | |
686 | 240 ldx <parmptr |
0 | 241 lda #READ.+WRITE. |
242 os9 I$ChgDir | |
243 bcs L0214 | |
244 ldy <u0048 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
245 clrb |
686 | 246 lda #Prgrm+Objct |
0 | 247 pshs u |
248 leau <u0024,u | |
686 | 249 leax <DelDir,pcr |
0 | 250 os9 F$Fork |
251 puls u | |
252 bcs L0214 | |
253 os9 F$Wait | |
254 bcs L0214 | |
686 | 255 leax <DotDot,pcr |
0 | 256 lda #READ.+WRITE. |
257 os9 I$ChgDir | |
258 bcc L01D8 | |
259 L0209 cmpb #E$EOF | |
260 bne L0214 | |
261 clrb | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
262 rts |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
263 * bra L0214 |
0 | 264 L0210 ldb #$01 |
265 orcc #Carry | |
266 L0214 rts | |
686 | 267 L0215 lda <fpath |
0 | 268 leax <u0024,u |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
269 ldy #DIR.SZ |
0 | 270 os9 I$Read |
271 bcs L0238 | |
272 lda ,x | |
273 beq L0215 | |
274 os9 F$PrsNam | |
275 lda -$01,y | |
276 anda #$7F | |
277 sta -$01,y | |
278 lda #C$CR | |
279 sta ,y | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
280 clra |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
281 incb |
0 | 282 std <u0048 |
283 L0238 rts | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
284 |
686 | 285 ATTR fcc "ATTR" |
0 | 286 fcb C$CR |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
287 |
686 | 288 ATTROPTS fcc " -d" |
0 | 289 fcb C$CR |
872 | 290 ATTROPTL equ *-ATTROPTS |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
291 |
0 | 292 L0242 pshs u |
686 | 293 leau <buffer,u |
0 | 294 pshs u |
295 ldd <u0046 | |
296 decb | |
686 | 297 ldx <parmptr |
0 | 298 bsr L0270 |
686 | 299 leax <ATTROPTS,pcr |
872 | 300 ldb #ATTROPTL |
0 | 301 bsr L0270 |
302 tfr u,d | |
303 subd ,s | |
304 tfr d,y | |
305 puls u | |
686 | 306 leax <ATTR,pcr |
0 | 307 clrb |
686 | 308 lda #Prgrm+Objct |
0 | 309 os9 F$Fork |
310 bcs L026D | |
311 os9 F$Wait | |
312 L026D puls u | |
313 rts | |
314 L0270 decb | |
315 lda ,x+ | |
316 sta ,u+ | |
317 tstb | |
318 bne L0270 | |
319 rts | |
320 | |
321 emod | |
322 eom equ * | |
323 end | |
324 |