797 lines
32 KiB
Plaintext
797 lines
32 KiB
Plaintext
![]() |
Thu May 20 2021 21:34 Page 1
|
|||
|
|
|||
|
|
|||
|
***************************************
|
|||
|
** WDC 65C816 Macro Assembler **
|
|||
|
** **
|
|||
|
** Version 3.49.1- Feb 6 2006 **
|
|||
|
***************************************
|
|||
|
|
|||
|
1 ;:ts=8
|
|||
|
2 00000001 R0 equ 1
|
|||
|
3 00000005 R1 equ 5
|
|||
|
4 00000009 R2 equ 9
|
|||
|
5 0000000D R3 equ 13
|
|||
|
6 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
7 ;/* Low level disk I/O module SKELETON for FatFs
|
|||
|
(C)ChaN, 2019 */
|
|||
|
8 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
9 ;/* If a working storage control module is availab
|
|||
|
le, it should be */
|
|||
|
10 ;/* attached to the FatFs via a glue function rath
|
|||
|
er than modifying it. */
|
|||
|
11 ;/* This is an example of glue functions to attach
|
|||
|
various exsisting */
|
|||
|
12 ;/* storage control modules to the FatFs module wi
|
|||
|
th a defined API. */
|
|||
|
13 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
14 ;
|
|||
|
15 ;#include "ff.h" /* Obtains integ
|
|||
|
er types */
|
|||
|
16 ;#include "diskio.h" /* Declarations
|
|||
|
of disk functions */
|
|||
|
17 ;
|
|||
|
18 ;/* Definitions of physical drive number for each
|
|||
|
drive */
|
|||
|
19 ;#define DEV_SDC 0 /* Example: Map
|
|||
|
Ramdisk to physical drive 0 */
|
|||
|
20 ;
|
|||
|
21 ;
|
|||
|
22 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
23 ;/* Get Drive Status
|
|||
|
*/
|
|||
|
24 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
25 ;
|
|||
|
26 ;DSTATUS disk_status (
|
|||
|
27 ; BYTE pdrv /* Physical drive nmuber
|
|||
|
to identify the drive */
|
|||
|
28 ;)
|
|||
|
29 ;{
|
|||
|
30 code
|
|||
|
31 xdef ~~disk_status
|
|||
|
32 func
|
|||
|
33 ~~disk_status:
|
|||
|
34 longa on
|
|||
|
35 longi on
|
|||
|
36 00:0000: 3B tsc
|
|||
|
Thu May 20 2021 21:34 Page 2
|
|||
|
|
|||
|
|
|||
|
37 00:0001: 38 sec
|
|||
|
38 00:0002: E9 03 00 sbc #L2
|
|||
|
39 00:0005: 1B tcs
|
|||
|
40 00:0006: 0B phd
|
|||
|
41 00:0007: 5B tcd
|
|||
|
42 00000004 pdrv_0 set 4
|
|||
|
43 ; DSTATUS stat;
|
|||
|
44 ; int result;
|
|||
|
45 ;
|
|||
|
46 ; k_prints("disk_status\r");
|
|||
|
47 00000000 stat_1 set 0
|
|||
|
48 00000001 result_1 set 1
|
|||
|
49 00:0008: F4 xx xx pea #^L1
|
|||
|
50 00:000B: F4 xx xx pea #<L1
|
|||
|
51 00:000E: 22 xx xx xx jsl ~~k_prints
|
|||
|
52 ;
|
|||
|
53 ; switch (pdrv) {
|
|||
|
54 00:0012: A5 07 lda <L2+pdrv_0
|
|||
|
55 00:0014: 29 FF 00 and #$ff
|
|||
|
56 00:0017: 82 15 00 brl L10001
|
|||
|
57 ; case DEV_SDC:
|
|||
|
58 L10003:
|
|||
|
59 ;
|
|||
|
60 ; // translate the reslut code here
|
|||
|
61 ;
|
|||
|
62 ; return 0;
|
|||
|
63 00:001A: A9 00 00 lda #$0
|
|||
|
64 L4:
|
|||
|
65 00:001D: A8 tay
|
|||
|
66 00:001E: A5 05 lda <L2+2
|
|||
|
67 00:0020: 85 07 sta <L2+2+2
|
|||
|
68 00:0022: A5 04 lda <L2+1
|
|||
|
69 00:0024: 85 06 sta <L2+1+2
|
|||
|
70 00:0026: 2B pld
|
|||
|
71 00:0027: 3B tsc
|
|||
|
72 00:0028: 18 clc
|
|||
|
73 00:0029: 69 05 00 adc #L2+2
|
|||
|
74 00:002C: 1B tcs
|
|||
|
75 00:002D: 98 tya
|
|||
|
76 00:002E: 6B rtl
|
|||
|
77 ;
|
|||
|
78 ; }
|
|||
|
79 L10001:
|
|||
|
80 xref ~~~swt
|
|||
|
81 00:002F: 22 xx xx xx jsl ~~~swt
|
|||
|
82 00:0033: 01 00 dw 1
|
|||
|
83 00:0035: 00 00 dw 0
|
|||
|
84 00:0037: xx xx dw L10003-1
|
|||
|
85 00:0039: xx xx dw L10002-1
|
|||
|
86 L10002:
|
|||
|
87 ; return STA_NOINIT;
|
|||
|
88 00:003B: A9 01 00 lda #$1
|
|||
|
89 00:003E: 82 DC FF brl L4
|
|||
|
90 ;}
|
|||
|
91 00000003 L2 equ 3
|
|||
|
92 00000001 L3 equ 1
|
|||
|
93 ends
|
|||
|
94 efunc
|
|||
|
Thu May 20 2021 21:34 Page 3
|
|||
|
|
|||
|
|
|||
|
95 data
|
|||
|
96 L1:
|
|||
|
97 00:0000: 64 69 73 6B db $64,$69,$73,$6B,$5F,$73,$74,$61,$74,$75,
|
|||
|
$73,$0D,$00
|
|||
|
00:0004: 5F 73 74 61
|
|||
|
00:0008: 74 75 73 0D
|
|||
|
00:000C: 00
|
|||
|
98 00:000D: ends
|
|||
|
99 ;
|
|||
|
100 ;
|
|||
|
101 ;
|
|||
|
102 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
103 ;/* Inidialize a Drive
|
|||
|
*/
|
|||
|
104 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
105 ;
|
|||
|
106 ;DSTATUS disk_initialize (
|
|||
|
107 ; BYTE pdrv /* Physi
|
|||
|
cal drive nmuber to identify the drive */
|
|||
|
108 ;)
|
|||
|
109 ;{
|
|||
|
110 code
|
|||
|
111 xdef ~~disk_initialize
|
|||
|
112 func
|
|||
|
113 ~~disk_initialize:
|
|||
|
114 longa on
|
|||
|
115 longi on
|
|||
|
116 00:0041: 3B tsc
|
|||
|
117 00:0042: 38 sec
|
|||
|
118 00:0043: E9 03 00 sbc #L6
|
|||
|
119 00:0046: 1B tcs
|
|||
|
120 00:0047: 0B phd
|
|||
|
121 00:0048: 5B tcd
|
|||
|
122 00000004 pdrv_0 set 4
|
|||
|
123 ; DSTATUS stat;
|
|||
|
124 ; int result;
|
|||
|
125 ;
|
|||
|
126 ; k_prints("disk_initialize\r");
|
|||
|
127 00000000 stat_1 set 0
|
|||
|
128 00000001 result_1 set 1
|
|||
|
129 00:0049: F4 xx xx pea #^L5
|
|||
|
130 00:004C: F4 xx xx pea #<L5
|
|||
|
131 00:004F: 22 xx xx xx jsl ~~k_prints
|
|||
|
132 ;
|
|||
|
133 ; switch (pdrv) {
|
|||
|
134 00:0053: A5 07 lda <L6+pdrv_0
|
|||
|
135 00:0055: 29 FF 00 and #$ff
|
|||
|
136 00:0058: 82 28 00 brl L10004
|
|||
|
137 ; case DEV_SDC :
|
|||
|
138 L10006:
|
|||
|
139 ; if (bios_mount(2)) {
|
|||
|
140 00:005B: F4 02 00 pea #<$2
|
|||
|
141 00:005E: 22 xx xx xx jsl ~~bios_mount
|
|||
|
142 00:0062: AA tax
|
|||
|
143 00:0063: D0 03 bne L8
|
|||
|
144 00:0065: 82 15 00 brl L10007
|
|||
|
Thu May 20 2021 21:34 Page 4
|
|||
|
|
|||
|
|
|||
|
145 L8:
|
|||
|
146 ; return STA_NOINIT;
|
|||
|
147 00:0068: A9 01 00 lda #$1
|
|||
|
148 L9:
|
|||
|
149 00:006B: A8 tay
|
|||
|
150 00:006C: A5 05 lda <L6+2
|
|||
|
151 00:006E: 85 07 sta <L6+2+2
|
|||
|
152 00:0070: A5 04 lda <L6+1
|
|||
|
153 00:0072: 85 06 sta <L6+1+2
|
|||
|
154 00:0074: 2B pld
|
|||
|
155 00:0075: 3B tsc
|
|||
|
156 00:0076: 18 clc
|
|||
|
157 00:0077: 69 05 00 adc #L6+2
|
|||
|
158 00:007A: 1B tcs
|
|||
|
159 00:007B: 98 tya
|
|||
|
160 00:007C: 6B rtl
|
|||
|
161 ; } else {
|
|||
|
162 L10007:
|
|||
|
163 ; return 0;
|
|||
|
164 00:007D: A9 00 00 lda #$0
|
|||
|
165 00:0080: 82 E8 FF brl L9
|
|||
|
166 ; }
|
|||
|
167 ; }
|
|||
|
168 L10004:
|
|||
|
169 xref ~~~swt
|
|||
|
170 00:0083: 22 xx xx xx jsl ~~~swt
|
|||
|
171 00:0087: 01 00 dw 1
|
|||
|
172 00:0089: 00 00 dw 0
|
|||
|
173 00:008B: xx xx dw L10006-1
|
|||
|
174 00:008D: xx xx dw L10005-1
|
|||
|
175 L10005:
|
|||
|
176 ; return STA_NOINIT;
|
|||
|
177 00:008F: A9 01 00 lda #$1
|
|||
|
178 00:0092: 82 D6 FF brl L9
|
|||
|
179 ;}
|
|||
|
180 00000003 L6 equ 3
|
|||
|
181 00000001 L7 equ 1
|
|||
|
182 ends
|
|||
|
183 efunc
|
|||
|
184 data
|
|||
|
185 L5:
|
|||
|
186 00:000D: 64 69 73 6B db $64,$69,$73,$6B,$5F,$69,$6E,$69,$74,$69,
|
|||
|
$61,$6C,$69,$7A,$65
|
|||
|
00:0011: 5F 69 6E 69
|
|||
|
00:0015: 74 69 61 6C
|
|||
|
00:0019: 69 7A 65
|
|||
|
187 00:001C: 0D 00 db $0D,$00
|
|||
|
188 00:001E: ends
|
|||
|
189 ;
|
|||
|
190 ;
|
|||
|
191 ;
|
|||
|
192 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
193 ;/* Read Sector(s)
|
|||
|
*/
|
|||
|
194 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
195 ;
|
|||
|
Thu May 20 2021 21:34 Page 5
|
|||
|
|
|||
|
|
|||
|
196 ;DRESULT disk_read (
|
|||
|
197 ; BYTE pdrv, /* Physical drive nmuber
|
|||
|
to identify the drive */
|
|||
|
198 ; BYTE *buff, /* Data buffer to store
|
|||
|
read data */
|
|||
|
199 ; LBA_t sector, /* Start sector in LBA */
|
|||
|
200 ; UINT count /* Number of sectors to
|
|||
|
read */
|
|||
|
201 ;)
|
|||
|
202 ;{
|
|||
|
203 code
|
|||
|
204 xdef ~~disk_read
|
|||
|
205 func
|
|||
|
206 ~~disk_read:
|
|||
|
207 longa on
|
|||
|
208 longi on
|
|||
|
209 00:0095: 3B tsc
|
|||
|
210 00:0096: 38 sec
|
|||
|
211 00:0097: E9 04 00 sbc #L11
|
|||
|
212 00:009A: 1B tcs
|
|||
|
213 00:009B: 0B phd
|
|||
|
214 00:009C: 5B tcd
|
|||
|
215 00000004 pdrv_0 set 4
|
|||
|
216 00000006 buff_0 set 6
|
|||
|
217 0000000A sector_0 set 10
|
|||
|
218 0000000E count_0 set 14
|
|||
|
219 ; DRESULT res;
|
|||
|
220 ; int result;
|
|||
|
221 ;
|
|||
|
222 ; k_prints("disk_read\r");
|
|||
|
223 00000000 res_1 set 0
|
|||
|
224 00000002 result_1 set 2
|
|||
|
225 00:009D: F4 xx xx pea #^L10
|
|||
|
226 00:00A0: F4 xx xx pea #<L10
|
|||
|
227 00:00A3: 22 xx xx xx jsl ~~k_prints
|
|||
|
228 ;
|
|||
|
229 ; switch (pdrv) {
|
|||
|
230 00:00A7: A5 08 lda <L11+pdrv_0
|
|||
|
231 00:00A9: 29 FF 00 and #$ff
|
|||
|
232 00:00AC: 82 21 00 brl L10008
|
|||
|
233 ; case DEV_SDC:
|
|||
|
234 L10010:
|
|||
|
235 ; // translate the arguments here
|
|||
|
236 ;
|
|||
|
237 ; return bios_getblock(2, sector, buff);
|
|||
|
238 00:00AF: D4 0C pei <L11+buff_0+2
|
|||
|
239 00:00B1: D4 0A pei <L11+buff_0
|
|||
|
240 00:00B3: D4 10 pei <L11+sector_0+2
|
|||
|
241 00:00B5: D4 0E pei <L11+sector_0
|
|||
|
242 00:00B7: F4 02 00 pea #<$2
|
|||
|
243 00:00BA: 22 xx xx xx jsl ~~bios_getblock
|
|||
|
244 L13:
|
|||
|
245 00:00BE: A8 tay
|
|||
|
246 00:00BF: A5 06 lda <L11+2
|
|||
|
247 00:00C1: 85 12 sta <L11+2+12
|
|||
|
248 00:00C3: A5 05 lda <L11+1
|
|||
|
249 00:00C5: 85 11 sta <L11+1+12
|
|||
|
250 00:00C7: 2B pld
|
|||
|
Thu May 20 2021 21:34 Page 6
|
|||
|
|
|||
|
|
|||
|
251 00:00C8: 3B tsc
|
|||
|
252 00:00C9: 18 clc
|
|||
|
253 00:00CA: 69 10 00 adc #L11+12
|
|||
|
254 00:00CD: 1B tcs
|
|||
|
255 00:00CE: 98 tya
|
|||
|
256 00:00CF: 6B rtl
|
|||
|
257 ; }
|
|||
|
258 L10008:
|
|||
|
259 xref ~~~swt
|
|||
|
260 00:00D0: 22 xx xx xx jsl ~~~swt
|
|||
|
261 00:00D4: 01 00 dw 1
|
|||
|
262 00:00D6: 00 00 dw 0
|
|||
|
263 00:00D8: xx xx dw L10010-1
|
|||
|
264 00:00DA: xx xx dw L10009-1
|
|||
|
265 L10009:
|
|||
|
266 ;
|
|||
|
267 ; return RES_PARERR;
|
|||
|
268 00:00DC: A9 04 00 lda #$4
|
|||
|
269 00:00DF: 82 DC FF brl L13
|
|||
|
270 ;}
|
|||
|
271 00000004 L11 equ 4
|
|||
|
272 00000001 L12 equ 1
|
|||
|
273 ends
|
|||
|
274 efunc
|
|||
|
275 data
|
|||
|
276 L10:
|
|||
|
277 00:001E: 64 69 73 6B db $64,$69,$73,$6B,$5F,$72,$65,$61,$64,$0D,
|
|||
|
$00
|
|||
|
00:0022: 5F 72 65 61
|
|||
|
00:0026: 64 0D 00
|
|||
|
278 00:0029: ends
|
|||
|
279 ;
|
|||
|
280 ;
|
|||
|
281 ;
|
|||
|
282 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
283 ;/* Write Sector(s)
|
|||
|
*/
|
|||
|
284 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
285 ;
|
|||
|
286 ;#if FF_FS_READONLY == 0
|
|||
|
287 ;
|
|||
|
288 ;DRESULT disk_write (
|
|||
|
289 ; BYTE pdrv, /* Physical driv
|
|||
|
e nmuber to identify the drive */
|
|||
|
290 ; const BYTE *buff, /* Data to be written */
|
|||
|
291 ; LBA_t sector, /* Start sector in LBA *
|
|||
|
/
|
|||
|
292 ; UINT count /* Number of sec
|
|||
|
tors to write */
|
|||
|
293 ;)
|
|||
|
294 ;{
|
|||
|
295 code
|
|||
|
296 xdef ~~disk_write
|
|||
|
297 func
|
|||
|
298 ~~disk_write:
|
|||
|
299 longa on
|
|||
|
Thu May 20 2021 21:34 Page 7
|
|||
|
|
|||
|
|
|||
|
300 longi on
|
|||
|
301 00:00E2: 3B tsc
|
|||
|
302 00:00E3: 38 sec
|
|||
|
303 00:00E4: E9 04 00 sbc #L15
|
|||
|
304 00:00E7: 1B tcs
|
|||
|
305 00:00E8: 0B phd
|
|||
|
306 00:00E9: 5B tcd
|
|||
|
307 00000004 pdrv_0 set 4
|
|||
|
308 00000006 buff_0 set 6
|
|||
|
309 0000000A sector_0 set 10
|
|||
|
310 0000000E count_0 set 14
|
|||
|
311 ; DRESULT res;
|
|||
|
312 ; int result;
|
|||
|
313 ;
|
|||
|
314 ; k_prints("disk_write\r");
|
|||
|
315 00000000 res_1 set 0
|
|||
|
316 00000002 result_1 set 2
|
|||
|
317 00:00EA: F4 xx xx pea #^L14
|
|||
|
318 00:00ED: F4 xx xx pea #<L14
|
|||
|
319 00:00F0: 22 xx xx xx jsl ~~k_prints
|
|||
|
320 ;
|
|||
|
321 ; switch (pdrv) {
|
|||
|
322 00:00F4: A5 08 lda <L15+pdrv_0
|
|||
|
323 00:00F6: 29 FF 00 and #$ff
|
|||
|
324 00:00F9: 82 15 00 brl L10011
|
|||
|
325 ; case DEV_SDC:
|
|||
|
326 L10013:
|
|||
|
327 ; // translate the arguments here
|
|||
|
328 ;
|
|||
|
329 ;
|
|||
|
330 ; // translate the reslut code here
|
|||
|
331 ;
|
|||
|
332 ; return 0;
|
|||
|
333 00:00FC: A9 00 00 lda #$0
|
|||
|
334 L17:
|
|||
|
335 00:00FF: A8 tay
|
|||
|
336 00:0100: A5 06 lda <L15+2
|
|||
|
337 00:0102: 85 12 sta <L15+2+12
|
|||
|
338 00:0104: A5 05 lda <L15+1
|
|||
|
339 00:0106: 85 11 sta <L15+1+12
|
|||
|
340 00:0108: 2B pld
|
|||
|
341 00:0109: 3B tsc
|
|||
|
342 00:010A: 18 clc
|
|||
|
343 00:010B: 69 10 00 adc #L15+12
|
|||
|
344 00:010E: 1B tcs
|
|||
|
345 00:010F: 98 tya
|
|||
|
346 00:0110: 6B rtl
|
|||
|
347 ; }
|
|||
|
348 L10011:
|
|||
|
349 xref ~~~swt
|
|||
|
350 00:0111: 22 xx xx xx jsl ~~~swt
|
|||
|
351 00:0115: 01 00 dw 1
|
|||
|
352 00:0117: 00 00 dw 0
|
|||
|
353 00:0119: xx xx dw L10013-1
|
|||
|
354 00:011B: xx xx dw L10012-1
|
|||
|
355 L10012:
|
|||
|
356 ;
|
|||
|
357 ; return RES_PARERR;
|
|||
|
Thu May 20 2021 21:34 Page 8
|
|||
|
|
|||
|
|
|||
|
358 00:011D: A9 04 00 lda #$4
|
|||
|
359 00:0120: 82 DC FF brl L17
|
|||
|
360 ;}
|
|||
|
361 00000004 L15 equ 4
|
|||
|
362 00000001 L16 equ 1
|
|||
|
363 ends
|
|||
|
364 efunc
|
|||
|
365 data
|
|||
|
366 L14:
|
|||
|
367 00:0029: 64 69 73 6B db $64,$69,$73,$6B,$5F,$77,$72,$69,$74,$65,
|
|||
|
$0D,$00
|
|||
|
00:002D: 5F 77 72 69
|
|||
|
00:0031: 74 65 0D 00
|
|||
|
368 00:0035: ends
|
|||
|
369 ;
|
|||
|
370 ;#endif
|
|||
|
371 ;
|
|||
|
372 ;
|
|||
|
373 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
374 ;/* Miscellaneous Functions
|
|||
|
*/
|
|||
|
375 ;/*-----------------------------------------------
|
|||
|
------------------------*/
|
|||
|
376 ;
|
|||
|
377 ;DRESULT disk_ioctl (
|
|||
|
378 ; BYTE pdrv, /* Physical drive nmuber
|
|||
|
(0..) */
|
|||
|
379 ; BYTE cmd, /* Control code */
|
|||
|
380 ; void *buff /* Buffer to send/receiv
|
|||
|
e control data */
|
|||
|
381 ;)
|
|||
|
382 ;{
|
|||
|
383 code
|
|||
|
384 xdef ~~disk_ioctl
|
|||
|
385 func
|
|||
|
386 ~~disk_ioctl:
|
|||
|
387 longa on
|
|||
|
388 longi on
|
|||
|
389 00:0123: 3B tsc
|
|||
|
390 00:0124: 38 sec
|
|||
|
391 00:0125: E9 04 00 sbc #L19
|
|||
|
392 00:0128: 1B tcs
|
|||
|
393 00:0129: 0B phd
|
|||
|
394 00:012A: 5B tcd
|
|||
|
395 00000004 pdrv_0 set 4
|
|||
|
396 00000006 cmd_0 set 6
|
|||
|
397 00000008 buff_0 set 8
|
|||
|
398 ; DRESULT res;
|
|||
|
399 ; int result;
|
|||
|
400 ;
|
|||
|
401 ; k_prints("disk_ioctl\r");
|
|||
|
402 00000000 res_1 set 0
|
|||
|
403 00000002 result_1 set 2
|
|||
|
404 00:012B: F4 xx xx pea #^L18
|
|||
|
405 00:012E: F4 xx xx pea #<L18
|
|||
|
406 00:0131: 22 xx xx xx jsl ~~k_prints
|
|||
|
407 ;
|
|||
|
Thu May 20 2021 21:34 Page 9
|
|||
|
|
|||
|
|
|||
|
408 ; switch (pdrv) {
|
|||
|
409 00:0135: A5 08 lda <L19+pdrv_0
|
|||
|
410 00:0137: 29 FF 00 and #$ff
|
|||
|
411 00:013A: 82 15 00 brl L10014
|
|||
|
412 ; case DEV_SDC:
|
|||
|
413 L10016:
|
|||
|
414 ;
|
|||
|
415 ; // Process of the command for the RAM dr
|
|||
|
ive
|
|||
|
416 ;
|
|||
|
417 ; return 0;
|
|||
|
418 00:013D: A9 00 00 lda #$0
|
|||
|
419 L21:
|
|||
|
420 00:0140: A8 tay
|
|||
|
421 00:0141: A5 06 lda <L19+2
|
|||
|
422 00:0143: 85 0E sta <L19+2+8
|
|||
|
423 00:0145: A5 05 lda <L19+1
|
|||
|
424 00:0147: 85 0D sta <L19+1+8
|
|||
|
425 00:0149: 2B pld
|
|||
|
426 00:014A: 3B tsc
|
|||
|
427 00:014B: 18 clc
|
|||
|
428 00:014C: 69 0C 00 adc #L19+8
|
|||
|
429 00:014F: 1B tcs
|
|||
|
430 00:0150: 98 tya
|
|||
|
431 00:0151: 6B rtl
|
|||
|
432 ; }
|
|||
|
433 L10014:
|
|||
|
434 xref ~~~swt
|
|||
|
435 00:0152: 22 xx xx xx jsl ~~~swt
|
|||
|
436 00:0156: 01 00 dw 1
|
|||
|
437 00:0158: 00 00 dw 0
|
|||
|
438 00:015A: xx xx dw L10016-1
|
|||
|
439 00:015C: xx xx dw L10015-1
|
|||
|
440 L10015:
|
|||
|
441 ;
|
|||
|
442 ; return RES_PARERR;
|
|||
|
443 00:015E: A9 04 00 lda #$4
|
|||
|
444 00:0161: 82 DC FF brl L21
|
|||
|
445 ;}
|
|||
|
446 00000004 L19 equ 4
|
|||
|
447 00000001 L20 equ 1
|
|||
|
448 ends
|
|||
|
449 efunc
|
|||
|
450 data
|
|||
|
451 L18:
|
|||
|
452 00:0035: 64 69 73 6B db $64,$69,$73,$6B,$5F,$69,$6F,$63,$74,$6C,
|
|||
|
$0D,$00
|
|||
|
00:0039: 5F 69 6F 63
|
|||
|
00:003D: 74 6C 0D 00
|
|||
|
453 00:0041: ends
|
|||
|
454 ;
|
|||
|
455 ;#define BIOS_STATUS ((volatile char *)0x000320)
|
|||
|
456 ;#define BIOS_DEV ((volatile char *)0x000321)
|
|||
|
457 ;#define BIOS_LBA ((volatile long *)0x000322)
|
|||
|
458 ;#define BIOS_BUFFER ((volatile long *)0x000326)
|
|||
|
459 ;
|
|||
|
460 ;/**
|
|||
|
461 ; * Call the C256 F_MOUNT kernel routine
|
|||
|
Thu May 20 2021 21:34 Page 10
|
|||
|
|
|||
|
|
|||
|
462 ; */
|
|||
|
463 ;int bios_mount(char dev) {
|
|||
|
464 code
|
|||
|
465 xdef ~~bios_mount
|
|||
|
466 func
|
|||
|
467 ~~bios_mount:
|
|||
|
468 longa on
|
|||
|
469 longi on
|
|||
|
470 00:0164: 3B tsc
|
|||
|
471 00:0165: 38 sec
|
|||
|
472 00:0166: E9 00 00 sbc #L23
|
|||
|
473 00:0169: 1B tcs
|
|||
|
474 00:016A: 0B phd
|
|||
|
475 00:016B: 5B tcd
|
|||
|
476 00000004 dev_0 set 4
|
|||
|
477 ; asm {
|
|||
|
478 ; LDA %%dev
|
|||
|
479 ; jsl $001128
|
|||
|
480 ; }
|
|||
|
481 asmstart
|
|||
|
482 00:016C: A5 04 LDA <L23+dev_0
|
|||
|
483 00:016E: 22 28 11 00 jsl $001128
|
|||
|
484 asmend
|
|||
|
485 ;
|
|||
|
486 ; if ((*BIOS_STATUS & 0x80) != 0) {
|
|||
|
487 00:0172: E2 20 sep #$20
|
|||
|
488 longa off
|
|||
|
489 00:0174: AF 20 03 00 lda >800 ; volatile
|
|||
|
490 00:0178: 29 80 and #<$80
|
|||
|
491 00:017A: C2 20 rep #$20
|
|||
|
492 longa on
|
|||
|
493 00:017C: D0 03 bne L25
|
|||
|
494 00:017E: 82 15 00 brl L10017
|
|||
|
495 L25:
|
|||
|
496 ; return RES_ERROR;
|
|||
|
497 00:0181: A9 01 00 lda #$1
|
|||
|
498 L26:
|
|||
|
499 00:0184: A8 tay
|
|||
|
500 00:0185: A5 02 lda <L23+2
|
|||
|
501 00:0187: 85 04 sta <L23+2+2
|
|||
|
502 00:0189: A5 01 lda <L23+1
|
|||
|
503 00:018B: 85 03 sta <L23+1+2
|
|||
|
504 00:018D: 2B pld
|
|||
|
505 00:018E: 3B tsc
|
|||
|
506 00:018F: 18 clc
|
|||
|
507 00:0190: 69 02 00 adc #L23+2
|
|||
|
508 00:0193: 1B tcs
|
|||
|
509 00:0194: 98 tya
|
|||
|
510 00:0195: 6B rtl
|
|||
|
511 ; } else {
|
|||
|
512 L10017:
|
|||
|
513 ; return RES_OK;
|
|||
|
514 00:0196: A9 00 00 lda #$0
|
|||
|
515 00:0199: 82 E8 FF brl L26
|
|||
|
516 ; }
|
|||
|
517 ;}
|
|||
|
518 00000000 L23 equ 0
|
|||
|
519 00000001 L24 equ 1
|
|||
|
Thu May 20 2021 21:34 Page 11
|
|||
|
|
|||
|
|
|||
|
520 ends
|
|||
|
521 efunc
|
|||
|
522 ;
|
|||
|
523 ;/**
|
|||
|
524 ; * Call the C256 GETBLOCK kernel routine
|
|||
|
525 ; */
|
|||
|
526 ;int bios_getblock(char dev, long lba, char * buff
|
|||
|
er) {
|
|||
|
527 code
|
|||
|
528 xdef ~~bios_getblock
|
|||
|
529 func
|
|||
|
530 ~~bios_getblock:
|
|||
|
531 longa on
|
|||
|
532 longi on
|
|||
|
533 00:019C: 3B tsc
|
|||
|
534 00:019D: 38 sec
|
|||
|
535 00:019E: E9 04 00 sbc #L27
|
|||
|
536 00:01A1: 1B tcs
|
|||
|
537 00:01A2: 0B phd
|
|||
|
538 00:01A3: 5B tcd
|
|||
|
539 00000004 dev_0 set 4
|
|||
|
540 00000006 lba_0 set 6
|
|||
|
541 0000000A buffer_0 set 10
|
|||
|
542 ; *BIOS_DEV = dev;
|
|||
|
543 00:01A4: E2 20 sep #$20
|
|||
|
544 longa off
|
|||
|
545 00:01A6: A5 08 lda <L27+dev_0
|
|||
|
546 00:01A8: 8F 21 03 00 sta >801 ; volatile
|
|||
|
547 00:01AC: C2 20 rep #$20
|
|||
|
548 longa on
|
|||
|
549 ; *BIOS_LBA = lba;
|
|||
|
550 00:01AE: A5 0A lda <L27+lba_0
|
|||
|
551 00:01B0: 8F 22 03 00 sta >802 ; volatile
|
|||
|
552 00:01B4: A5 0C lda <L27+lba_0+2
|
|||
|
553 00:01B6: 8F 24 03 00 sta >802+2 ; volatile
|
|||
|
554 ; *BIOS_BUFFER = (long)buffer;
|
|||
|
555 00:01BA: A5 0E lda <L27+buffer_0
|
|||
|
556 00:01BC: 8F 26 03 00 sta >806 ; volatile
|
|||
|
557 00:01C0: A5 10 lda <L27+buffer_0+2
|
|||
|
558 00:01C2: 8F 28 03 00 sta >806+2 ; volatile
|
|||
|
559 ; k_prints("getblock: ");
|
|||
|
560 00:01C6: F4 xx xx pea #^L22
|
|||
|
561 00:01C9: F4 xx xx pea #<L22
|
|||
|
562 00:01CC: 22 xx xx xx jsl ~~k_prints
|
|||
|
563 ; k_printh(dev);
|
|||
|
564 00:01D0: A5 08 lda <L27+dev_0
|
|||
|
565 00:01D2: 29 FF 00 and #$ff
|
|||
|
566 00:01D5: 48 pha
|
|||
|
567 00:01D6: 22 xx xx xx jsl ~~k_printh
|
|||
|
568 ; k_prints(" ");
|
|||
|
569 00:01DA: F4 xx xx pea #^L22+11
|
|||
|
570 00:01DD: F4 xx xx pea #<L22+11
|
|||
|
571 00:01E0: 22 xx xx xx jsl ~~k_prints
|
|||
|
572 ; k_printh(lba >> 16);
|
|||
|
573 00:01E4: D4 0C pei <L27+lba_0+2
|
|||
|
574 00:01E6: D4 0A pei <L27+lba_0
|
|||
|
575 00:01E8: A9 10 00 lda #$10
|
|||
|
576 xref ~~~lasr
|
|||
|
Thu May 20 2021 21:34 Page 12
|
|||
|
|
|||
|
|
|||
|
577 00:01EB: 22 xx xx xx jsl ~~~lasr
|
|||
|
578 00:01EF: 85 01 sta <R0
|
|||
|
579 00:01F1: 86 03 stx <R0+2
|
|||
|
580 00:01F3: D4 03 pei <R0+2
|
|||
|
581 00:01F5: D4 01 pei <R0
|
|||
|
582 00:01F7: 22 xx xx xx jsl ~~k_printh
|
|||
|
583 ; k_printh(lba & 0xffff);
|
|||
|
584 00:01FB: A5 0A lda <L27+lba_0
|
|||
|
585 00:01FD: 85 01 sta <R0
|
|||
|
586 00:01FF: 64 03 stz <R0+2
|
|||
|
587 00:0201: D4 03 pei <R0+2
|
|||
|
588 00:0203: D4 01 pei <R0
|
|||
|
589 00:0205: 22 xx xx xx jsl ~~k_printh
|
|||
|
590 ; asm {
|
|||
|
591 ; jsl $001044
|
|||
|
592 ; };
|
|||
|
593 asmstart
|
|||
|
594 00:0209: 22 44 10 00 jsl $001044
|
|||
|
595 asmend
|
|||
|
596 ;
|
|||
|
597 ; if ((*BIOS_STATUS & 0x80) != 0) {
|
|||
|
598 00:020D: E2 20 sep #$20
|
|||
|
599 longa off
|
|||
|
600 00:020F: AF 20 03 00 lda >800 ; volatile
|
|||
|
601 00:0213: 29 80 and #<$80
|
|||
|
602 00:0215: C2 20 rep #$20
|
|||
|
603 longa on
|
|||
|
604 00:0217: D0 03 bne L29
|
|||
|
605 00:0219: 82 36 00 brl L10018
|
|||
|
606 L29:
|
|||
|
607 ; k_prints(" Error: ");
|
|||
|
608 00:021C: F4 xx xx pea #^L22+13
|
|||
|
609 00:021F: F4 xx xx pea #<L22+13
|
|||
|
610 00:0222: 22 xx xx xx jsl ~~k_prints
|
|||
|
611 ; k_printh(*BIOS_STATUS);
|
|||
|
612 00:0226: E2 20 sep #$20
|
|||
|
613 longa off
|
|||
|
614 00:0228: AF 20 03 00 lda >800 ; volatile
|
|||
|
615 00:022C: C2 20 rep #$20
|
|||
|
616 longa on
|
|||
|
617 00:022E: 29 FF 00 and #$ff
|
|||
|
618 00:0231: 48 pha
|
|||
|
619 00:0232: 22 xx xx xx jsl ~~k_printh
|
|||
|
620 ; k_putc('\r');
|
|||
|
621 00:0236: F4 0D 00 pea #<$d
|
|||
|
622 00:0239: 22 xx xx xx jsl ~~k_putc
|
|||
|
623 ; return RES_ERROR;
|
|||
|
624 00:023D: A9 01 00 lda #$1
|
|||
|
625 L30:
|
|||
|
626 00:0240: A8 tay
|
|||
|
627 00:0241: A5 06 lda <L27+2
|
|||
|
628 00:0243: 85 10 sta <L27+2+10
|
|||
|
629 00:0245: A5 05 lda <L27+1
|
|||
|
630 00:0247: 85 0F sta <L27+1+10
|
|||
|
631 00:0249: 2B pld
|
|||
|
632 00:024A: 3B tsc
|
|||
|
633 00:024B: 18 clc
|
|||
|
634 00:024C: 69 0E 00 adc #L27+10
|
|||
|
Thu May 20 2021 21:34 Page 13
|
|||
|
|
|||
|
|
|||
|
635 00:024F: 1B tcs
|
|||
|
636 00:0250: 98 tya
|
|||
|
637 00:0251: 6B rtl
|
|||
|
638 ; } else {
|
|||
|
639 L10018:
|
|||
|
640 ; k_prints(" OK\r");
|
|||
|
641 00:0252: F4 xx xx pea #^L22+22
|
|||
|
642 00:0255: F4 xx xx pea #<L22+22
|
|||
|
643 00:0258: 22 xx xx xx jsl ~~k_prints
|
|||
|
644 ; return RES_OK;
|
|||
|
645 00:025C: A9 00 00 lda #$0
|
|||
|
646 00:025F: 82 DE FF brl L30
|
|||
|
647 ; }
|
|||
|
648 ;}
|
|||
|
649 00000004 L27 equ 4
|
|||
|
650 00000005 L28 equ 5
|
|||
|
651 ends
|
|||
|
652 efunc
|
|||
|
653 data
|
|||
|
654 L22:
|
|||
|
655 00:0041: 67 65 74 62 db $67,$65,$74,$62,$6C,$6F,$63,$6B,$3A,$20,
|
|||
|
$00,$20,$00,$20,$45
|
|||
|
00:0045: 6C 6F 63 6B
|
|||
|
00:0049: 3A 20 00 20
|
|||
|
00:004D: 00 20 45
|
|||
|
656 00:0050: 72 72 6F 72 db $72,$72,$6F,$72,$3A,$20,$00,$20,$4F,$4B,
|
|||
|
$0D,$00
|
|||
|
00:0054: 3A 20 00 20
|
|||
|
00:0058: 4F 4B 0D 00
|
|||
|
657 00:005C: ends
|
|||
|
658 ;
|
|||
|
659 ;/**
|
|||
|
660 ; * Call the C256 PUTBLOCK kernel routine
|
|||
|
661 ; */
|
|||
|
662 ;// int bios_putblock(char dev, long lba, char * b
|
|||
|
uffer) {
|
|||
|
663 ;// *BIOS_DEV = dev;
|
|||
|
664 ;// *BIOS_LBA = lba;
|
|||
|
665 ;// *BIOS_BUFFER = (long)buffer;
|
|||
|
666 ;// asm {
|
|||
|
667 ;// jsl $001024
|
|||
|
668 ;// };
|
|||
|
669 ;
|
|||
|
670 ;// if (*BIOS_STATUS != 0) {
|
|||
|
671 ;// return RES_ERROR;
|
|||
|
672 ;// } else {
|
|||
|
673 ;// return RES_OK;
|
|||
|
674 ;// }
|
|||
|
675 ;// }
|
|||
|
676 ;
|
|||
|
677 xref ~~k_putc
|
|||
|
678 xref ~~k_printh
|
|||
|
679 xref ~~k_prints
|
|||
|
680 end
|
|||
|
|
|||
|
|
|||
|
Lines assembled: 680
|
|||
|
Errors: 0
|
|||
|
Thu May 20 2021 21:34 Page 14
|
|||
|
|
|||
|
|