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