Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1 | - | 1 | Tue Jul 17 11:00:20 2018 Page 1 |
2 | |||
3 | |||
4 | |||
5 | |||
6 | |||
7 | |||
8 | |||
9 | 2500 A.D. 65816 Macro Assembler #26960 - Version 5.02g |
||
10 | ----------------------------------------------------- |
||
11 | |||
12 | Input Filename : src\F9\fatsys.asm |
||
13 | Output Filename : obj\F9\fatsys.obj |
||
14 | Listing Has Been Relocated |
||
15 | |||
16 | |||
17 | 2603 .LIST on |
||
18 | 2604 |
||
19 | 2605 F8FFB1 .INCLUDE inc\dirp00.inc |
||
20 | 2606 ;---------------------------------------------------------- |
||
21 | 2607 ; DIRP00.ASM |
||
22 | 2608 ; PROGETTO: B1601 |
||
23 | 2609 ; |
||
24 | 2610 ; Variabili in Direct Page $00 |
||
25 | 2611 ;---------------------------------------------------------- |
||
26 | 2612 |
||
27 | 2613 ; sezione COMMON -- questo permette di includere il file in piu' file |
||
28 | 2614 |
||
29 | 2615 .LIST on |
||
30 | 2616 |
||
31 | 2617 DIRP00: .SECTION page0, ref_only, common ;Direct-Page 00 |
||
32 | 2618 |
||
33 | 2619 000000 .ABSOLUTE ;; inizia sempre da $00 |
||
34 | 2620 000000 .ORG 0x00 |
||
35 | 2621 000000 |
||
36 | 2622 000000 0000 JiffyClk .DW ; contatore 10ms 32 bit |
||
37 | 2623 000002 0000 .DW |
||
38 | 2624 000004 SysTmr .DS SYSTMRCNT ; system timer 0 (10ms) |
||
39 | 2625 000008 SysTMF .DS SYSTMRCNT ; flag timer (80 -> start) |
||
40 | 2626 00000C 00 Bnk0Flag .DB ; <7>: flag test RAM banco 0 ok |
||
41 | 2627 ; <6>: flag warm reset |
||
42 | 2628 00000D 00 RTCFlag .DB |
||
43 | 2629 |
||
44 | 2630 00000E diskstat .DS 2 ; flag device on ata bus #0 & #1 |
||
45 | 2631 ; <7>: device ready |
||
46 | 2632 ; <6>: compact flash device (C.F.) |
||
47 | 2633 ; <5>: device identification ok |
||
48 | 2634 ; <4>: MBR loaded |
||
49 | 2635 ; <3>: valid signature in MBR |
||
50 | 2636 ; <2>: first partition found&active |
||
51 | 2637 ; <1>: |
||
52 | 2638 ; <0>: valid partition flag |
||
53 | 2639 |
||
54 | 2640 ; <7>: device ready |
||
55 | 2641 ; <6>: USB device |
||
56 | 2642 ; <5>: compact flash device (C.F.) |
||
57 | 2643 ; <4>: device identification ok |
||
58 | 2644 ; <3>: MBR loaded |
||
59 | 2645 ; <2>: first partition found&active |
||
60 | 2646 ; <1>: always 1 |
||
61 | 2647 ; <0>: valid partition flag |
||
62 | 2648 000010 |
||
63 | Tue Jul 17 11:00:20 2018 Page 2 |
||
64 | |||
65 | |||
66 | |||
67 | |||
68 | 2649 |
||
69 | 2650 00000E atadev .EQU diskstat |
||
70 | 2651 |
||
71 | 2652 000010 usbdev .DS 2 ; flag flash disk on usb bus #0 |
||
72 | 2653 ; <7>: device plugged and ready |
||
73 | 2654 ; <6>: always 1 |
||
74 | 2655 ; <5>: device identification ok |
||
75 | 2656 ; <4>: MBR loaded |
||
76 | 2657 ; <3>: valid signature in MBR |
||
77 | 2658 ; <2>: first partition found&active |
||
78 | 2659 ; <1>: |
||
79 | 2660 ; <0>: valid partition flag |
||
80 | 2661 |
||
81 | 2662 000012 diskmax .DS 16 ; disk max. sector's |
||
82 | 2663 000012 atasec .EQU diskmax |
||
83 | 2664 00001A usbsec .EQU diskmax+8 |
||
84 | 2665 |
||
85 | 2666 |
||
86 | 2667 000022 atambr .DS 8 ; data for first partition found in mbr |
||
87 | 2668 ; first 3 bytes for start sector of partition |
||
88 | 2669 ; last byte for partition type |
||
89 | 2670 00002A usbmbr .DS 8 |
||
90 | 2671 |
||
91 | 2672 000032 ataprt .DS 8 ; total sec's of first partition |
||
92 | 2673 00003A usbprt .DS 8 ; total sec's of first partition |
||
93 | 2674 |
||
94 | 2675 |
||
95 | 2676 000042 00 usb0ch .DB ; usb0 (ch375/ch376) flag |
||
96 | 2677 ; <7>: module on |
||
97 | 2678 ; <6>: ch376 flag |
||
98 | 2679 ; <5:0>: chip version |
||
99 | 2680 |
||
100 | 2681 000043 00 usb0st .DB ; usb0 status |
||
101 | 2682 ; <7>: usb0 host mode ok |
||
102 | 2683 ; <6>: flash disk attached flag |
||
103 | 2684 ; <5>: usb device attached |
||
104 | 2685 |
||
105 | 2686 000044 00 fdcdrv .DB ; phisycal drive status (drive #0) |
||
106 | 2687 ; <7>: disk format established in bit 0&1 |
||
107 | 2688 ; <6>: double step seek done |
||
108 | 2689 ; <5>: trust format bit's (set after ok r/w) |
||
109 | 2690 ; <4>: write protect bit (if disk in drive) |
||
110 | 2691 ; <3>: don't care |
||
111 | 2692 ; <2>: don't care |
||
112 | 2693 ; <1>: HD disk if set else DD disk |
||
113 | 2694 ; <0>: CBM format if set else IBM format |
||
114 | 2695 |
||
115 | 2696 000045 00 vdrive .DB ; virtual drive status (ram disk, drive #1) |
||
116 | 2697 ; <7>: disk format established in bit 0&1 |
||
117 | 2698 ; <6>: change disk simulation (after format) |
||
118 | 2699 ; <5>: don't care |
||
119 | 2700 ; <4>: write protect bit (under sw control) |
||
120 | 2701 ; <3>: don't care |
||
121 | 2702 ; <2>: don't care |
||
122 | 2703 ; <1>: HD disk if set else DD disk |
||
123 | 2704 ; <0>: CBM format if set else IBM format |
||
124 | 2705 |
||
125 | Tue Jul 17 11:00:20 2018 Page 3 |
||
126 | |||
127 | |||
128 | |||
129 | |||
130 | 2706 000046 00 fdcctl .DB ; fdc controller status |
||
131 | 2707 ; <7>: drive is attached |
||
132 | 2708 ; <6>: drive need recalibration (restore) |
||
133 | 2709 ; <5>: FDC controller ok |
||
134 | 2710 ; <4>: motor on |
||
135 | 2711 ; <3>: dma is active |
||
136 | 2712 ; <2>: dma chip ok (post routine) |
||
137 | 2713 ; <1>: clock rate (1=HD,0=DD) |
||
138 | 2714 ; <0>: disk ready |
||
139 | 2715 |
||
140 | 2716 000047 00 fdctrk .DB ; fd: current seek track |
||
141 | 2717 000048 00 fdcerr .DB ; fd: last error code |
||
142 | 2718 000049 00 ataerr .DB ; ata: last error code |
||
143 | 2719 00004A 00 ataxer .DB ; ata: last extended error code |
||
144 | 2720 |
||
145 | 2721 00004B 00 CtrlBrk .DB ; flag CTRL+BREAK (NMI) |
||
146 | 2722 |
||
147 | 2723 00004C 0000 MemTop .DW ; top memoria RAM |
||
148 | 2724 00004E 00 .DB ; banco top mem |
||
149 | 2725 |
||
150 | 2726 00004F 00 DflTxtIn .DB ; device di default text input |
||
151 | 2727 000050 00 DflTxtOut .DB ; device di default text output |
||
152 | 2728 |
||
153 | 2729 000051 COPPtr LP ; long pointer for COP decoding |
||
154 | 2730 000054 00 COPIdx .DB ; COP signature/index |
||
155 | 2731 |
||
156 | 2732 000055 00 BiosEnt .DB ; flag accesso a bios setup |
||
157 | 2733 |
||
158 | 2734 ; variabili utilizzate da ACIA |
||
159 | 2735 000056 spwrk .DS $30 |
||
160 | 2736 |
||
161 | 2737 ; bios mem |
||
162 | 2738 000086 0000 nsize .DW ; dimensione blocco da allocare |
||
163 | 2739 ;bsize .DW ; dimensione vera blocco free |
||
164 | 2740 000088 0000 splitsz .DW ; dimensione blocco splittato |
||
165 | 2741 00008A 0000 bfree .DW ; puntatore blocco free |
||
166 | 2742 00008C 0000 hdrptr .DW ; puntatore header heap |
||
167 | 2743 |
||
168 | 2744 00008E 0000 pbrklv .DW ; current break level of current process |
||
169 | 2745 000090 0000 pbrkmin .DW ; minimum breal level of current process |
||
170 | 2746 000092 0000 pbrkmax .DW ; maximum breal level of current process |
||
171 | 2747 000094 |
||
172 | 2748 ; bios temp. work area |
||
173 | 2749 000094 bwrktmp .DS $28 |
||
174 | 2750 |
||
175 | 2751 0000BC 00 coptmp .DB ; temp. used while cop |
||
176 | 2752 |
||
177 | 2753 0000BD 00 tstser .DB ; check ser/usb test board post |
||
178 | 2754 ; <7>: VIA2 ok |
||
179 | 2755 ; <6>: PICRAM ok |
||
180 | 2756 ; <1>: UART 16C550 ok |
||
181 | 2757 ; <0>: R65C51 ok |
||
182 | 2758 |
||
183 | 2759 |
||
184 | 2760 ;crc16 .DW |
||
185 | 2761 |
||
186 | 2762 0000BD .RELATIVE |
||
187 | Tue Jul 17 11:00:20 2018 Page 4 |
||
188 | |||
189 | |||
190 | |||
191 | |||
192 | 2763 |
||
193 | 2764 .ENDS |
||
194 | 2765 |
||
195 | 2766 [01] .IFDEF _ACIA_INC_ |
||
196 | 2767 .INCLUDE INC\SP.INC |
||
197 | 2768 [00] .ENDIF |
||
198 | 2769 |
||
199 | 2794 .LIST on |
||
200 | 2795 |
||
201 | 2796 ;--------------------------------------------------------------------------- |
||
202 | 2797 |
||
203 | 2798 000020 HPLMAX .EQU 32 ; Max. subdirectory level |
||
204 | 2799 |
||
205 | 2800 000200 BCBCNT .EQU $200 ; BCB's struct's count # |
||
206 | 2801 000C00 BCBXBNK .EQU $0C00 ; starting BCB x-mem buffer # |
||
207 | 2802 000040 DMACNT .EQU 64 |
||
208 | 2803 |
||
209 | 2804 0000E0 FAT0X .EQU $E0 ; x-mem bank for fat table of ata #0 |
||
210 | 2805 0000F0 FAT1X .EQU $F0 ; x-mem bank for fat table of ata #1 |
||
211 | 2806 |
||
212 | 2807 F8FFB1 .INCLUDE INC\LDT.INC |
||
213 | 2808 ; LDT.INC |
||
214 | 2809 |
||
215 | 2810 [01] .IFNDEF __LDT_INC__ |
||
216 | 2811 000001 __LDT_INC__ .SET 1 |
||
217 | 2812 |
||
218 | 2813 .LIST on |
||
219 | 2814 ;--------------------------------------------------------------------------- |
||
220 | 2815 ; Logical Drive Table (LDT) -- page 0 offset's |
||
221 | 2816 ;--------------------------------------------------------------------------- |
||
222 | 2817 |
||
223 | 2818 F8FFB1 STRUCT LDT |
||
224 | 2819 _LDT .SECTION page0,common,ref_only,offset 0 ;LDT Struct |
||
225 | 2820 ;.ABSOLUTE |
||
226 | 2821 ;.ORG 0 |
||
227 | 2822 .MNLIST |
||
228 | 2823 000000 00 ldt_fg1 .DB ; logical volume flag's |
||
229 | 2824 ; <7>: device ready (fdc drive or ata device) |
||
230 | 2825 ; <6>: if=1->HD/CF else->FD |
||
231 | 2826 ; <1:0>: phisycal device number |
||
232 | 2827 |
||
233 | 2828 000001 00 ldt_fg2 .DB ; <7>: valid volume (fat volume or cbm disk) |
||
234 | 2829 ; <6>: if=1->FAT else->CBM (FD only) |
||
235 | 2830 ; <5>: disk format checked |
||
236 | 2831 ; <1:0>: disk format (fdc only) |
||
237 | 2832 |
||
238 | 2833 000002 0000 ldt_root .DW ; lba of root dir |
||
239 | 2834 000004 0000 ldt_fat1 .DW ; lba of fat1 table |
||
240 | 2835 000006 0000 ldt_fat2 .DW ; lba of fat2 table |
||
241 | 2836 000008 0000 ldt_cls .DW ; lba of first data cluster |
||
242 | 2837 00000A 0000 ldt_max .DW ; max usable cluster + 1 |
||
243 | 2838 00000C 0000 ldt_rent .DW ; root dir. max. entries |
||
244 | 2839 00000E 0000 ldt_cent .DW ; max. entries in dir. cluster |
||
245 | 2840 000010 0000 ldt_eoc .DW ; end of cluster chain marker |
||
246 | 2841 000012 0000 ldt_free .DW ; count of free cluster's |
||
247 | 2842 000014 0000 ldt_nxt .DW ; next free cluster |
||
248 | 2843 000016 0000 ldt_fsiz .DW ; fat table size |
||
249 | Tue Jul 17 11:00:20 2018 Page 5 |
||
250 | |||
251 | |||
252 | |||
253 | |||
254 | 2844 |
||
255 | 2845 000018 00 ldt_csiz .DB ; cluster size (1,2,4,8,16,32,64) |
||
256 | 2846 000019 00 ldt_cshf .DB ; cluster shift (0,1,2,3,4,5,6) |
||
257 | 2847 00001A 00 ldt_rsiz .DB ; root dir. size (sector's) |
||
258 | 2848 00001B 00 ldt_mcls .DB ; mask for clust. module: 00,01,03,07,0F,1F,3F |
||
259 | 2849 00001C 0000 ldt_cdlp .DW ; current working dir list pointer |
||
260 | 2850 00001E 0000 ldt_cdcls .DW ; current working dir start cluster |
||
261 | 2851 000020 00 ldt_cdlvl .DB ; current working dir level count |
||
262 | 2852 |
||
263 | 2853 000021 00 ldt_ptype .DB |
||
264 | 2854 000022 0000 0000 ldt_pstart .LWORD |
||
265 | 2855 000026 0000 0000 ldt_psize .LWORD |
||
266 | 2856 |
||
267 | 2857 000022 ldt_fp .EQU ldt_pstart ; fat table buffer long pointer |
||
268 | 2858 000025 ldt_fbuf .EQU ldt_pstart+3 ; fat table: x-mem base bank/dma buffer |
||
269 | 2859 |
||
270 | 2860 000026 ldt_pbr .EQU ldt_psize ; long pointer to PBR cache buffer |
||
271 | 2861 000029 ldt_fmt .EQU ldt_psize+3 |
||
272 | 2862 |
||
273 | 2863 00002A ESTRUCT LDT |
||
274 | 2864 00002A LDTSIZE .DS 0 |
||
275 | 2865 ;.RELATIVE |
||
276 | 2866 .ENDS |
||
277 | 2867 .MNLIST |
||
278 | 2868 |
||
279 | 2869 [00] .ENDIF |
||
280 | 2870 |
||
281 | 2871 F8FFB1 |
||
282 | 2872 ;--------------------------------------------------------------------------- |
||
283 | 2873 ; Hierarchical Path List (HPL) -- 16 bit offset's |
||
284 | 2874 ;--------------------------------------------------------------------------- |
||
285 | 2875 |
||
286 | 2876 F8FFB1 LSTRUCT HPL |
||
287 | 2877 _HPL .SECTION common,ref_only,offset 0 ;HPL Struct |
||
288 | 2878 .MNLIST |
||
289 | 2879 000000 0000 hpl_cls .DW ; parent cluster |
||
290 | 2880 000002 0000 hpl_ix .DW ; entry index in parent cluster |
||
291 | 2881 000004 hpl_fcb .DS 11 ; fcb name |
||
292 | 2882 00000F 00 hpl_lst .DB ; unused |
||
293 | 2883 000010 ESTRUCT HPL |
||
294 | 2884 000010 HPLSIZE .DS 0 |
||
295 | 2885 ;.RELATIVE |
||
296 | 2886 .ENDS |
||
297 | 2887 .MNLIST |
||
298 | 2888 |
||
299 | 2889 ;--------------------------------------------------------------------------- |
||
300 | 2890 ; Buffer Control Block (BCB) -- 16 bit offset's |
||
301 | 2891 ;--------------------------------------------------------------------------- |
||
302 | 2892 |
||
303 | 2893 F8FFB1 LSTRUCT BCB |
||
304 | 2894 _BCB .SECTION common,ref_only,offset 0 ;BCB Struct |
||
305 | 2895 .MNLIST |
||
306 | 2896 000000 0000 bcb_next .DW ; next logical linked BCB |
||
307 | 2897 000002 00 bcb_drv .DB ; logical drive |
||
308 | 2898 000003 00 bcb_sec .DB ; sector offset |
||
309 | 2899 000004 0000 bcb_cls .DW ; cluster |
||
310 | 2900 000006 0000 bcb_lba .DW ; sector lba address |
||
311 | Tue Jul 17 11:00:20 2018 Page 6 |
||
312 | |||
313 | |||
314 | |||
315 | |||
316 | 2901 000008 0000 bcb_lbah .DW ; lba high |
||
317 | 2902 000008 bcb_head .EQU bcb_lbah ; floppy head |
||
318 | 2903 00000A 0000 bcb_buf .DW ; x-mem buffer number |
||
319 | 2904 00000A bcb_trk .EQU bcb_buf ; floppy track(low) & sector(hi) |
||
320 | 2905 00000C 0000 bcb_ptr .DW ; buffer pointer |
||
321 | 2906 00000E 0000 bcb_xbnk .DW ; buffer pointer hi & x-mem bank |
||
322 | 2907 00000E bcb_dma .EQU bcb_xbnk ; buffer pointer hi & dma buffer |
||
323 | 2908 000010 ESTRUCT BCB |
||
324 | 2909 000010 BCBSIZE .DS 0 |
||
325 | 2910 ;.RELATIVE |
||
326 | 2911 .ENDS |
||
327 | 2912 .MNLIST |
||
328 | 2913 |
||
329 | 2914 ;--------------------------------------------------------------------------- |
||
330 | 2915 ; hash Control Block (BCB) -- 16 bit offset's |
||
331 | 2916 ;--------------------------------------------------------------------------- |
||
332 | 2917 |
||
333 | 2918 F8FFB1 LSTRUCT HCB |
||
334 | 2919 _HCB .SECTION common,ref_only,offset 0 ;HCB Struct |
||
335 | 2920 .MNLIST |
||
336 | 2921 000000 0000 hcb_next .DW ; pointer to next HCB |
||
337 | 2922 000002 0000 hcb_cls .DW ; cluster number |
||
338 | 2923 000004 0000 hcb_seq .DW ; sequence number + logical drive number |
||
339 | 2924 000006 0000 hcb_cnt .DW ; number of hashed entries |
||
340 | 2925 000008 hcb_data .DS 0 ; hash buffer data |
||
341 | 2926 000008 ESTRUCT HCB |
||
342 | 2927 000008 HCBSIZE .DS 0 |
||
343 | 2928 ;.RELATIVE |
||
344 | 2929 .ENDS |
||
345 | 2930 .MNLIST |
||
346 | 2931 |
||
347 | 2932 ;--------------------------------------------------------------------------- |
||
348 | 2933 ; TOS Working Segment |
||
349 | 2934 ;--------------------------------------------------------------------------- |
||
350 | 2935 |
||
351 | 2936 000001 WKB .EQU .SEG.TOSSEG ; TOS working bank |
||
352 | 2937 |
||
353 | 2938 010000 TS .SET TOSSEG |
||
354 | 2939 01FFFF TE .SET TOSSEG + $FFFF |
||
355 | 2940 018C00 TO0 .SET $018C00 |
||
356 | 2941 019E00 TO1 .SET TOSWKM |
||
357 | 2942 |
||
358 | 2943 .comment @ |
||
359 | 2944 _TOS0: .SECTION ref_only, common, offset TO0, range TS TE ;FAT Struct's |
||
360 | 2945 _TOS0_START .DS 0 |
||
361 | 2946 |
||
362 | 2947 _pbr0 .DS 512 |
||
363 | 2948 _pbr1 .DS 512 |
||
364 | 2949 _pbr2 .DS 512 |
||
365 | 2950 _pbr3 .DS 512 |
||
366 | 2951 |
||
367 | 2952 _TOS0_END .DS 0 |
||
368 | 2953 TOS0SIZ .EQU (_TOS0_END - _TOS0_START) |
||
369 | 2954 .ENDS |
||
370 | 2955 @ |
||
371 | 2956 |
||
372 | 2957 _TOS1: .SECTION ref_only, common, offset TO1, range TS TE ;FAT Struct's |
||
373 | Tue Jul 17 11:00:20 2018 Page 7 |
||
374 | |||
375 | |||
376 | |||
377 | |||
378 | 2958 019E00 _TOS1_START .DS 0 |
||
379 | 2959 |
||
380 | 2960 ; current working directory HPL |
||
381 | 2961 019E00 cwdl0 .DS (HPLSIZE*HPLMAX) |
||
382 | 2962 01A000 cwdl1 .DS (HPLSIZE*HPLMAX) |
||
383 | 2963 01A200 cwdl2 .DS (HPLSIZE*HPLMAX) |
||
384 | 2964 01A400 cwdl3 .DS (HPLSIZE*HPLMAX) |
||
385 | 2965 |
||
386 | 2966 ; current building path HPL |
||
387 | 2967 01A600 cbpl .DS (HPLSIZE*HPLMAX) |
||
388 | 2968 01A600 HPL_CLS .EQU hpl_cls+cbpl |
||
389 | 2969 01A602 HPL_IX .EQU hpl_ix+cbpl |
||
390 | 2970 01A604 HPL_FCB .EQU hpl_fcb+cbpl |
||
391 | 2971 |
||
392 | 2972 ; BCB list's |
||
393 | 2973 01A800 bcbstart .DS (BCBCNT*BCBSIZE) |
||
394 | 2974 01C800 bcbend .DS 0 |
||
395 | 2975 01C800 dmastart .DS (DMACNT*BCBSIZE) |
||
396 | 2976 01CC00 dmaend .DS 0 |
||
397 | 2977 01CC00 dma0s .DS (17*BCBSIZE) |
||
398 | 2978 01CD10 dma1s .DS (17*BCBSIZE) |
||
399 | 2979 |
||
400 | 2980 01CE20 _TOS1_END .DS 0 |
||
401 | 2981 003020 TOS1SIZ .EQU (_TOS1_END - _TOS1_START) |
||
402 | 2982 .ENDS |
||
403 | 2983 |
||
404 | 2984 ;--------------------------------------------------------------------------- |
||
405 | 2985 ; HCB Segment |
||
406 | 2986 ;--------------------------------------------------------------------------- |
||
407 | 2987 |
||
408 | 2988 000004 HCBBNK .EQU .SEG.HCBSEG |
||
409 | 2989 040000 HS .SET HCBSEG |
||
410 | 2990 04FFFF HE .SET HCBSEG + $FFFF |
||
411 | 2991 040000 HO .SET HCBSEG |
||
412 | 2992 |
||
413 | 2993 _HCBS: .SECTION ref_only, common, offset HO, range HS HE ;HCB's List |
||
414 | 2994 040000 hcb_bnk .DS 8 |
||
415 | 2995 040008 hcbstart .DS 0 |
||
416 | 2996 .ENDS |
||
417 | 2997 |
||
418 | 2998 ;.comment @ |
||
419 | 2999 ;--------------------------------------------------------------------------- |
||
420 | 3000 ; direct page for LDT var's |
||
421 | 3001 ;--------------------------------------------------------------------------- |
||
422 | 3002 |
||
423 | 3003 ; P0OS |
||
424 | 3004 DPOS: .SECTION page0, common, ref_only, offset 0 ;OS Main D.P. |
||
425 | 3005 |
||
426 | 3006 ;sysbuf .DS 2 ; floppy track 0 cache buffer |
||
427 | 3007 000000 00 defhsec .DB ; default hidden sector's in fdisk |
||
428 | 3008 000001 00 .DB |
||
429 | 3009 000002 0000 cmdstk .DW ; saved stack on TOS command's |
||
430 | 3010 000004 bpath .DS 80 |
||
431 | 3011 |
||
432 | 3012 000054 bpath1 .DS 0 |
||
433 | 3013 .ENDS |
||
434 | 3014 ;@ |
||
435 | Tue Jul 17 11:00:20 2018 Page 8 |
||
436 | |||
437 | |||
438 | |||
439 | |||
440 | 3015 |
||
441 | 3016 ; P0LDT |
||
442 | 3017 DPLDT: .SECTION page0, common, ref_only, offset 0 ;LDT D.P. |
||
443 | 3018 |
||
444 | 3019 000000 ldt0 .DS LDTSIZE |
||
445 | 3020 00002A ldt1 .DS LDTSIZE |
||
446 | 3021 000054 ldt2 .DS LDTSIZE |
||
447 | 3022 00007E ldt3 .DS LDTSIZE |
||
448 | 3023 0000A8 ldt4 .DS LDTSIZE |
||
449 | 3024 |
||
450 | 3025 0000D2 ldtp .DS 6 ; pointer to LDT's in DPLDT page |
||
451 | 3026 |
||
452 | 3027 0000D8 sysbuf .DS 4 ; floppy track 0 cache buffer |
||
453 | 3028 |
||
454 | 3029 .ENDS |
||
455 | 3030 |
||
456 | 3031 ;--------------------------------------------------------------------------- |
||
457 | 3032 ; direct page for FAT var's |
||
458 | 3033 ;--------------------------------------------------------------------------- |
||
459 | 3034 |
||
460 | 3035 ; P0FAT |
||
461 | 3036 DPFAT: .SECTION page0, common, ref_only, offset 0 ;FAT D.P. |
||
462 | 3037 |
||
463 | 3038 000000 0000 ostos .DW ; saved top of stack |
||
464 | 3039 000002 00 ioerr .DB ; i/o error |
||
465 | 3040 000003 00 ioerr2 .DB ; extended i/o error |
||
466 | 3041 000004 0000 hcbroot .DW ; HCB struct's list |
||
467 | 3042 000006 0000 hcblst .DW ; the last one HCB |
||
468 | 3043 000008 00 hsiz .DB ; how many sector's an HCB can hold |
||
469 | 3044 000009 00 hlog2 .DB ; shift count related to hsiz |
||
470 | 3045 00000A 0000 bcbroot .DW ; BCB buffer's list |
||
471 | 3046 00000C 0000 bcblst .DW ; the last one BCB |
||
472 | 3047 00000E 0000 dmaroot .DW ; dma BCB buffer's list |
||
473 | 3048 000010 0000 dmalst .DW ; the last one dma BCB |
||
474 | 3049 000012 0000 dmabcb .DW ; BCB list for floppy root, cluster#2,#3 |
||
475 | 3050 000014 00 fspt .DB ; sector per track (floppy) |
||
476 | 3051 000015 00 pdrive .DB ; phisycal drive number |
||
477 | 3052 000016 00 bplvl .DB ; subdir level while build path |
||
478 | 3053 000017 00 defdrv .DB ; default drive |
||
479 | 3054 |
||
480 | 3055 ; the first block of ldt_ var's is copied from the LDT struct |
||
481 | 3056 000018 00 ldtfg1 .DB ; logical volume flag's |
||
482 | 3057 ; <7>: device ready (fdc drive or ata device) |
||
483 | 3058 ; <6>: if=1->HD/CF else->FD |
||
484 | 3059 ; <0>: phisycal device number |
||
485 | 3060 |
||
486 | 3061 000019 00 ldtfg2 .DB ; <7>: valid volume (fat volume or cbm disk) |
||
487 | 3062 ; <6>: if=1->FAT else->CBM (FD only) |
||
488 | 3063 ; <5>: disk format checked |
||
489 | 3064 ; <1:0>: disk format (fdc only) |
||
490 | 3065 |
||
491 | 3066 00001A ldtfp LP ; fat table buffer long pointer |
||
492 | 3067 00001D 00 ldtfbuf .DB ; fat table: x-mem base bank/dma buffer |
||
493 | 3068 |
||
494 | 3069 00001E 0000 ldtroot .DW ; lba of root dir |
||
495 | 3070 000020 0000 ldtfat1 .DW ; lba of fat1 table |
||
496 | 3071 000022 0000 ldtfat2 .DW ; lba of fat2 table |
||
497 | Tue Jul 17 11:00:20 2018 Page 9 |
||
498 | |||
499 | |||
500 | |||
501 | |||
502 | 3072 000024 0000 ldtcls .DW ; lba of first data cluster |
||
503 | 3073 000026 0000 ldtmax .DW ; max usable cluster + 1 |
||
504 | 3074 000028 00 ldtcsiz .DB ; cluster size (1,2,4,8,16,32,64) |
||
505 | 3075 000029 00 ldtcshf .DB ; cluster shift (0,1,2,3,4,5,6) |
||
506 | 3076 00002A 00 ldtfsiz .DB ; fat table size (if 0 -> 256) |
||
507 | 3077 00002B 00 ldtrsiz .DB ; root dir. size (sector's) |
||
508 | 3078 00002C 0000 ldtrent .DW ; root dir. max. entries |
||
509 | 3079 00002E 0000 ldtcent .DW ; max. entries in dir. cluster |
||
510 | 3080 000030 0000 ldteoc .DW ; end of cluster chain marker |
||
511 | 3081 000032 00 ldtmcls .DB ; mask for clust. module: 00,01,03,07,0F,1F,3F |
||
512 | 3082 000033 00 ldtfmt .DB ; floppy disk format (0,1,2, FF if ata device) |
||
513 | 3083 000034 0000 ldtcdlp .DW ; current working dir list pointer |
||
514 | 3084 000036 0000 ldtcdcls .DW ; current working dir start cluster |
||
515 | 3085 000038 0000 ldtfree .DW ; count of free cluster's |
||
516 | 3086 00003A 0000 ldtnxt .DW ; next free cluster |
||
517 | 3087 00003C 00 ldtcdlvl .DB ; current working dir level count |
||
518 | 3088 00003D ldtpbr LP ; long pointer to PBR cache buffer |
||
519 | 3089 |
||
520 | 3090 000040 0000 chdcls .DW ; last accessed chained dir. cluster |
||
521 | 3091 000042 0000 clsofs .DW ; cluster's offset from start of chain |
||
522 | 3092 |
||
523 | 3093 ; not change order of the 2 following var's: will be accessed as 16 bit var |
||
524 | 3094 000044 00 entofs .DB ; entry offset from start of sector |
||
525 | 3095 000045 00 secofs .DB ; sector's offset from start of cluster |
||
526 | 3096 |
||
527 | 3097 000046 0000 dircls .DW ; directory cluster |
||
528 | 3098 000048 0000 dcnt .DW ; directory entry counter |
||
529 | 3099 00004A 0000 lba .DW ; lba sector address |
||
530 | 3100 00004C 0000 lbah .DW ; lba is 24 bit's only |
||
531 | 3101 00004E 0000 xbuf .DW ; x-mem buffer transfer number |
||
532 | 3102 |
||
533 | 3103 00004C fhead .EQU lbah ; fd head |
||
534 | 3104 00004E ftrack .EQU xbuf ; fd track |
||
535 | 3105 00004F fsec .EQU xbuf+1 ; fd sector |
||
536 | 3106 |
||
537 | 3107 000050 00 dfcbtyp .DB ; FCB type to search |
||
538 | 3108 000051 00 dfcbatt .DB ; attribute of found FCB |
||
539 | 3109 |
||
540 | 3110 000052 00 curdrv .DB ; current logical drive |
||
541 | 3111 000053 fcbs .DS 11 ; file control block name |
||
542 | 3112 |
||
543 | 3113 ;dcmask .DW ; mask to start of cluster |
||
544 | 3114 ; FFF0, FFE0, FFC0, FF80, FF00, FE00 |
||
545 | 3115 |
||
546 | 3116 00005E 0000 fcbp .DW ; FCB buffer long pointer |
||
547 | 3117 000060 0000 .DW ; low=fcbp+2, high=x-mem bank or dma buffer |
||
548 | 3118 000061 dmabuf .EQU fcbp+3 ; dma buffer # |
||
549 | 3119 000061 xmbank .EQU fcbp+3 ; x-mem bank # |
||
550 | 3120 |
||
551 | 3121 ; temp area |
||
552 | 3122 000062 00 hcbseq .DB |
||
553 | 3123 000063 00 hcbdrv .DB |
||
554 | 3124 000064 0000 bcbcls .DW |
||
555 | 3125 000066 00 bcbdrv .DB |
||
556 | 3126 000067 00 bcbsec .DB |
||
557 | 3127 |
||
558 | 3128 000068 0000 thash .DW |
||
559 | Tue Jul 17 11:00:20 2018 Page 10 |
||
560 | |||
561 | |||
562 | |||
563 | |||
564 | 3129 000068 hcbrec .EQU thash |
||
565 | 3130 000068 wtmp .EQU thash |
||
566 | 3131 |
||
567 | 3132 00006A 0000 hlast .DW |
||
568 | 3133 00006C 0000 hcbcls .DW |
||
569 | 3134 00006E 0000 hcbx .DW |
||
570 | 3135 000070 0000 hcby .DW |
||
571 | 3136 00006A tmpp .EQU hlast ; temp. long pointer |
||
572 | 3137 00006E tmpx .EQU hcbx |
||
573 | 3138 00006F wild .EQU hcbx+1 |
||
574 | 3139 000070 fsiz .EQU hcby |
||
575 | 3140 000071 fptr .EQU hcby+1 |
||
576 | 3141 00006E ldrv .EQU hcbx |
||
577 | 3142 00006F tmpldt .EQU hcbx+1 |
||
578 | 3143 |
||
579 | 3144 000072 0000 fhash .DW |
||
580 | 3145 000074 0000 fcbofs .DW |
||
581 | 3146 000076 00 bcbload .DB |
||
582 | 3147 000077 00 xstart .DB |
||
583 | 3148 000078 00 xend .DB |
||
584 | 3149 000079 00 seccnt .DB |
||
585 | 3150 00007A 00 maxseq .DB |
||
586 | 3151 00007B 00 dsiz .DB |
||
587 | 3152 |
||
588 | 3153 00007C 00 haswld .DB |
||
589 | 3154 00007D 00 strix .DB |
||
590 | 3155 00007E pathp LP ; long pointer to path string |
||
591 | 3156 |
||
592 | 3157 ; TEMP |
||
593 | 3158 000081 0000 quot .DW |
||
594 | 3159 000083 0000 dvsor .DW |
||
595 | 3160 000085 0000 troot .DW |
||
596 | 3161 000087 0000 tlst .DW |
||
597 | 3162 000089 0000 bdmask .DW |
||
598 | 3163 00008B 0000 bcmask .DW |
||
599 | 3164 |
||
600 | 3165 00008D 00 hcbuse .DB |
||
601 | 3166 |
||
602 | 3167 .ENDS |
||
603 | 3168 |
||
604 | 3172 .LIST on |
||
605 | 3173 |
||
606 | 3174 ;--------------------------------------------------------------------------- |
||
607 | 3175 ; code segment -- bank $F9 |
||
608 | 3176 ;--------------------------------------------------------------------------- |
||
609 | 3177 |
||
610 | 3178 .CODEF9 |
||
611 | 3179 .PUBLIC oserror |
||
612 | 3180 |
||
613 | 3181 .LONGA off |
||
614 | 3182 .LONGI off |
||
615 | 3183 |
||
616 | 3184 ;--------------------------------------------------------------------------- |
||
617 | 3185 ; error handler |
||
618 | 3186 ;--------------------------------------------------------------------------- |
||
619 | 3187 |
||
620 | 3188 F92412 oserror: |
||
621 | Tue Jul 17 11:00:20 2018 Page 11 |
||
622 | |||
623 | |||
624 | |||
625 | |||
626 | 3189 F92412 F4 00 41 pea #P0FAT |
||
627 | 3190 F92415 2B pld |
||
628 | 3191 F92416 A2 00 ldx #0 ; set DBR=0 |
||
629 | 3192 F92418 DA phx |
||
630 | 3193 F92419 AB plb |
||
631 | 3194 F9241A INDEX16 |
||
632 | 3195 F9241A C2 10 rep #PXFLAG |
||
633 | 3196 .LONGI on |
||
634 | 3197 .MNLIST |
||
635 | 3198 F9241C A6 00 ldx ostos ; restore stack pointer |
||
636 | 3199 F9241E 9A txs |
||
637 | 3200 F9241F INDEX08 |
||
638 | 3201 F9241F E2 10 sep #PXFLAG |
||
639 | 3202 .LONGI off |
||
640 | 3203 .MNLIST |
||
641 | 3204 F92421 38 sec ; error flag |
||
642 | 3205 F92422 60 rts |
||
643 | |||
644 | |||
645 | Lines Assembled : 3161 Errors : 0 |
||
646 | |||
647 | |||
648 |