Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/rename.asm @ 200:e9ce43cc215e
Made major changes to headers for consistency and identification
author | boisy |
---|---|
date | Mon, 15 Jul 2002 03:42:42 +0000 |
parents | 3a84dad1f851 |
children | c155aac72190 |
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 | |
26 u0000 rmb 1 | |
27 u0001 rmb 1 | |
28 u0002 rmb 2 | |
29 u0004 rmb 1 | |
30 u0005 rmb 2 | |
31 u0007 rmb 1 | |
32 u0008 rmb 24 | |
33 u0020 rmb 26 | |
34 u003A rmb 2 | |
35 u003C rmb 405 | |
36 size equ . | |
37 | |
38 name fcs /Rename/ | |
39 fcb edition | |
40 | |
41 start cmpd #$0004 | |
42 lbcs L00A8 | |
43 stx <u0000 | |
44 lda #WRITE. | |
45 os9 I$Open | |
46 bcc L0032 | |
47 cmpb #E$FNA | |
48 bne L00A5 | |
49 ldx <u0000 | |
50 lda #DIR.+WRITE. | |
51 os9 I$Open | |
52 bcs L00A5 | |
53 L0032 stx <u0005 | |
185 | 54 ldb #SS.Opt |
0 | 55 leax <u0020,u |
56 os9 I$GetStt | |
57 bcs L00A5 | |
58 os9 I$Close | |
59 bcs L00A5 | |
60 ldb <u0020 | |
61 cmpb #$01 | |
62 bne L00A8 | |
63 bsr L00AE | |
64 bcs L00A5 | |
65 ldx <u0002 | |
66 lda #C$CR | |
67 sta -1,x | |
68 ldx <u0000 | |
185 | 69 lda #READ.+WRITE. |
0 | 70 os9 I$ChgDir |
71 bcs L00A5 | |
72 ldx <u0005 | |
73 ldb <u0008 | |
74 decb | |
75 lda b,x | |
76 ora #$80 | |
77 sta b,x | |
78 incb | |
79 cmpb <u0004 | |
80 bne L0075 | |
81 leay ,x | |
82 ldx <u0002 | |
83 os9 F$CmpNam | |
84 bcc L0082 | |
85 L0075 ldx <u0005 | |
86 lda #READ. | |
87 os9 I$Open | |
88 bcc L00A8 | |
89 cmpb #E$PNNF | |
90 bne L00A8 | |
91 L0082 leax <L00AC,pcr | |
92 lda #DIR.!UPDAT. | |
93 os9 I$Open | |
94 bcs L00A5 | |
95 ldx <u003A | |
96 ldu <u003C | |
97 os9 I$Seek | |
98 bcs L00A5 | |
99 ldx <u0005 | |
100 ldy <u0007 | |
101 os9 I$Write | |
102 bcs L00A5 | |
103 os9 I$Close | |
104 bcs L00A5 | |
105 clrb | |
106 L00A5 os9 F$Exit | |
107 L00A8 ldb #E$BPNam | |
108 bra L00A5 | |
185 | 109 L00AC fcc "." |
110 fcb C$CR | |
0 | 111 L00AE ldx <u0000 |
112 bsr L00F6 | |
113 ldu <u0000 | |
114 lda ,u | |
115 cmpa #PDELIM | |
116 beq L00C7 | |
117 lda ,y | |
118 cmpa #PDELIM | |
119 beq L00C7 | |
120 leau <L00AC,pcr | |
121 stu <u0000 | |
122 bra L00CD | |
123 L00C7 leax ,y | |
124 bsr L00F6 | |
125 bcs L00F2 | |
126 L00CD stx <u0002 | |
127 stb <u0004 | |
128 leax ,y | |
129 bsr L00F6 | |
130 bcc L00CD | |
131 ldb <u0004 | |
132 beq L00F2 | |
133 ldx <u0005 | |
134 os9 F$PrsNam | |
135 bcs L00F2 | |
136 lda ,y | |
137 cmpa #PDELIM | |
138 beq L00F2 | |
139 cmpb #$1E | |
140 bcc L00F2 | |
141 stx <u0005 | |
142 clra | |
143 std <u0007 | |
144 rts | |
145 L00F2 comb | |
146 ldb #E$BPNam | |
147 rts | |
148 L00F6 os9 F$PrsNam | |
149 bcc L0119 | |
150 clrb | |
151 leau ,x | |
152 L00FE lda ,u+ | |
153 bpl L0107 | |
154 incb | |
155 cmpa #$AE | |
156 bne L010C | |
157 L0107 incb | |
158 cmpa #C$PERD | |
159 beq L00FE | |
160 L010C decb | |
161 beq L0118 | |
162 leay -u0001,u | |
163 cmpb #$03 | |
164 bcc L0118 | |
165 clrb | |
166 bra L0119 | |
167 L0118 coma | |
168 L0119 rts | |
169 | |
170 emod | |
171 eom equ * | |
172 end | |
173 |