annotate level1/cmds/rename.asm @ 1213:4e235f213651

Lots of changes: bootscripts and bootlists added, sources massaged...
author boisy
date Sat, 28 Jun 2003 18:41:05 +0000
parents c155aac72190
children 84ea83668304
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
1 ********************************************************************
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
2 * Rename - Rename a file
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
3 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
4 * $Id$
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
5 *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
6 * Ed. Comments Who YY/MM/DD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
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
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
9
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
10 nam Rename
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
11 ttl Rename a file
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
12
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
13 * Disassembled 98/09/11 01:35:46 by Disasm v1.6 (C) 1988 by RML
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
14
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
15 ifp1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
16 use defsfile
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
17 endc
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
18
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
19 tylg set Prgrm+Objct
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
20 atrv set ReEnt+rev
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
21 rev set $01
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
22 edition set 6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
23
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
24 mod eom,name,tylg,atrv,start,size
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
25
924
c155aac72190 Made cosmetic changes
boisy
parents: 200
diff changeset
26 org 0
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
27 parmptr rmb 1
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
28 u0001 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
29 u0002 rmb 2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
30 u0004 rmb 1
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
31 nextparm rmb 2
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
32 u0007 rmb 1
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
33 u0008 rmb 24
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
34 pathopts rmb 26
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
35 u003A rmb 2
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
36 u003C rmb 2
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
37 rmb 2
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
38 rmb 401
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
39 size equ .
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
40
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
41 name fcs /Rename/
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
42 fcb edition
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
43
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
44 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
45 lbcs bpnam branch if less than
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
46 stx <parmptr save parameter pointer
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
47 lda #WRITE. write mode
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
48 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
49 bcc L0032 branch if ok
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
50 cmpb #E$FNA file not accessible?
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
51 bne Exit branch if any other error
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
52 ldx <parmptr else get pointer to file
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
53 lda #DIR.+WRITE. and try open as directory
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
54 os9 I$Open try opening again
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
55 bcs Exit branch if error
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
56 L0032 stx <nextparm save off updated param pointer
185
3a84dad1f851 made further changes
boisy
parents: 0
diff changeset
57 ldb #SS.Opt
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
58 leax <pathopts,u
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
59 os9 I$GetStt get path options
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
60 bcs Exit branch if error
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
61 os9 I$Close close path to file
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 ldb <pathopts
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
64 cmpb #$01
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
65 bne bpnam
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
66 bsr L00AE
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
67 bcs Exit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
68 ldx <u0002
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
69 lda #C$CR
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
70 sta -1,x
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
71 ldx <parmptr
185
3a84dad1f851 made further changes
boisy
parents: 0
diff changeset
72 lda #READ.+WRITE.
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
73 os9 I$ChgDir
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
74 bcs Exit
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
75 ldx <nextparm
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
76 ldb <u0008
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
77 decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
78 lda b,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
79 ora #$80
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
80 sta b,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
81 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
82 cmpb <u0004
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
83 bne L0075
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
84 leay ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
85 ldx <u0002
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
86 os9 F$CmpNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
87 bcc L0082
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
88 L0075 ldx <nextparm
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
89 lda #READ.
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
90 os9 I$Open
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
91 bcc bpnam
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
92 cmpb #E$PNNF
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
93 bne bpnam
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
94 L0082 leax <Dot,pcr point to .
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
95 lda #DIR.!UPDAT. open as directory in update mode
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
96 os9 I$Open do it!
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
97 bcs Exit branch if error
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
98 ldx <u003A get file directory entry ptr (PD.DCP)
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
99 ldu <u003C
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
100 os9 I$Seek seek
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
101 bcs Exit branch if error
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
102 ldx <nextparm get ptr to name to rename
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
103 ldy <u0007
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
104 os9 I$Write
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
105 bcs Exit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
106 os9 I$Close
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
107 bcs Exit
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
108 clrb
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
109 Exit os9 F$Exit
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
110 bpnam ldb #E$BPNam
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
111 bra Exit
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
112
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
113 Dot fcc "."
185
3a84dad1f851 made further changes
boisy
parents: 0
diff changeset
114 fcb C$CR
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
115
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
116 L00AE ldx <parmptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
117 bsr L00F6
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
118 ldu <parmptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
119 lda ,u
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
120 cmpa #PDELIM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
121 beq L00C7
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
122 lda ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
123 cmpa #PDELIM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
124 beq L00C7
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
125 leau <Dot,pcr
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
126 stu <parmptr
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
127 bra L00CD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
128 L00C7 leax ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
129 bsr L00F6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
130 bcs L00F2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
131 L00CD stx <u0002
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
132 stb <u0004
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
133 leax ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
134 bsr L00F6
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
135 bcc L00CD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
136 ldb <u0004
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
137 beq L00F2
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
138 ldx <nextparm
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
139 os9 F$PrsNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
140 bcs L00F2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
141 lda ,y
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
142 cmpa #PDELIM
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
143 beq L00F2
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
144 cmpb #$1E
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
145 bcc L00F2
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
146 stx <nextparm
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
147 clra
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
148 std <u0007
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
149 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
150 L00F2 comb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
151 ldb #E$BPNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
152 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
153 L00F6 os9 F$PrsNam
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
154 bcc L0119
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
155 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
156 leau ,x
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
157 L00FE lda ,u+
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
158 bpl L0107
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
159 incb
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
160 cmpa #C$PERD!$80
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
161 bne L010C
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
162 L0107 incb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
163 cmpa #C$PERD
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
164 beq L00FE
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
165 L010C decb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
166 beq L0118
1213
4e235f213651 Lots of changes: bootscripts and bootlists added, sources massaged...
boisy
parents: 924
diff changeset
167 leay -1,u
0
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
168 cmpb #$03
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
169 bcc L0118
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
170 clrb
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
171 bra L0119
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
172 L0118 coma
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
173 L0119 rts
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
174
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
175 emod
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
176 eom equ *
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
177 end
6641a883d6b0 Initial revision
boisy
parents:
diff changeset
178