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 #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 801 ; volatile 547 00:01AC: C2 20 rep #$20 548 longa on 549 ; *BIOS_LBA = lba; 550 00:01AE: A5 0A lda 802 ; volatile 552 00:01B4: A5 0C lda 802+2 ; volatile 554 ; *BIOS_BUFFER = (long)buffer; 555 00:01BA: A5 0E lda 806 ; volatile 557 00:01C0: A5 10 lda 806+2 ; volatile 559 ; k_prints("getblock: "); 560 00:01C6: F4 xx xx pea #^L22 561 00:01C9: F4 xx xx pea #> 16); 573 00:01E4: D4 0C pei 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 #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