Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/rename.asm @ 1020:c1a5613ffe7b
changes
author | boisy |
---|---|
date | Thu, 06 Mar 2003 01:41:03 +0000 |
parents | c155aac72190 |
children | 4e235f213651 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Rename - Rename a file | |
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:
185
diff
changeset
|
8 * 6 From Tandy OS-9 Level One VR 02.00.00 |
0 | 9 |
10 nam Rename | |
11 ttl Rename a file | |
12 | |
13 * Disassembled 98/09/11 01:35:46 by Disasm v1.6 (C) 1988 by RML | |
14 | |
15 ifp1 | |
16 use defsfile | |
17 endc | |
18 | |
19 tylg set Prgrm+Objct | |
20 atrv set ReEnt+rev | |
21 rev set $01 | |
22 edition set 6 | |
23 | |
24 mod eom,name,tylg,atrv,start,size | |
25 | |
924 | 26 org 0 |
0 | 27 u0000 rmb 1 |
28 u0001 rmb 1 | |
29 u0002 rmb 2 | |
30 u0004 rmb 1 | |
31 u0005 rmb 2 | |
32 u0007 rmb 1 | |
33 u0008 rmb 24 | |
34 u0020 rmb 26 | |
35 u003A rmb 2 | |
36 u003C rmb 405 | |
37 size equ . | |
38 | |
39 name fcs /Rename/ | |
40 fcb edition | |
41 | |
42 start cmpd #$0004 | |
43 lbcs L00A8 | |
44 stx <u0000 | |
45 lda #WRITE. | |
46 os9 I$Open | |
47 bcc L0032 | |
48 cmpb #E$FNA | |
49 bne L00A5 | |
50 ldx <u0000 | |
51 lda #DIR.+WRITE. | |
52 os9 I$Open | |
53 bcs L00A5 | |
54 L0032 stx <u0005 | |
185 | 55 ldb #SS.Opt |
0 | 56 leax <u0020,u |
57 os9 I$GetStt | |
58 bcs L00A5 | |
59 os9 I$Close | |
60 bcs L00A5 | |
61 ldb <u0020 | |
62 cmpb #$01 | |
63 bne L00A8 | |
64 bsr L00AE | |
65 bcs L00A5 | |
66 ldx <u0002 | |
67 lda #C$CR | |
68 sta -1,x | |
69 ldx <u0000 | |
185 | 70 lda #READ.+WRITE. |
0 | 71 os9 I$ChgDir |
72 bcs L00A5 | |
73 ldx <u0005 | |
74 ldb <u0008 | |
75 decb | |
76 lda b,x | |
77 ora #$80 | |
78 sta b,x | |
79 incb | |
80 cmpb <u0004 | |
81 bne L0075 | |
82 leay ,x | |
83 ldx <u0002 | |
84 os9 F$CmpNam | |
85 bcc L0082 | |
86 L0075 ldx <u0005 | |
87 lda #READ. | |
88 os9 I$Open | |
89 bcc L00A8 | |
90 cmpb #E$PNNF | |
91 bne L00A8 | |
92 L0082 leax <L00AC,pcr | |
93 lda #DIR.!UPDAT. | |
94 os9 I$Open | |
95 bcs L00A5 | |
96 ldx <u003A | |
97 ldu <u003C | |
98 os9 I$Seek | |
99 bcs L00A5 | |
100 ldx <u0005 | |
101 ldy <u0007 | |
102 os9 I$Write | |
103 bcs L00A5 | |
104 os9 I$Close | |
105 bcs L00A5 | |
106 clrb | |
107 L00A5 os9 F$Exit | |
108 L00A8 ldb #E$BPNam | |
109 bra L00A5 | |
185 | 110 L00AC fcc "." |
111 fcb C$CR | |
0 | 112 L00AE ldx <u0000 |
113 bsr L00F6 | |
114 ldu <u0000 | |
115 lda ,u | |
116 cmpa #PDELIM | |
117 beq L00C7 | |
118 lda ,y | |
119 cmpa #PDELIM | |
120 beq L00C7 | |
121 leau <L00AC,pcr | |
122 stu <u0000 | |
123 bra L00CD | |
124 L00C7 leax ,y | |
125 bsr L00F6 | |
126 bcs L00F2 | |
127 L00CD stx <u0002 | |
128 stb <u0004 | |
129 leax ,y | |
130 bsr L00F6 | |
131 bcc L00CD | |
132 ldb <u0004 | |
133 beq L00F2 | |
134 ldx <u0005 | |
135 os9 F$PrsNam | |
136 bcs L00F2 | |
137 lda ,y | |
138 cmpa #PDELIM | |
139 beq L00F2 | |
140 cmpb #$1E | |
141 bcc L00F2 | |
142 stx <u0005 | |
143 clra | |
144 std <u0007 | |
145 rts | |
146 L00F2 comb | |
147 ldb #E$BPNam | |
148 rts | |
149 L00F6 os9 F$PrsNam | |
150 bcc L0119 | |
151 clrb | |
152 leau ,x | |
153 L00FE lda ,u+ | |
154 bpl L0107 | |
155 incb | |
156 cmpa #$AE | |
157 bne L010C | |
158 L0107 incb | |
159 cmpa #C$PERD | |
160 beq L00FE | |
161 L010C decb | |
162 beq L0118 | |
163 leay -u0001,u | |
164 cmpb #$03 | |
165 bcc L0118 | |
166 clrb | |
167 bra L0119 | |
168 L0118 coma | |
169 L0119 rts | |
170 | |
171 emod | |
172 eom equ * | |
173 end | |
174 |