Mercurial > hg > Members > kono > nitros9-code
annotate level1/cmds/free.asm @ 860:35aca42e87ce
Added better comments
author | boisy |
---|---|
date | Thu, 16 Jan 2003 03:06:50 +0000 |
parents | e9ce43cc215e |
children | 35aaf7ec1c07 |
rev | line source |
---|---|
0 | 1 ******************************************************************** |
2 * Free - Print disk free space | |
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:
0
diff
changeset
|
8 * 6 From Tandy OS-9 Level One VR 02.00.00 |
e9ce43cc215e
Made major changes to headers for consistency and identification
boisy
parents:
0
diff
changeset
|
9 * 7 Y2K fixed |
0 | 10 |
11 nam Free | |
12 ttl Print disk free space | |
13 | |
14 * Disassembled 98/09/11 16:58:25 by Disasm v1.6 (C) 1988 by RML | |
15 | |
16 ifp1 | |
17 use defsfile | |
18 endc | |
19 | |
20 tylg set Prgrm+Objct | |
21 atrv set ReEnt+rev | |
22 rev set $00 | |
23 edition set 7 | |
24 | |
25 mod eom,name,tylg,atrv,start,size | |
26 | |
27 u0000 rmb 1 | |
28 u0001 rmb 1 | |
29 u0002 rmb 1 | |
30 u0003 rmb 1 | |
31 u0004 rmb 1 | |
32 u0005 rmb 2 | |
33 u0007 rmb 1 | |
34 u0008 rmb 1 | |
35 u0009 rmb 1 | |
36 u000A rmb 1 | |
37 u000B rmb 1 | |
38 u000C rmb 1 | |
39 u000D rmb 26 | |
40 u0027 rmb 54 | |
41 u005D rmb 4 | |
42 u0061 rmb 2 | |
43 u0063 rmb 1 | |
44 u0064 rmb 19 | |
45 u0077 rmb 5 | |
46 u007C rmb 26 | |
47 u0096 rmb 6 | |
48 u009C rmb 2 | |
49 u009E rmb 2 | |
50 u00A0 rmb 4544 | |
51 size equ . | |
52 | |
53 name fcs /Free/ | |
54 fcb edition | |
55 L0012 fcb C$LF | |
56 fcc "Use: free [/diskname]" | |
57 fcb C$LF | |
58 fcc " tells how many disk sectors are unused" | |
59 fcb C$CR | |
60 L0052 fcs /" created on:/ | |
61 L005F fcs "Capacity:" | |
62 L0068 fcs " sectors (" | |
63 L0072 fcs "-sector clusters)" | |
64 L0083 fcs " free sectors, largest block" | |
65 L009F fcs " sectors" | |
66 | |
67 start leay u000D,u | |
68 sty <u0001 | |
69 cmpd #$0000 | |
70 beq L00E0 | |
71 lda ,x+ | |
72 cmpa #C$CR | |
73 beq L00E0 | |
74 cmpa #PDELIM | |
75 beq L00CC | |
76 L00BC leax >L0012,pcr | |
77 ldy #$0040 | |
78 lda #$02 | |
79 os9 I$WritLn | |
80 lbra L01CC | |
81 L00CC leax -$01,x | |
82 pshs x | |
83 os9 F$PrsNam | |
84 puls x | |
85 bcs L00BC | |
86 L00D7 lda ,x+ | |
87 lbsr L0218 | |
88 subb #$01 | |
89 bcc L00D7 | |
90 L00E0 lda #$40 | |
91 lbsr L0218 | |
92 lbsr L0216 | |
93 leax u000D,u | |
94 stx <u0001 | |
95 lda #READ. | |
96 os9 I$Open | |
97 sta <u0003 | |
98 bcs L00FF | |
99 leax <u005D,u | |
100 ldy #$003F | |
101 os9 I$Read | |
102 L00FF lbcs L01CD | |
103 lbsr L0222 | |
104 lda #$22 | |
105 lbsr L0218 | |
106 leay <u007C,u | |
107 lbsr L020C | |
108 dec <u0002 | |
109 leay >L0052,pcr | |
110 lbsr L020C | |
111 lbsr L0293 | |
112 lbsr L0222 | |
113 leay >L005F,pcr | |
114 lbsr L020C | |
115 leax <u005D,u | |
116 lbsr L024F | |
117 leay >L0068,pcr | |
118 lbsr L020C | |
119 dec <u0002 | |
120 ldd <u0063 | |
121 pshs b,a | |
122 clr ,-s | |
123 leax ,s | |
124 lbsr L024F | |
125 leas $03,s | |
126 leay >L0072,pcr | |
127 lbsr L020C | |
128 lbsr L0222 | |
129 clra | |
130 clrb | |
131 sta <u0004 | |
132 std <u0005 | |
133 sta <u000A | |
134 std <u000B | |
135 sta <u0007 | |
136 std <u0008 | |
137 lda <u0003 | |
138 ldx #$0000 | |
139 pshs u | |
140 ldu #$0100 | |
141 os9 I$Seek | |
142 puls u | |
143 L016A leax >u009E,u | |
144 ldd #$1000 | |
145 cmpd <u0061 | |
146 bls L0178 | |
147 ldd <u0061 | |
148 L0178 leay d,x | |
149 sty <u009C | |
150 tfr d,y | |
151 lda <u0003 | |
152 os9 I$Read | |
153 bcs L01CD | |
154 L0186 lda ,x+ | |
155 bsr L01D0 | |
156 stb ,-s | |
157 beq L019C | |
158 L018E ldd <u0005 | |
159 addd <u0063 | |
160 std <u0005 | |
161 bcc L0198 | |
162 inc <u0004 | |
163 L0198 dec ,s | |
164 bne L018E | |
165 L019C leas $01,s | |
166 cmpx <u009C | |
167 bcs L0186 | |
168 ldd <u0061 | |
169 subd #$1000 | |
170 std <u0061 | |
171 bhi L016A | |
172 bsr L01ED | |
173 leax u0004,u | |
174 lbsr L024F | |
175 leay >L0083,pcr | |
176 bsr L020C | |
177 leax u0007,u | |
178 lbsr L024F | |
179 leay >L009F,pcr | |
180 bsr L020C | |
181 bsr L0222 | |
182 lda <u0003 | |
183 os9 I$Close | |
184 bcs L01CD | |
185 L01CC clrb | |
186 L01CD os9 F$Exit | |
187 L01D0 clrb | |
188 cmpa #$FF | |
189 beq L01ED | |
190 bsr L01D7 | |
191 L01D7 bsr L01D9 | |
192 L01D9 bsr L01DB | |
193 L01DB lsla | |
194 bcs L01ED | |
195 incb | |
196 pshs b,a | |
197 ldd <u000B | |
198 addd <u0063 | |
199 std <u000B | |
200 bcc L01EB | |
201 inc <u000A | |
202 L01EB puls pc,b,a | |
203 L01ED pshs b,a | |
204 ldd <u000A | |
205 cmpd <u0007 | |
206 bhi L01FE | |
207 bne L0204 | |
208 ldb <u000C | |
209 cmpb <u0009 | |
210 bls L0204 | |
211 L01FE sta <u0007 | |
212 ldd <u000B | |
213 std <u0008 | |
214 L0204 clr <u000A | |
215 clr <u000B | |
216 clr <u000C | |
217 puls pc,b,a | |
218 L020C lda ,y | |
219 anda #$7F | |
220 bsr L0218 | |
221 lda ,y+ | |
222 bpl L020C | |
223 L0216 lda #$20 | |
224 L0218 pshs x | |
225 ldx <u0001 | |
226 sta ,x+ | |
227 stx <u0001 | |
228 puls pc,x | |
229 L0222 pshs y,x,a | |
230 lda #$0D | |
231 bsr L0218 | |
232 leax u000D,u | |
233 stx <u0001 | |
234 ldy #$0050 | |
235 lda #$01 | |
236 os9 I$WritLn | |
237 puls pc,y,x,a | |
238 L0237 fcb $98 | |
239 fdb $9680,$0f42,$4001,$86a0,$0027,$1000,$03e8,$0000 | |
240 fdb $6400,$000a,$0000 | |
241 fcb $01 | |
242 L024F lda #$0A | |
243 pshs y,x,b,a | |
244 leay <L0237,pcr | |
245 clr <u0000 | |
246 ldb ,x | |
247 ldx $01,x | |
248 L025C lda #$FF | |
249 L025E inca | |
250 exg d,x | |
251 subd $01,y | |
252 exg d,x | |
253 sbcb ,y | |
254 bcc L025E | |
255 bsr L02B9 | |
256 exg d,x | |
257 addd $01,y | |
258 exg d,x | |
259 adcb ,y | |
260 leay $03,y | |
261 dec ,s | |
262 beq L0291 | |
263 lda ,s | |
264 cmpa #$01 | |
265 bne L0281 | |
266 sta <u0000 | |
267 L0281 bita #$03 | |
268 bne L025C | |
269 dec ,s | |
270 tst <u0000 | |
271 beq L025C | |
272 lda #$2C | |
273 bsr L0218 | |
274 bra L025C | |
275 L0291 puls pc,y,x,b,a | |
276 L0293 leax <u0077,u | |
277 bsr L02C3 | |
278 bsr L029A | |
279 L029A lda #$2F | |
280 lbsr L0218 | |
281 clr <u0000 | |
282 ldb ,x+ | |
283 lda #$FF | |
284 L02A5 inca | |
285 subb #$64 | |
286 bcc L02A5 | |
287 bsr L02B9 | |
288 L02AC lda #$0A | |
289 sta <u0000 | |
290 L02B0 deca | |
291 addb #$0A | |
292 bcc L02B0 | |
293 bsr L02B9 | |
294 tfr b,a | |
295 L02B9 tsta | |
296 beq L02BE | |
297 sta <u0000 | |
298 L02BE tst <u0000 | |
299 bne L02D6 | |
300 rts | |
301 L02C3 ldb ,x+ | |
302 lda #$AE | |
303 L02C7 inca | |
304 subb #$64 | |
305 bcc L02C7 | |
306 pshs b | |
307 tfr a,b | |
308 bsr L02AC | |
309 puls b | |
310 bra L02AC | |
311 L02D6 adda #$30 | |
312 lbra L0218 | |
313 | |
314 emod | |
315 eom equ * | |
316 end |