Disk info

Zdrojový kód

3      5b00            *s
4      5b00            ;==============================================================;
5      5b00            ;== Verzia ** == Disk info MB-02 == 11.03.1994 == Busy soft ===;
6      5b00            ;==============================================================;
7      5b00            verzia =    16
8      5b00                   org  #8000
9      8000 cd9e3c     p      call ram		Switch into DOS-ram
10     8003 af                xor  a
11     8004 e7                rst  #20
12     8005 21c700            ld   hl,199	Test BS-DOS version number
13     8008 ed42              sbc  hl,bc
14     800a 2008              jr   nz,nezle
15     800c 22561b            ld   (#1b56),hl	Repair a little bug
16     800f 3e40              ld   a,#40	in BS-DOS 199
17     8011 324917            ld   (#1749),a
18     8014 3aee03     nezle  ld   a,(disk)	Save actual disk
19     8017 323b83            ld   (olddrv+1),a
20     801a             
21     801a 3a8d5c     loop   ld   a,(23693)	Set colours
22     801d e678              and  #78		and clear screen
23     801f cb6f              bit  5,a
24     8021 2002              jr   nz,#02
25     8023 f607              or   #07
26     8025 32e203            ld   (color),a
27     8028 210040            ld   hl,#4000
28     802b 110140            ld   de,#4001
29     802e 010018            ld   bc,#1800
30     8031 edb0              ldir
31     8033 77                ld   (hl),a
32     8034 01ff02            ld   bc,#02ff
33     8037 edb0              ldir
34     8039 0f                rrca
35     803a 0f                rrca
36     803b 0f                rrca
37     803c ee01              xor  #01
38     803e e607              and  #07
39     8040 f608              or   #08
40     8042 d3fe              out  (#fe),a
41     8044 210000            ld   hl,#00
42     8047 22e003            ld   (xxx),hl
43     804a 21e203            ld   hl,color
44     804d cbf6              set  6,(hl)
45     804f cd7b83            call text
46     8052 3e427573          db   '>Busy soft - '
            7920736f    
            6674202d    
            20          
47     805f 4469736b          db   'Disk-info '
            2d696e66    
            6f20        
48     8069 7574696c          db   'utilitka<',0
            69746b61    
            3c00        
49     8073 cbb6              res  6,(hl)
50     8075 3e02              ld   a,enterx
51     8077 e7                rst  #20
52     8078 af                xor  a
53     8079 e7                rst  #20		Get DOS information
54     807a dd222981          ld   (booadd),ix	IX = address of boot sector
55     807e fd22b781          ld   (fatadd),iy	IY = address of FAT
56     8082 fd213a5c          ld   iy,#5c3a
57     8086 c5                push bc
58     8087 cd7b83            call text
59     808a 20566572          db   ' Verzia infa:'
            7a696120    			(versin of this program)
            696e6661    
            3a          
60     8097 3136              db   vv1,vv2
61     8099 20566572          db   ' Verzia dosu:',0
            7a696120    			(BS-DOS version)
            646f7375    
            3a00        
62     80a7 e1                pop  hl
63     80a8 3e06              ld   a,dec16x
64     80aa cd6a83            call tab16d
65     80ad cd7b83            call text
66     80b0 20447269          db   ' Drive ',0
            76652000    
67     80b8 3aee03            ld   a,(disk)
68     80bb 5f                ld   e,a
69     80bc d5                push de
70     80bd cd6483            call dec8
71     80c0 cd7b83            call text
72     80c3 3a2000            db   ': ',0
73     80c6 d1                pop  de
74     80c7 3e0e              ld   a,info
75     80c9 df                rst  #18		Get information about
76     80ca af                xor  a		selected disk drive
77     80cb b2                or   d
78     80cc caa282            jp   z,nie
79     80cf d5                push de
80     80d0 5a                ld   e,d		Number of track
81     80d1 cd6483            call dec8
82     80d4 cd7b83            call text
83     80d7 2073746f          db   ' stop, ',0
            702c2000    
84     80df d1                pop  de
85     80e0 3e44              ld   a,'D'	Supported densities
86     80e2 cb0b              rrc  e
87     80e4 dc4a83            call c,densit
88     80e7 3e48              ld   a,'H'
89     80e9 cb0b              rrc  e
90     80eb dc4a83            call c,densit
91     80ee 3e45              ld   a,'E'
92     80f0 cb0b              rrc  e
93     80f2 dc4a83            call c,densit
94     80f5 21e003            ld   hl,xxx
95     80f8 35                dec  (hl)
96     80f9 3e02              ld   a,enterx
97     80fb e7                rst  #20
98     80fc cd5783            call ciara
99     80ff 3e10              ld   a,kukni	Get information about
100    8101 cd8782            call dos		diskette in selected drive
101    8104 cd7b83            call text
102    8107 4469736b          db   'Disk: ',0
            3a2000      
103    810e 3aee03            ld   a,(disk)	Get formatted density
104    8111 e61f              and  #1f
105    8113 f6c0              or   #c0
106    8115 6f                ld   l,a
107    8116 2603              ld   h,#03
108    8118 7e                ld   a,(hl)
109    8119 87                add  a,a
110    811a 87                add  a,a
111    811b c644              add  a,'D'
112    811d 5f                ld   e,a
113    811e 3e01              ld   a,disp
114    8120 e7                rst  #20
115    8121 cd7b83            call text
116    8124 442000            db   'D ',0
117    8127 dd21              db   #dd,#21      ld ix,...
118    8129 5555       booadd dw   #5555	IX = addres of boot sector
119    812b dd5e04            ld   e,(ix+#04)	Get number of tracks
120    812e cd6483            call dec8
121    8131 1e78              ld   e,'x'
122    8133 3e01              ld   a,disp
123    8135 e7                rst  #20
124    8136 dd5e06            ld   e,(ix+#06)	Get number of sector per track
125    8139 cd6483            call dec8
126    813c dd7c              ld   a,xh
127    813e 67                ld   h,a
128    813f 2e26              ld   l,#26
129    8141 cd8183            call mendd
130    8144 cd7b83            call text
131    8147 416b7475          db   'Aktualny adresar'
            616c6e79    			(Actual directory)
            20616472    
            65736172    
132    8157 3a00              db   ':',0
133    8159 3e12              ld   a,getcst	Get path
134    815b cd8782            call dos
135    815e 5a                ld   e,d		number of actual directory
136    815f cd6483            call dec8
137    8162 3e16              ld   a,getsub	Get sub entry
138    8164 010000            ld   bc,#00	Entry 0 contains
139    8167 dd210084          ld   ix,sub	name of directory
140    816b cd8782            call dos
141    816e ccda81            call z,clssub	If directory not exists,
142    8171 210684            ld   hl,sub+#06	clear name
143    8174 cd8183            call mendd	Print name of directory
144    8177 cd7b83            call text
145    817a 4b617061          db   'Kapacita       '
            63697461    			(capacity of disk)
            20202020
            202020      
146    8189 73656b74          db   'sektory    '
            6f727920    			(sectors)
            202020      
147    8194 62616a74          db   'bajty  ',0
            79202000    			(bytes)
148    819c 210004            ld   hl,#0400     Computing parameters:
149    819f 225982            ld   (uzite1),hl
150    81a2 210100            ld   hl,#01
151    81a5 222382            ld   (celkom),hl	total sectors
152    81a8 224b82            ld   (obsad),hl	used sectors
153    81ab 6c                ld   l,h
154    81ac 223c82            ld   (chybne),hl	error sectors
155    81af 222f82            ld   (volne),hl	free sectors
156    81b2 225c82            ld   (uzite2),hl
157    81b5 dd21              db   #dd,#21             ld ix,...
158    81b7 5555       fatadd dw   #5555	IX = address of FAT
159    81b9 dd23       fatloo inc  ix
160    81bb dd23              inc  ix
161    81bd dd6e00            ld   l,(ix+#00)	Get FAT entry
162    81c0 dd6601            ld   h,(ix+#01)
163    81c3 7c                ld   a,h
164    81c4 a5                and  l
165    81c5 3c                inc  a		End of FAT ?
166    81c6 284f              jr   z,fatfin
167    81c8 cb7c              bit  7,h
168    81ca 282c              jr   z,free	Free sector ?
169    81cc 7c                ld   a,h
170    81cd 3c                inc  a
171    81ce 2815              jr   z,badsys	Error or system sector ?
172    81d0 cb74              bit  6,h
173    81d2 2019              jr   nz,fatsec
174    81d4 3e3f              ld   a,#3f	Used sector
175    81d6 a4                and  h
176    81d7 67                ld   h,a
177    81d8 1816              jr   fatobs
178    81da             
179    81da 210084     clssub ld   hl,sub	Clear sub/dir entry
180    81dd 010020            ld   bc,#2000
181    81e0 71         clsb   ld   (hl),c
182    81e1 23                inc  hl
183    81e2 10fc              djnz clsb
184    81e4 c9                ret
185    81e5             
186    81e5 7d         badsys ld   a,l		Bad or system sector
187    81e6 213c82            ld   hl,chybne
188    81e9 fef0              cp   #f0
189    81eb 300e              jr   nc,fatinc
190    81ed 210004     fatsec ld   hl,#0400
191    81f0 cd0682     fatobs call plus
192    81f3 214b82            ld   hl,obsad
193    81f6 1803              jr   fatinc
194    81f8 212f82     free   ld   hl,volne
195    81fb cd1282     fatinc call inc
196    81fe 212382     fatend ld   hl,celkom
197    8201 cd1282            call inc
198    8204 18b3              jr   fatloo
199    8206             
200    8206 ed5b5982   plus   ld   de,(uzite1)	32 bit addition
201    820a 19                add  hl,de	with 16 bit operand
202    820b 225982            ld   (uzite1),hl
203    820e d0                ret  nc
204    820f 215c82            ld   hl,uzite2
205    8212 34         inc    inc  (hl)
206    8213 c0                ret  nz
207    8214 23                inc  hl
208    8215 34                inc  (hl)
209    8216 c9                ret
210    8217             
211    8217            fatfin
212    8217 cd7b83            call text
213    821a 63656c6b          db   'celkovo',0,#21
            6f766f00    		(total)
            21          
214    8223 5555       celkom dw   #5555
215    8225 cd7883            call cctt
216    8228 766f6c6e          db   'volne',0,#21
            650021      		(free)
217    822f 5555       volne  dw   #5555
218    8231 cd7883            call cctt
219    8234 63687962          db   'chybne',0,#21
            6e650021    		(bad/error)
220    823c 5555       chybne dw   #5555
221    823e cd7883            call cctt
222    8241 6f627361          db   'obsadene',0,#21
            64656e65    		(brutto used)
            0021        
223    824b 5555       obsad  dw   #5555
224    824d cd7883            call cctt
225    8250 7679757a          db   'vyuzite',0
            69746500    		(netto used)
226    8258 21                db   #21
227    8259 5555       uzite1 dw   #5555
228    825b 11                db   #11
229    825c 5555       uzite2 dw   #5555
230    825e cdda83            call numero
231    8261 cd7b83            call text
232    8264 6e657679          db   'nevyuzite',0
            757a6974    		(unusable)
            6500        
233    826e 2a4b82            ld   hl,(obsad)
234    8271 cdc183            call kila
235    8274 ed4b5982          ld   bc,(uzite1)
236    8278 ed42              sbc  hl,bc
237    827a eb                ex   de,hl
238    827b ed4b5c82          ld   bc,(uzite2)
239    827f ed42              sbc  hl,bc
240    8281 eb                ex   de,hl
241    8282 cdda83            call numero
242    8285 1825              jr   infend
243    8287             
244    8287 e7         dos    rst  #20		Calling DOS service
245    8288 d8                ret  c		If OK then ret
246    8289 f1                pop  af
247    828a 1e00       error  ld   e,#00	If any error occured
248    828c 3e03              ld   a,tabx	then error message
249    828e e7                rst  #20		is displayed.
250    828f cd7b83            call text
251    8292 4469736b          db   'Disk error...',0
            20657272    
            6f722e2e    
            2e00        
252    82a0 180a              jr   infend
253    82a2             
254    82a2 cd7b83     nie    call text
255    82a5 6e696520          db   'nie je',0
            6a6500      		(is not)
256    82ac             
257    82ac 3ae103     infend ld   a,(yyy)
258    82af fe15              cp   #15
259    82b1 2805              jr   z,eei1
260    82b3 cdfa83            call space
261    82b6 18f4              jr   infend
262    82b8             
263    82b8 21e203     eei1   ld   hl,color
264    82bb 3e10              ld   a,#10
265    82bd ae                xor  (hl)
266    82be 77                ld   (hl),a
267    82bf cd7b83            call text
268    82c2 4f766c61          db   'Ovladacie '
            64616369   
            6520        
269    82cc 6b6c6176          db   'klavesy:',0
            6573793a    		(control keys)
            00          
270    82d5 3e02              ld   a,enterx
271    82d7 e7                rst  #20
272    82d8 cd7b83            call text
273    82db 53706163          db   'Space: koniec '
            653a206b    		(space: end of program)
            6f6e6965    
            6320        
274    82e9 70726f67          db   'programu',0
            72616d75    
            00          
275    82f2 3e02              ld   a,enterx
276    82f4 e7                rst  #20
277    82f5 cd7b83            call text
278    82f8 4369736c          db   'Cisla: informacie'
            613a2069    		(numbers: info about drive N)
            6e666f72    
            6d616369    
            65          
279    8309 206f2064          db   ' o drivoch',0
            7269766f    
            636800      
280    8314 3e02              ld   a,enterx
281    8316 e7                rst  #20
282    8317 cd983c            call rom		Switch to ROM
283    831a cd8e02     inkey  call #028e	Keyboard test
284    831d cd1e03            call #031e
285    8320 fe20              cp   #20
286    8322 2813              jr   z,koniec
287    8324 fe31              cp   '1'
288    8326 38f2              jr   c,inkey
289    8328 fe3a              cp   '9'+1
290    832a 30ee              jr   nc,inkey
291    832c e60f              and  #0f
292    832e cd9e3c            call ram
293    8331 32ee03            ld   (disk),a
294    8334 c31a80            jp   loop
295    8337             			End of program:
296    8337 cd9e3c     koniec call ram		Switch to DOS ram
297    833a 1e55       olddrv ld   e,#55	Old saved drive
298    833c 3e13              ld   a,setdrv	will be actual
299    833e e7                rst  #20
300    833f fd213a5c          ld   iy,#5c3a	Standard values
301    8343 215827            ld   hl,#2758	of registers
302    8346 d9                exx		before return into basic
303    8347 c3983c            jp   rom		Switch to ROM
304    834a             
305    834a d5         densit push de		Display density
306    834b 5f                ld   e,a		(DD,HD,ED)
307    834c 3e01              ld   a,disp
308    834e e7                rst  #20
309    834f cd7b83            call text
310    8352 442c00            db   'D,',0
311    8355 d1                pop  de
312    8356 c9                ret
313    8357             
314    8357 0620       ciara  ld   b,#20	Horizontal line
315    8359 3e01       oddel  ld   a,disp
316    835b 1e5f              ld   e,'_'
317    835d e7                rst  #20
318    835e 10f9              djnz oddel
319    8360 3e02              ld   a,enterx
320    8362 e7                rst  #20
321    8363 c9                ret	
322    8364             
323    8364 0e00       dec8   ld   c,#00	Display 8-bit number
324    8366 3e05              ld   a,dec8x
325    8368 e7                rst  #20
326    8369 c9                ret
327    836a             
328    836a 0e00       tab16d ld   c,#00	PRINT TAB 16
329    836c e7                rst  #20
330    836d 3ae003     t16d   ld   a,(xxx)
331    8370 e60f              and  #0f
332    8372 c8                ret  z
333    8373 cdfa83            call space
334    8376 18f5              jr   t16d
335    8378             
336    8378 cdc983     cctt   call cislo	Display number
337    837b e3         text   ex   (sp),hl	and text after CALL TEXT
338    837c 3e04              ld   a,txxt
339    837e e7                rst  #20
340    837f e3                ex   (sp),hl
341    8380 c9                ret
342    8381             
343    8381 e5         mendd  push hl		Display name of disk/directory
344    8382 3e02              ld   a,enterx
345    8384 e7                rst  #20
346    8385 cd7b83            call text
347    8388 4d656e6f          db   'Meno:',0
            3a00        		(name)
348    838e e1                pop  hl
349    838f 060a              ld   b,10		10 characters
350    8391 cda083            call meno		basic name
351    8394 cdfa83            call space
352    8397 0610              ld   b,16		16 characters
353    8399 cda083            call meno		extended name
354    839c 3e02              ld   a,enterx
355    839e e7                rst  #20
356    839f c9                ret
357    83a0             
358    83a0 7e         meno   ld   a,(hl)	All characters
359    83a1 fe20              cp   #20		below #20 and above #7F
360    83a3 3002              jr   nc,#02	are filtered
361    83a5 3e1e              ld   a,#1e	<- underline character
362    83a7 fe80              cp   #80
363    83a9 3802              jr   c,#02
364    83ab 3e1f              ld   a,#1f	<- square character
365    83ad 5f                ld   e,a
366    83ae 3e01              ld   a,disp
367    83b0 e7                rst  #20
368    83b1 23                inc  hl
369    83b2 10ec              djnz meno
370    83b4 c9                ret
371    83b5             
372    83b5 3ae003     bodky  ld   a,(xxx)	Display points
373    83b8 ba                cp   d		(underlines)
374    83b9 c8                ret  z
375    83ba 1e1e              ld   e,patri
376    83bc 3e01              ld   a,disp
377    83be e7                rst  #20
378    83bf 18f4              jr   bodky
379    83c1             
380    83c1 29         kila   add  hl,hl	Convert number of sectors
381    83c2 29                add  hl,hl	to number of bytes
382    83c3 1600              ld   d,#00	(multiply by 1024)
383    83c5 5c                ld   e,h
384    83c6 65                ld   h,l
385    83c7 6a                ld   l,d
386    83c8 c9                ret
387    83c9             
388    83c9 e5         cislo  push hl		Display one combined number
389    83ca 1611              ld   d,tabi	with points, 16 bit number
390    83cc cdb583            call bodky	and 32 bit number
391    83cf 0e1e              ld   c,patri
392    83d1 3e06              ld   a,dec16x
393    83d3 e7                rst  #20
394    83d4 e1                pop  hl
395    83d5 cdc183            call kila
396    83d8 1815              jr   num32
397    83da             
398    83da 3e0f       numero ld   a,howsec	Convert 32 bit number of bytes
399    83dc e7                rst  #20		into number of used sectors
400    83dd e5                push hl		by this file
401    83de d5                push de		and display both numbers
402    83df c5                push bc
403    83e0 1611              ld   d,tabi
404    83e2 cdb583            call bodky
405    83e5 c1                pop  bc
406    83e6 60                ld   h,b
407    83e7 69                ld   l,c
408    83e8 0e1e              ld   c,patri
409    83ea 3e06              ld   a,dec16x
410    83ec e7                rst  #20
411    83ed d1                pop  de
412    83ee e1                pop  hl
413    83ef 011e09     num32  ld   bc,#0900+patri
414    83f2 3e07              ld   a,dec32x
415    83f4 e7                rst  #20
416    83f5 1e00              ld   e,#00
417    83f7 3e03              ld   a,tabx
418    83f9 e7                rst  #20
419    83fa 1e20       space  ld   e,' '
420    83fc 3e01              ld   a,disp
421    83fe e7                rst  #20
422    83ff c9                ret
423    8400            k
424    8400            l      =    k-p
425    8400            aa1    =    verzia/10	Computing version number
426    8400            aa2    =    aa1*10
427    8400            aa3    =    verzia-aa2
428    8400            vv1    =    aa1+'0'
429    8400            vv2    =    aa3+'0'
430    8400             
431    8400            sub    ds   #20		Space for sub-entry
432    8420             
433    8420            patri  =    #1e
434    8420            tabi   =    17
435    8420            info   =    #0e          FDC-BIOS service
436    8420             
437    8420            disp   =    #01          BS-DOS services
438    8420            enterx =    #02
439    8420            tabx   =    #03
440    8420            txxt   =    #04
441    8420            dec8x  =    #05
442    8420            dec16x =    #06
443    8420            dec32x =    #07
444    8420            howsec =    #0f
445    8420            kukni  =    #10
446    8420            getcst =    #12
447    8420            setdrv =    #13
448    8420            getsub =    #16
449    8420            kolkox =    #18
450    8420             
451    8420            xxx    =    #03e0	BS-DOS variables
452    8420            yyy    =    #03e1
453    8420            color  =    #03e2
454    8420            disk   =    #03ee
455    8420            rom    =    #3c98	ROM-DIOS services
456    8420            ram    =    #3c9e

 aa1    0001  *  aa2    000a  *  aa3    0006  *  badsys 81e5  *
 bodky  83b5  *  booadd 8129  *  cctt   8378  *  celkom 8223  *
 chybne 823c  *  ciara  8357  *  cislo  83c9  *  clsb   81e0  *
 clssub 81da  *  color  03e2  *  dec16x 0006  *  dec32x 0007  *
 dec8   8364  *  dec8x  0005  *  densit 834a  *  disk   03ee  *
 disp   0001  *  dos    8287  *  eei1   82b8  *  enterx 0002  *
 error  828a  *  fatadd 81b7  *  fatend 81fe  *  fatfin 8217  *
 fatinc 81fb  *  fatloo 81b9  *  fatobs 81f0  *  fatsec 81ed  *
 free   81f8  *  getcst 0012  *  getsub 0016  *  howsec 000f  *
 inc    8212  *  infend 82ac  *  info   000e  *  inkey  831a  *
 k      8400  *  kila   83c1  *  kolkox 0018  *  koniec 8337  *
 kukni  0010  *  l      0400  *  loop   801a  *  mendd  8381  *
 meno   83a0  *  nezle  8014  *  nie    82a2  *  num32  83ef  *
 numero 83da  *  obsad  824b  *  oddel  8359  *  olddrv 833a  *
 p      8000  *  patri  001e  *  plus   8206  *  ram    3c9e  *
 rom    3c98  *  setdrv 0013  *  space  83fa  *  sub    8400  *
 t16d   836d  *  tab16d 836a  *  tabi   0011  *  tabx   0003  *
 text   837b  *  txxt   0004  *  uzite1 8259  *  uzite2 825c  *
 verzia 0010  *  volne  822f  *  vv1    0031  *  vv2    0036  *
 xxx    03e0  *  yyy    03e1  *                                

Bytes:1024  labels:78  errors:0   




Popis
Viz. zdroják

Poznámky
Nic...

Poslal
Busy