Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/rename.asm @ 2848:94197db917c9 lwtools-port
Makefiles: Call OS9ATTR with multiple files (part 1)
Instead of spawning a os9 process for each file, call
it once with the whole bunch of files.
This can speed up the build process significantly when applied
globally. For now, do the special cases having "notdir".
author | Tormod Volden <debian.tormod@gmail.com> |
---|---|
date | Fri, 12 Jul 2013 00:01:00 +0200 |
parents | 84ea83668304 |
children |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Rename - Rename a file | |
3 * | |
4 * $Id$ | |
5 * | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
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:
1213
diff
changeset
|
7 * Comment |
0 | 8 * ------------------------------------------------------------------ |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
9 * 6 ????/??/?? |
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
10 * From Tandy OS-9 Level One VR 02.00.00. |
0 | 11 |
12 nam Rename | |
13 ttl Rename a file | |
14 | |
15 * Disassembled 98/09/11 01:35:46 by Disasm v1.6 (C) 1988 by RML | |
16 | |
17 ifp1 | |
18 use defsfile | |
19 endc | |
20 | |
21 tylg set Prgrm+Objct | |
22 atrv set ReEnt+rev | |
1325
84ea83668304
Redid comments, reset all rev nibbles that weren't explictly set to 0
boisy
parents:
1213
diff
changeset
|
23 rev set $00 |
0 | 24 edition set 6 |
25 | |
26 mod eom,name,tylg,atrv,start,size | |
27 | |
924 | 28 org 0 |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
29 parmptr rmb 1 |
0 | 30 u0001 rmb 1 |
31 u0002 rmb 2 | |
32 u0004 rmb 1 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
33 nextparm rmb 2 |
0 | 34 u0007 rmb 1 |
35 u0008 rmb 24 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
36 pathopts rmb 26 |
0 | 37 u003A rmb 2 |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
38 u003C rmb 2 |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
39 rmb 2 |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
40 rmb 401 |
0 | 41 size equ . |
42 | |
43 name fcs /Rename/ | |
44 fcb edition | |
45 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
46 start cmpd #$0004 at least 3 chars + CR on cmd line? |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
47 lbcs bpnam branch if less than |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
48 stx <parmptr save parameter pointer |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
49 lda #WRITE. write mode |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
50 os9 I$Open open file to rename in write mode |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
51 bcc L0032 branch if ok |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
52 cmpb #E$FNA file not accessible? |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
53 bne Exit branch if any other error |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
54 ldx <parmptr else get pointer to file |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
55 lda #DIR.+WRITE. and try open as directory |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
56 os9 I$Open try opening again |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
57 bcs Exit branch if error |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
58 L0032 stx <nextparm save off updated param pointer |
185 | 59 ldb #SS.Opt |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
60 leax <pathopts,u |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
61 os9 I$GetStt get path options |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
62 bcs Exit branch if error |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
63 os9 I$Close close path to file |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
64 bcs Exit branch if error |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
65 ldb <pathopts |
0 | 66 cmpb #$01 |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
67 bne bpnam |
0 | 68 bsr L00AE |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
69 bcs Exit |
0 | 70 ldx <u0002 |
71 lda #C$CR | |
72 sta -1,x | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
73 ldx <parmptr |
185 | 74 lda #READ.+WRITE. |
0 | 75 os9 I$ChgDir |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
76 bcs Exit |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
77 ldx <nextparm |
0 | 78 ldb <u0008 |
79 decb | |
80 lda b,x | |
81 ora #$80 | |
82 sta b,x | |
83 incb | |
84 cmpb <u0004 | |
85 bne L0075 | |
86 leay ,x | |
87 ldx <u0002 | |
88 os9 F$CmpNam | |
89 bcc L0082 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
90 L0075 ldx <nextparm |
0 | 91 lda #READ. |
92 os9 I$Open | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
93 bcc bpnam |
0 | 94 cmpb #E$PNNF |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
95 bne bpnam |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
96 L0082 leax <Dot,pcr point to . |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
97 lda #DIR.!UPDAT. open as directory in update mode |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
98 os9 I$Open do it! |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
99 bcs Exit branch if error |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
100 ldx <u003A get file directory entry ptr (PD.DCP) |
0 | 101 ldu <u003C |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
102 os9 I$Seek seek |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
103 bcs Exit branch if error |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
104 ldx <nextparm get ptr to name to rename |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
105 ldy <u0007 |
0 | 106 os9 I$Write |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
107 bcs Exit |
0 | 108 os9 I$Close |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
109 bcs Exit |
0 | 110 clrb |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
111 Exit os9 F$Exit |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
112 bpnam ldb #E$BPNam |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
113 bra Exit |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
114 |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
115 Dot fcc "." |
185 | 116 fcb C$CR |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
117 |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
118 L00AE ldx <parmptr |
0 | 119 bsr L00F6 |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
120 ldu <parmptr |
0 | 121 lda ,u |
122 cmpa #PDELIM | |
123 beq L00C7 | |
124 lda ,y | |
125 cmpa #PDELIM | |
126 beq L00C7 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
127 leau <Dot,pcr |
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
128 stu <parmptr |
0 | 129 bra L00CD |
130 L00C7 leax ,y | |
131 bsr L00F6 | |
132 bcs L00F2 | |
133 L00CD stx <u0002 | |
134 stb <u0004 | |
135 leax ,y | |
136 bsr L00F6 | |
137 bcc L00CD | |
138 ldb <u0004 | |
139 beq L00F2 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
140 ldx <nextparm |
0 | 141 os9 F$PrsNam |
142 bcs L00F2 | |
143 lda ,y | |
144 cmpa #PDELIM | |
145 beq L00F2 | |
146 cmpb #$1E | |
147 bcc L00F2 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
148 stx <nextparm |
0 | 149 clra |
150 std <u0007 | |
151 rts | |
152 L00F2 comb | |
153 ldb #E$BPNam | |
154 rts | |
155 L00F6 os9 F$PrsNam | |
156 bcc L0119 | |
157 clrb | |
158 leau ,x | |
159 L00FE lda ,u+ | |
160 bpl L0107 | |
161 incb | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
162 cmpa #C$PERD!$80 |
0 | 163 bne L010C |
164 L0107 incb | |
165 cmpa #C$PERD | |
166 beq L00FE | |
167 L010C decb | |
168 beq L0118 | |
1213
4e235f213651
Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents:
924
diff
changeset
|
169 leay -1,u |
0 | 170 cmpb #$03 |
171 bcc L0118 | |
172 clrb | |
173 bra L0119 | |
174 L0118 coma | |
175 L0119 rts | |
176 | |
177 emod | |
178 eom equ * | |
179 end | |
180 |