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