Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/del.asm @ 1020:c1a5613ffe7b
changes
author | boisy |
---|---|
date | Thu, 06 Mar 2003 01:41:03 +0000 |
parents | c155aac72190 |
children | 84ea83668304 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Del - File deletion utility | |
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:
11
diff
changeset
|
8 * 5 From Tandy OS-9 Level One VR 02.00.00 |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
9 * 6 Now option can be anywhere on command line, BGP 03/01/13 |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
10 * and all files will be deleted. Made smaller |
0 | 11 |
12 nam Del | |
13 ttl File deletion utility | |
14 | |
15 * Disassembled 98/09/10 22:43:13 by Disasm v1.6 (C) 1988 by RML | |
16 | |
17 ifp1 | |
18 use defsfile | |
19 endc | |
20 | |
921
617c1b90e623
Added DOHELP conditionals, set all to zero to eliminate help from commands
boisy
parents:
832
diff
changeset
|
21 DOHELP set 0 |
832 | 22 |
0 | 23 tylg set Prgrm+Objct |
24 atrv set ReEnt+rev | |
25 rev set $01 | |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
26 edition set 6 |
0 | 27 |
28 mod eom,name,tylg,atrv,start,size | |
29 | |
924 | 30 org 0 |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
31 amode rmb 1 |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
32 rmb 250 |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
33 stack rmb 200 |
0 | 34 size equ . |
35 | |
36 name fcs /Del/ | |
37 fcb edition | |
38 | |
832 | 39 IFNE DOHELP |
0 | 40 HelpMsg fcb C$LF |
41 fcc "Use: Del [-x] <path> {<path>} [-x]" | |
42 fcb C$CR | |
832 | 43 ENDC |
0 | 44 |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
45 start lda ,x get first char on command line |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
46 cmpa #C$CR carriage return? |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
47 beq ShowHelp if so, no params, show help |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
48 lda #READ. |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
49 sta <amode |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
50 pshs x save param pointer |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
51 bsr GetOpts get opts |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
52 puls x get param pointer |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
53 L0043 lda <amode |
0 | 54 os9 I$DeletX |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
55 bcs Exit |
0 | 56 lda ,x |
57 cmpa #C$CR | |
58 bne L0043 | |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
59 ExitOk clrb |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
60 Exit os9 F$Exit |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
61 |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
62 GetOpts ldd ,x+ |
0 | 63 cmpa #C$SPAC |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
64 beq GetOpts |
0 | 65 cmpa #C$COMA |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
66 beq GetOpts |
0 | 67 cmpa #C$CR |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
68 beq Return |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
69 cmpa #'- |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
70 bne SkipName |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
71 eorb #'X |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
72 andb #$DF |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
73 bne ShowHelp |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
74 lda #EXEC. |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
75 sta <amode |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
76 ldd #$2020 |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
77 std -1,x write over option |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
78 SkipName lda ,x+ |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
79 cmpa #C$SPAC |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
80 beq GetOpts |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
81 cmpa #C$COMA |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
82 beq GetOpts |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
83 CheckCR cmpa #C$CR |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
84 bne SkipName |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
85 Return rts |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
86 |
832 | 87 ShowHelp equ * |
88 IFNE DOHELP | |
89 leax >HelpMsg,pcr | |
0 | 90 ldy #80 |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
91 lda #2 stderr |
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
92 os9 I$WritLn write help |
832 | 93 ENDC |
831
27f21cba6b30
Optimzed, now del deletes all files regardless of where -x is on command line
boisy
parents:
200
diff
changeset
|
94 bra ExitOk |
0 | 95 |
96 emod | |
97 eom equ * | |
98 end | |
99 |