0
|
1 ********************************************************
|
|
2 * Del - An enhanced version.
|
|
3 *
|
|
4 * By: Boisy G. Pitre
|
|
5 * Southern Station, Box 8455
|
|
6 * Hattiesburg, MS 39406-8455
|
|
7 * Internet: bgpitre@seabass.st.usm.edu
|
|
8 *
|
|
9 * 03/19/92 - Added comments to program
|
|
10 * ??/??/?? - Wrote program
|
|
11
|
|
12 nam Del
|
|
13 ttl program module
|
|
14
|
|
15 ifp1
|
|
16 use defsfile
|
|
17 endc
|
|
18
|
1260
|
19 mod Size,Name,Prgrm+Objct,ReEnt+1,Start,Fin
|
0
|
20
|
|
21 Mode rmb 1 access mode byte
|
|
22 Stack rmb 200
|
|
23 Parms rmb 200
|
|
24 Fin equ .
|
|
25
|
|
26 Name fcs /Del/
|
|
27 fcb $06 Edition number
|
|
28
|
1260
|
29 Start lda #WRITE. default to current directory
|
0
|
30 sta Mode
|
|
31
|
|
32 Parse lda ,x+ get next char
|
|
33 cmpa #$20 is it a space?
|
|
34 beq Parse yep, continue parsing
|
|
35 cmpa #$0D is it eoln?
|
|
36 beq Done yep, we're through
|
|
37 cmpa #'- is it a dash (option)
|
|
38 beq GetOpt yep, parse option
|
|
39 leax -1,x else back up one char
|
|
40 bra DelFile and kill the file
|
|
41
|
|
42 GetOpt lda ,x+ get char
|
|
43 anda #$DF make uppercase
|
|
44 cmpa #'X is it X?
|
|
45 beq ChMode yep, set mode to execute
|
|
46 bra Parse else resume parsing
|
|
47
|
1260
|
48 ChMode lda #WRITE.+EXEC. delete in current exec dir.
|
0
|
49 sta Mode and save mode
|
|
50
|
|
51 DelFile lda Mode get current access mode
|
|
52 os9 I$DeletX delete the file
|
|
53 bcc Parse if not error, continue parsing
|
|
54 cmpb #214 is the error "no permission"?
|
|
55 bne Error no, fatal error
|
|
56 os9 F$PErr else print the error
|
|
57
|
|
58 NextName lda ,x+ advance to next name
|
|
59 cmpa #$20
|
|
60 beq Parse
|
|
61 cmpa #$0D
|
|
62 beq Done
|
|
63 bra NextName
|
|
64
|
|
65 Done clrb
|
|
66 Error os9 F$Exit
|
|
67
|
|
68 emod
|
|
69 Size equ *
|
|
70 end
|
1260
|
71
|