comparison level1/cmds/del.asm @ 831:27f21cba6b30

Optimzed, now del deletes all files regardless of where -x is on command line
author boisy
date Tue, 14 Jan 2003 04:29:43 +0000
parents e9ce43cc215e
children 94475d26192c
comparison
equal deleted inserted replaced
830:80e125a9357d 831:27f21cba6b30
4 * $Id$ 4 * $Id$
5 * 5 *
6 * Ed. Comments Who YY/MM/DD 6 * Ed. Comments Who YY/MM/DD
7 * ------------------------------------------------------------------ 7 * ------------------------------------------------------------------
8 * 5 From Tandy OS-9 Level One VR 02.00.00 8 * 5 From Tandy OS-9 Level One VR 02.00.00
9 * 6 Now option can be anywhere on command line, BGP 03/01/13
10 * and all files will be deleted. Made smaller
9 11
10 nam Del 12 nam Del
11 ttl File deletion utility 13 ttl File deletion utility
12 14
13 * Disassembled 98/09/10 22:43:13 by Disasm v1.6 (C) 1988 by RML 15 * Disassembled 98/09/10 22:43:13 by Disasm v1.6 (C) 1988 by RML
17 endc 19 endc
18 20
19 tylg set Prgrm+Objct 21 tylg set Prgrm+Objct
20 atrv set ReEnt+rev 22 atrv set ReEnt+rev
21 rev set $01 23 rev set $01
22 edition set 5 24 edition set 6
23 25
24 mod eom,name,tylg,atrv,start,size 26 mod eom,name,tylg,atrv,start,size
25 27
26 InPath rmb 1 28 amode rmb 1
27 rmb 450 29 rmb 250
30 stack rmb 200
28 size equ . 31 size equ .
29 32
30 name fcs /Del/ 33 name fcs /Del/
31 fcb edition 34 fcb edition
32 35
33 HelpMsg fcb C$LF 36 HelpMsg fcb C$LF
34 fcc "Use: Del [-x] <path> {<path>} [-x]" 37 fcc "Use: Del [-x] <path> {<path>} [-x]"
35 fcb C$CR 38 fcb C$CR
36 39
37 start lda ,x 40 start lda ,x get first char on command line
38 cmpa #C$CR 41 cmpa #C$CR carriage return?
39 beq L0093 42 beq ShowHelp if so, no params, show help
40 lda #1 43 lda #READ.
41 sta <InPath 44 sta <amode
42 bsr L0054 45 pshs x save param pointer
43 leax -1,x 46 bsr GetOpts get opts
44 L0043 lda <InPath 47 puls x get param pointer
48 L0043 lda <amode
45 os9 I$DeletX 49 os9 I$DeletX
46 bcs L0051 50 bcs Exit
47 lda ,x 51 lda ,x
48 cmpa #C$CR 52 cmpa #C$CR
49 bne L0043 53 bne L0043
50 clrb 54 ExitOk clrb
51 L0051 os9 F$Exit 55 Exit os9 F$Exit
52 L0054 lda ,x+ 56
57 GetOpts ldd ,x+
53 cmpa #C$SPAC 58 cmpa #C$SPAC
54 beq L0054 59 beq GetOpts
55 cmpa #C$COMA 60 cmpa #C$COMA
56 beq L0054 61 beq GetOpts
62 cmpa #C$CR
63 beq Return
57 cmpa #'- 64 cmpa #'-
58 bne L0067 65 bne SkipName
59 bsr L0086 66 eorb #'X
60 leax 1,x 67 andb #$DF
61 rts 68 bne ShowHelp
62 L0067 pshs x 69 lda #EXEC.
63 L0069 lda ,x+ 70 sta <amode
71 ldd #$2020
72 std -1,x write over option
73 SkipName lda ,x+
64 cmpa #C$SPAC 74 cmpa #C$SPAC
65 beq L0069 75 beq GetOpts
66 cmpa #C$COMA 76 cmpa #C$COMA
67 beq L0069 77 beq GetOpts
68 cmpa #'- 78 CheckCR cmpa #C$CR
69 beq L007E 79 bne SkipName
70 cmpa #C$CR 80 Return rts
71 bne L0069 81
72 L007B puls x 82 ShowHelp leax >HelpMsg,pcr
73 rts
74 L007E bsr L0086
75 lda #C$CR
76 sta -2,x
77 bra L007B
78 L0086 lda ,x+
79 eora #'X
80 anda #$DF
81 bne L0093
82 lda #$04
83 sta <InPath
84 rts
85 L0093 leax >HelpMsg,pcr
86 ldy #80 83 ldy #80
87 clra 84 lda #2 stderr
88 os9 I$WritLn 85 os9 I$WritLn write help
89 clrb 86 bra ExitOk
90 bra L0051
91 87
92 emod 88 emod
93 eom equ * 89 eom equ *
94 end 90 end
95 91