;--------------------------------------------------------
; File Created by SDCC : free open source ISO C Compiler 
; Version 4.4.0 #14620 (MINGW32)
;--------------------------------------------------------
	.module fat
	.optsdcc -mz80
	
;--------------------------------------------------------
; Public variables in this module
;--------------------------------------------------------
	.globl _main
	.globl _Info
	.globl _MakeDir
	.globl _Delete
	.globl _Rename
	.globl _Copy
	.globl _CpmCopy
	.globl _FatCopy
	.globl _CopyFile
	.globl _Dir
	.globl _DirLine
	.globl _Write
	.globl _Read
	.globl _Close
	.globl _Open
	.globl _DeleteFile
	.globl _Exists
	.globl _DumpFCB
	.globl _MakeFCB
	.globl _IsValidFilenameChar
	.globl _FatDrive
	.globl _IsFatPath
	.globl _IsWild
	.globl _SplitPath
	.globl _Usage
	.globl _Error
	.globl _Confirm
	.globl _strupr
	.globl _disk_ioctl
	.globl _disk_initialize
	.globl _f_mount
	.globl _f_stat
	.globl _f_rename
	.globl _f_unlink
	.globl _f_mkdir
	.globl _f_findnext
	.globl _f_findfirst
	.globl _f_write
	.globl _f_read
	.globl _f_close
	.globl _f_open
	.globl _bdoscall
	.globl _toupper
	.globl _strlen
	.globl _strtok
	.globl _strcmp
	.globl _strncat
	.globl _getchar
	.globl _puts
	.globl _printf
	.globl _atoi
	.globl _ErrTab
	.globl _bios_id
;--------------------------------------------------------
; special function registers
;--------------------------------------------------------
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
	.area _DATA
_bios_id::
	.ds 2
;--------------------------------------------------------
; ram data
;--------------------------------------------------------
	.area _INITIALIZED
_ErrTab::
	.ds 40
;--------------------------------------------------------
; absolute external ram data
;--------------------------------------------------------
	.area _DABS (ABS)
;--------------------------------------------------------
; global & static initialisations
;--------------------------------------------------------
	.area _HOME
	.area _GSINIT
	.area _GSFINAL
	.area _GSINIT
;--------------------------------------------------------
; Home
;--------------------------------------------------------
	.area _HOME
	.area _HOME
;--------------------------------------------------------
; code
;--------------------------------------------------------
	.area _CODE
;fat.c:88: char * strupr(char * str)
;	---------------------------------
; Function strupr
; ---------------------------------
_strupr::
	ex	de, hl
;fat.c:92: for (s = str; *s; s++)
	ld	c, e
	ld	b, d
00103$:
	ld	a, (bc)
	or	a, a
	ret	Z
;fat.c:93: *s = toupper(*s);
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	push	bc
	push	de
	call	_toupper
	ex	de, hl
	pop	de
	pop	bc
	ld	a, l
	ld	(bc), a
;fat.c:92: for (s = str; *s; s++)
	inc	bc
;fat.c:95: return str;
;fat.c:96: }
	jr	00103$
;fat.c:98: int Confirm(void)
;	---------------------------------
; Function Confirm
; ---------------------------------
_Confirm::
;fat.c:102: do
00104$:
;fat.c:103: c = getchar();
	call	_getchar
;fat.c:104: while ((c != 'y') && (c != 'Y') && (c != 'N') && (c != 'n'));
	ld	a, e
	sub	a, #0x79
	ld	a, #0x01
	jr	Z, 00155$
	xor	a, a
00155$:
	ld	c, a
	ld	a, e
	sub	a, #0x59
	ld	a, #0x01
	jr	Z, 00157$
	xor	a, a
00157$:
	ld	b, a
	bit	0, c
	jr	NZ, 00106$
	bit	0, b
	jr	NZ, 00106$
	ld	a,e
	cp	a,#0x4e
	jr	Z, 00106$
	sub	a, #0x6e
	jr	NZ, 00104$
00106$:
;fat.c:106: return ((c == 'y') || (c == 'Y'));
	bit	0, c
	jr	NZ, 00110$
	bit	0, b
	ld	e, #0x00
	jr	Z, 00111$
00110$:
	ld	e, #0x01
00111$:
	ld	d, #0x00
;fat.c:107: }
	ret
;fat.c:109: int Error(FRESULT fr)
;	---------------------------------
; Function Error
; ---------------------------------
_Error::
;fat.c:111: printf("\n\nError: %s\n", ErrTab[fr]);
	ld	l, a
	ld	bc, #_ErrTab+0
;	spillPairReg hl
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	add	hl, hl
	add	hl, bc
	ld	c, (hl)
	inc	hl
	ld	b, (hl)
	push	bc
	ld	hl, #___str_0
	push	hl
	call	_printf
	pop	af
	pop	af
;fat.c:113: return 8;
	ld	de, #0x0008
;fat.c:114: }
	ret
___str_0:
	.db 0x0a
	.db 0x0a
	.ascii "Error: %s"
	.db 0x0a
	.db 0x00
;fat.c:116: int Usage(void)
;	---------------------------------
; Function Usage
; ---------------------------------
_Usage::
;fat.c:137: );
	ld	hl, #___str_2
	call	_puts
;fat.c:139: return 4;
	ld	de, #0x0004
;fat.c:140: }
	ret
___str_2:
	.db 0x0a
	.ascii "CP/M FAT Microbee Utility v2.0, 11-July-2024"
	.db 0x0a
	.ascii "Copyright (C) 2019-24, Wayne Warthen, GNU GPL v3"
	.db 0x0a
	.ascii "Copyright (C) 2022, FatFs, ChaN"
	.db 0x0a
	.ascii "Copyright (C) https://www.fuzix.org/, LGPL"
	.db 0x0a
	.ascii "Microbee modifications (C) 2024, Rod Egan, GNU GPL v3"
	.db 0x0a
	.db 0x0a
	.ascii "Usage: FAT <cmd> <parms>"
	.db 0x0a
	.ascii "  FAT DIR <path>"
	.db 0x0a
	.ascii "  FAT COPY <src> <dst>"
	.db 0x0a
	.ascii "  FAT REN <from> <to>"
	.db 0x0a
	.ascii "  FAT DEL <path>[<file>|<dir>]"
	.db 0x0a
	.ascii "  FAT MD <path>"
	.db 0x0a
	.ascii "  FAT INFO"
	.db 0x0a
	.db 0x0a
	.ascii "CP/M filespec: <d>:FILENAME.EXT (<d> is CP/M drive letter A-"
	.ascii "P)"
	.db 0x0a
	.ascii "FAT filespec:  <u>:/DIR/FILENAME.EXT (<u> is disk unit # 0)"
	.db 0x00
;fat.c:142: FRESULT SplitPath(char * szPath, char * szFileSpec)
;	---------------------------------
; Function SplitPath
; ---------------------------------
_SplitPath::
	push	ix
	ld	ix,#0
	add	ix,sp
	push	af
	push	af
	ld	-2 (ix), l
	ld	-1 (ix), h
	inc	sp
	inc	sp
	pop	hl
	push	hl
	push	de
	call	_strlen
	ld	a, e
	add	a, -2 (ix)
	ld	e, a
	ld	a, d
	adc	a, -1 (ix)
	ld	d, a
;fat.c:148: while ((p >= szPath) && (*p != '/') && (*p != '\\') && (*p != ':'))
00104$:
	ld	a, e
	sub	a, -2 (ix)
	ld	a, d
	sbc	a, -1 (ix)
	jr	C, 00121$
	ld	a, (de)
	cp	a, #0x2f
	jr	Z, 00121$
	cp	a, #0x5c
	jr	Z, 00121$
	sub	a, #0x3a
	jr	Z, 00121$
;fat.c:149: p--;
	dec	de
	jr	00104$
00121$:
	ld	c, e
	ld	b, d
;fat.c:152: memset(szFileSpec, 0, MAX_FN + 1);
	pop	hl
	push	hl
	push	bc
	ld	b, #0x0d
00167$:
	ld	(hl), #0x00
	inc	hl
	djnz	00167$
	pop	bc
;fat.c:153: strncpy(szFileSpec, p + 1, MAX_FN);
	push	de
	pop	iy
	inc	iy
	push	bc
	push	de
	ld	e, -4 (ix)
	ld	d, -3 (ix)
	push	iy
	pop	hl
	ld	bc, #0x000c
	xor	a, a
00170$:
	cp	a,(hl)
	ldi
	jp	PO, 00169$
	jr	NZ, 00170$
00171$:
	dec	hl
	ldi
	jp	PE, 00171$
00169$:
	pop	de
	pop	bc
;fat.c:155: if (p >= szPath)
	ld	a, c
	sub	a, -2 (ix)
	ld	a, b
	sbc	a, -1 (ix)
	jr	C, 00110$
;fat.c:157: if (*p == ':')
	ld	a, (de)
	sub	a, #0x3a
	jr	NZ, 00111$
;fat.c:158: p++;
	push	iy
	pop	bc
	jr	00111$
00110$:
;fat.c:161: p++;
	push	iy
	pop	bc
00111$:
;fat.c:163: *p = '\0';		// truncate path
	xor	a, a
	ld	(bc), a
;fat.c:169: return FR_OK;
	xor	a, a
;fat.c:170: }
	ld	sp, ix
	pop	ix
	ret
;fat.c:172: int IsWild(char * szPath)
;	---------------------------------
; Function IsWild
; ---------------------------------
_IsWild::
;fat.c:176: for (p = szPath; *p != '\0'; p++)
00106$:
	ld	a, (hl)
	or	a, a
	jr	Z, 00104$
;fat.c:177: if ((*p == '*') || (*p == '?'))
	cp	a, #0x2a
	jr	Z, 00101$
	sub	a, #0x3f
	jr	NZ, 00107$
00101$:
;fat.c:178: return TRUE;
	ld	de, #0x0001
	ret
00107$:
;fat.c:176: for (p = szPath; *p != '\0'; p++)
	inc	hl
	jr	00106$
00104$:
;fat.c:180: return FALSE;
	ld	de, #0x0000
;fat.c:181: }
	ret
;fat.c:183: int IsFatPath(const TCHAR * szPath)
;	---------------------------------
; Function IsFatPath
; ---------------------------------
_IsFatPath::
;fat.c:189: while (*p != '\0')
00106$:
	ld	c, (hl)
	ld	a, c
	or	a, a
	jr	Z, 00108$
;fat.c:191: if (*p == ':')
	ld	a, c
	sub	a, #0x3a
	jr	NZ, 00102$
;fat.c:192: return TRUE;
	ld	de, #0x0001
	ret
00102$:
;fat.c:193: if ((*p < '0') || (*p > '9'))
	ld	a, c
	sub	a, #0x30
	jr	C, 00103$
	ld	a, #0x39
	sub	a, c
	jr	NC, 00104$
00103$:
;fat.c:194: return FALSE;
	ld	de, #0x0000
	ret
00104$:
;fat.c:195: p++;
	inc	hl
	jr	00106$
00108$:
;fat.c:198: return FALSE;
	ld	de, #0x0000
;fat.c:199: }
	ret
;fat.c:201: int FatDrive(char * szPath)
;	---------------------------------
; Function FatDrive
; ---------------------------------
_FatDrive::
	push	ix
	ld	ix,#0
	add	ix,sp
	ld	iy, #-9
	add	iy, sp
	ld	sp, iy
	ex	de, hl
;fat.c:207: i = 0;
	ld	bc, #0x0000
;fat.c:208: p = szPath;
	ld	-4 (ix), e
	ld	-3 (ix), d
	xor	a, a
	ld	-2 (ix), a
	ld	-1 (ix), a
00111$:
;fat.c:212: if ((*p >= '0') && (*p <= '9'))
	ld	a, (de)
	ld	-5 (ix), a
	sub	a, #0x30
	jr	C, 00107$
	ld	a, #0x39
	sub	a, -5 (ix)
	jr	C, 00107$
;fat.c:214: szDrive[i++] = *p;
	ld	a, -2 (ix)
	ld	-4 (ix), a
	ld	-3 (ix), #0x00
	inc	-2 (ix)
	jr	NZ, 00150$
	inc	-1 (ix)
00150$:
	ld	c, -2 (ix)
	ld	b, #0x00
	push	de
	ld	e, -4 (ix)
	ld	d, #0x00
	ld	hl, #2
	add	hl, sp
	add	hl, de
	pop	de
	ld	a, -5 (ix)
	ld	(hl), a
;fat.c:215: if (i >= 2)
	ld	a, -2 (ix)
	sub	a, #0x02
	ld	a, #0x00
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	C, 00108$
;fat.c:216: return -1;
	ld	de, #0xffff
	jr	00113$
00107$:
;fat.c:218: else if (*p == ':')
	ld	l, -4 (ix)
	ld	h, -3 (ix)
	ld	a, (hl)
	sub	a, #0x3a
	jr	Z, 00110$
;fat.c:221: return -1;
	ld	de, #0xffff
	jr	00113$
00108$:
;fat.c:222: p++;
	inc	de
	ld	-4 (ix), e
	ld	-3 (ix), d
	jr	00111$
00110$:
;fat.c:224: szDrive[i] = '\0';
	ld	hl, #0
	add	hl, sp
	add	hl, bc
	ld	(hl), #0x00
;fat.c:226: return atoi(szDrive);
	ld	hl, #0
	add	hl, sp
	call	_atoi
00113$:
;fat.c:227: }
	ld	sp, ix
	pop	ix
	ret
;fat.c:229: int IsValidFilenameChar(char c)
;	---------------------------------
; Function IsValidFilenameChar
; ---------------------------------
_IsValidFilenameChar::
	call	___sdcc_enter_ix
	ld	hl, #-14
	add	hl, sp
	ld	sp, hl
	ld	c, a
;fat.c:232: char sBadCharList[] = "<>.,;:?*[]|/\\";
	ld	-14 (ix), #0x3c
	ld	-13 (ix), #0x3e
	ld	-12 (ix), #0x2e
	ld	-11 (ix), #0x2c
	ld	-10 (ix), #0x3b
	ld	-9 (ix), #0x3a
	ld	-8 (ix), #0x3f
	ld	-7 (ix), #0x2a
	ld	-6 (ix), #0x5b
	ld	-5 (ix), #0x5d
	ld	-4 (ix), #0x7c
	ld	-3 (ix), #0x2f
	ld	-2 (ix), #0x5c
	ld	-1 (ix), #0x00
;fat.c:234: if ((c <= ' ') || (c > '~'))
	ld	a, #0x20
	sub	a, c
	jr	NC, 00101$
	ld	a, #0x7e
	sub	a, c
	jr	NC, 00115$
00101$:
;fat.c:235: return FALSE;
	ld	de, #0x0000
	jr	00110$
;fat.c:237: for (int n = 0; n < sizeof(sBadCharList); n++)
00115$:
	ld	de, #0x0000
00108$:
	ld	a, e
	sub	a, #0x0e
	ld	a, d
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	NC, 00106$
;fat.c:238: if (c == sBadCharList[n])
	ld	hl, #0
	add	hl, sp
	add	hl, de
	ld	a, (hl)
	sub	a, c
	jr	NZ, 00109$
;fat.c:239: return FALSE;
	ld	de, #0x0000
	jr	00110$
00109$:
;fat.c:237: for (int n = 0; n < sizeof(sBadCharList); n++)
	inc	de
	jr	00108$
00106$:
;fat.c:241: return TRUE;
	ld	de, #0x0001
00110$:
;fat.c:242: }
	ld	sp, ix
	pop	ix
	ret
;fat.c:244: FRESULT MakeFCB(const TCHAR * path, FCB * pfcb)
;	---------------------------------
; Function MakeFCB
; ---------------------------------
_MakeFCB::
	push	ix
	ld	ix,#0
	add	ix,sp
	ld	iy, #-12
	add	iy, sp
	ld	sp, iy
	ld	-4 (ix), l
	ld	-3 (ix), h
;fat.c:249: memset(pfcb, 0, sizeof(FCB));
;	spillPairReg hl
;	spillPairReg hl
	ld	-6 (ix), e
	ld	-5 (ix), d
	ex	de,hl
;	spillPairReg hl
;	spillPairReg hl
	ld	b, #0x24
00276$:
	ld	(hl), #0x00
	inc	hl
	djnz	00276$
;fat.c:251: p = path;
	ld	a, -4 (ix)
	ld	-12 (ix), a
	ld	a, -3 (ix)
	ld	-11 (ix), a
;fat.c:253: if (p[1] == ':')
	ld	a, -4 (ix)
	add	a, #0x01
	ld	-2 (ix), a
	ld	a, -3 (ix)
	adc	a, #0x00
	ld	-1 (ix), a
	ld	l, -2 (ix)
	ld	h, -1 (ix)
	ld	a, (hl)
	sub	a, #0x3a
	jr	NZ, 00106$
;fat.c:255: if ((*p >= 'A') && (*p <= 'P'))
	ld	l, -4 (ix)
	ld	h, -3 (ix)
	ld	a, (hl)
	ld	-7 (ix), a
	sub	a, #0x41
	jr	C, 00102$
	ld	a, #0x50
	sub	a, -7 (ix)
	jr	C, 00102$
;fat.c:256: pfcb->drv = *(p++) - 'A' + 1;
	ld	a, -7 (ix)
	add	a, #0xc0
	ld	l, -6 (ix)
	ld	h, -5 (ix)
	ld	(hl), a
	jr	00103$
00102$:
;fat.c:258: return FR_INVALID_NAME;
	ld	a, #0x06
	jp	00141$
00103$:
;fat.c:259: p++;
	ld	a, -2 (ix)
	add	a, #0x01
	ld	-12 (ix), a
	ld	a, -1 (ix)
	adc	a, #0x00
	ld	-11 (ix), a
	jr	00107$
00106$:
;fat.c:262: pfcb->drv = 0;
	ld	l, -6 (ix)
	ld	h, -5 (ix)
	ld	(hl), #0x00
00107$:
;fat.c:264: if (*p == '\0')
	pop	hl
	push	hl
	ld	a, (hl)
	or	a, a
	jr	NZ, 00150$
;fat.c:265: return FR_INVALID_NAME;
	ld	a, #0x06
	jp	00141$
;fat.c:267: for (n = 0; n < 8; n++)
00150$:
	ld	c, -6 (ix)
	ld	b, -5 (ix)
	inc	bc
	ld	-10 (ix), c
	ld	-9 (ix), b
	ld	-8 (ix), c
	ld	-7 (ix), b
	pop	de
	push	de
	xor	a, a
	ld	-2 (ix), a
	ld	-1 (ix), a
00137$:
;fat.c:269: if ((*p == '\0') || (*p == '.'))
	ld	a, (de)
;	spillPairReg hl
;	spillPairReg hl
	ld	l,a
	or	a,a
	jr	Z, 00115$
	sub	a, #0x2e
	jr	NZ, 00116$
00115$:
;fat.c:270: pfcb->name[n] = ' ';
	ld	a, -2 (ix)
	add	a, -8 (ix)
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
	ld	a, #0x00
	adc	a, -7 (ix)
	ld	h, a
;	spillPairReg hl
;	spillPairReg hl
	ld	(hl), #0x20
	jr	00138$
00116$:
;fat.c:271: else if (*p == '*')
	ld	a, l
	sub	a, #0x2a
	jr	NZ, 00113$
;fat.c:273: pfcb->name[n] = '?';
	ld	a, -2 (ix)
	add	a, -10 (ix)
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
	ld	a, #0x00
	adc	a, -9 (ix)
	ld	h, a
;	spillPairReg hl
;	spillPairReg hl
	ld	(hl), #0x3f
	jr	00138$
00113$:
;fat.c:277: if (!IsValidFilenameChar(*p))
	push	bc
	push	de
	ld	a, l
	call	_IsValidFilenameChar
	ex	de, hl
	pop	de
	pop	bc
	ld	a, h
	or	a, l
	jr	NZ, 00111$
;fat.c:278: return FR_INVALID_NAME;
	ld	a, #0x06
	jp	00141$
00111$:
;fat.c:279: pfcb->name[n] = *(p++);
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	add	hl, bc
	ld	a, (de)
	inc	de
	inc	sp
	inc	sp
	push	de
	ld	(hl), a
00138$:
;fat.c:267: for (n = 0; n < 8; n++)
	inc	-2 (ix)
	jr	NZ, 00284$
	inc	-1 (ix)
00284$:
	ld	a, -2 (ix)
	sub	a, #0x08
	ld	a, #0x00
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	C, 00137$
;fat.c:283: while ((*p != '\0') && (*p != '.'))
	ld	a, -12 (ix)
	ld	-2 (ix), a
	ld	a, -11 (ix)
	ld	-1 (ix), a
00121$:
	ld	l, -2 (ix)
	ld	h, -1 (ix)
	ld	e, (hl)
;fat.c:284: p++;
	ld	a, -2 (ix)
	add	a, #0x01
	ld	-9 (ix), a
	ld	a, -1 (ix)
	adc	a, #0x00
	ld	-8 (ix), a
;fat.c:283: while ((*p != '\0') && (*p != '.'))
	ld	a, e
	sub	a, #0x2e
	ld	a, #0x01
	jr	Z, 00286$
	xor	a, a
00286$:
	ld	-7 (ix), a
	ld	a, e
	or	a, a
	jr	Z, 00161$
	bit	0, -7 (ix)
	jr	NZ, 00161$
;fat.c:284: p++;
	ld	a, -9 (ix)
	ld	-2 (ix), a
	ld	a, -8 (ix)
	ld	-1 (ix), a
	jr	00121$
00161$:
	ld	c, -2 (ix)
	ld	b, -1 (ix)
;fat.c:286: if (*p == '.')
	ld	a, -7 (ix)
	or	a, a
	jr	Z, 00125$
;fat.c:287: p++;
	ld	c, -9 (ix)
	ld	b, -8 (ix)
00125$:
;fat.c:289: if (p[-1] == '*')
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	dec	hl
	ld	a, (hl)
	sub	a, #0x2a
	jr	NZ, 00159$
;fat.c:290: p--;
	dec	bc
;fat.c:292: for (n = 0; n < 3; n++)
00159$:
	ld	a, -6 (ix)
	add	a, #0x09
	ld	e, a
	ld	a, -5 (ix)
	adc	a, #0x00
	ld	d, a
	ld	-8 (ix), e
	ld	-7 (ix), d
	ld	-2 (ix), e
	ld	-1 (ix), d
	push	bc
	pop	iy
	ld	bc, #0x0000
00139$:
;fat.c:294: if (*p == '\0')
	ld	l, 0 (iy)
;	spillPairReg hl
	ld	a, l
	or	a, a
	jr	NZ, 00134$
;fat.c:295: pfcb->ext[n] = ' ';
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	add	hl, bc
	ld	(hl), #0x20
	jr	00140$
00134$:
;fat.c:296: else if (*p == '*')
	ld	a, l
	sub	a, #0x2a
	jr	NZ, 00131$
;fat.c:297: pfcb->ext[n] = '?';
	ld	l, -8 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	add	hl, bc
	ld	(hl), #0x3f
	jr	00140$
00131$:
;fat.c:300: if (!IsValidFilenameChar(*p))
	push	bc
	push	de
	push	iy
	ld	a, l
	call	_IsValidFilenameChar
	ex	de, hl
	pop	iy
	pop	de
	pop	bc
	ld	a, h
	or	a, l
	jr	NZ, 00129$
;fat.c:301: return FR_INVALID_NAME;
	ld	a, #0x06
	jr	00141$
00129$:
;fat.c:302: pfcb->ext[n] = *(p++);
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	add	hl, de
	ld	a, 0 (iy)
	inc	iy
	ld	(hl), a
00140$:
;fat.c:292: for (n = 0; n < 3; n++)
	inc	bc
	ld	a, c
	sub	a, #0x03
	ld	a, b
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	C, 00139$
;fat.c:308: return FR_OK;
	xor	a, a
00141$:
;fat.c:309: }
	ld	sp, ix
	pop	ix
	ret
;fat.c:311: void DumpFCB(FCB * pfcb)
;	---------------------------------
; Function DumpFCB
; ---------------------------------
_DumpFCB::
	push	ix
	ld	ix,#0
	add	ix,sp
	push	af
	ex	de, hl
;fat.c:315: printf("\nFCB: %i, ", pfcb->drv);
	ld	a, (de)
	ld	c, a
	ld	b, #0x00
	push	de
	push	bc
	ld	hl, #___str_4
	push	hl
	call	_printf
	pop	af
	pop	af
	pop	de
;fat.c:316: for (n = 0; n < 8; n++)
	ld	l, e
	ld	h, d
	inc	hl
	ex	(sp), hl
	ld	bc, #0x0000
00103$:
;fat.c:317: printf("%c", pfcb->name[n]);
	pop	hl
	push	hl
	add	hl, bc
	ld	l, (hl)
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	push	bc
	push	de
	push	hl
	ld	hl, #___str_5
	push	hl
	call	_printf
	pop	af
	pop	af
	pop	de
	pop	bc
;fat.c:316: for (n = 0; n < 8; n++)
	inc	bc
	ld	a, c
	sub	a, #0x08
	ld	a, b
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	C, 00103$
;fat.c:318: printf(".");
	push	de
	ld	hl, #___str_6
	push	hl
	call	_printf
	pop	af
	pop	de
;fat.c:319: for (n = 0; n < 3; n++)
	ld	hl, #0x0009
	add	hl, de
	ex	de, hl
	ld	bc, #0x0000
00105$:
;fat.c:320: printf("%c", pfcb->ext[n]);
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	add	hl, de
	ld	l, (hl)
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	push	bc
	push	de
	push	hl
	ld	hl, #___str_5
	push	hl
	call	_printf
	pop	af
	pop	af
	pop	de
	pop	bc
;fat.c:319: for (n = 0; n < 3; n++)
	inc	bc
	ld	a, c
	sub	a, #0x03
	ld	a, b
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	C, 00105$
;fat.c:321: }
	pop	af
	pop	ix
	ret
___str_4:
	.db 0x0a
	.ascii "FCB: %i, "
	.db 0x00
___str_5:
	.ascii "%c"
	.db 0x00
___str_6:
	.ascii "."
	.db 0x00
;fat.c:323: int Exists(const TCHAR * path)
;	---------------------------------
; Function Exists
; ---------------------------------
_Exists::
	push	ix
	ld	ix,#0
	add	ix,sp
	ld	iy, #-186
	add	iy, sp
	ld	sp, iy
	ld	c, l
	ld	b, h
;fat.c:330: if (IsFatPath(path))
	push	bc
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	pop	bc
	ld	a, d
	or	a, e
	jr	Z, 00102$
;fat.c:334: fr = f_stat(path, &fno);
	ld	hl, #164
	add	hl, sp
	ex	de, hl
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_f_stat
;fat.c:336: return (fr == FR_OK);
	or	a, a
	ld	a, #0x01
	jr	Z, 00122$
	xor	a, a
00122$:
	ld	e, a
	ld	d, #0x00
	jr	00105$
00102$:
;fat.c:339: fr = MakeFCB(path, &fcb);
	ld	hl, #0
	add	hl, sp
	ex	de, hl
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_MakeFCB
;fat.c:341: if (fr != FR_OK)
	or	a, a
	jr	Z, 00104$
;fat.c:342: return FALSE;
	ld	de, #0x0000
	jr	00105$
00104$:
;fat.c:346: BDOS_SETDMA((WORD)&buf);
	ld	hl, #36
	add	hl, sp
	ex	de, hl
	ld	a, #0x1a
	call	_bdoscall
;fat.c:348: rc = BDOS_FINDFIRST((WORD)&fcb);
	ld	hl, #0
	add	hl, sp
	ex	de, hl
	ld	a, #0x11
	call	_bdoscall
;fat.c:350: return (rc != 0xFF);
	inc	e
	ld	a, #0x01
	jr	Z, 00124$
	xor	a, a
00124$:
	xor	a, #0x01
	ld	e, a
	ld	d, #0x00
00105$:
;fat.c:351: }
	ld	sp, ix
	pop	ix
	ret
;fat.c:353: FRESULT DeleteFile(const TCHAR * path)
;	---------------------------------
; Function DeleteFile
; ---------------------------------
_DeleteFile::
	push	ix
	ld	ix,#0
	add	ix,sp
	ld	iy, #-36
	add	iy, sp
	ld	sp, iy
	ld	c, l
	ld	b, h
;fat.c:358: if (IsFatPath(path))
	push	bc
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	pop	bc
	ld	a, d
	or	a, e
	jr	Z, 00102$
;fat.c:359: return f_unlink(path);
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_f_unlink
	jr	00103$
00102$:
;fat.c:361: fr = MakeFCB(path, &fcb);
	ld	hl, #0
	add	hl, sp
	ld	e, l
	ld	d, h
	push	hl
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_MakeFCB
	pop	hl
;fat.c:363: BDOS_DELETE((WORD)&fcb);	// DELETE function has no return value
	ex	de, hl
	ld	a, #0x13
	call	_bdoscall
;fat.c:365: return FR_OK;
	xor	a, a
00103$:
;fat.c:366: }
	ld	sp, ix
	pop	ix
	ret
;fat.c:368: FRESULT Open(FILE * pfile, const TCHAR * path, BYTE mode)
;	---------------------------------
; Function Open
; ---------------------------------
_Open::
	push	ix
	ld	ix,#0
	add	ix,sp
	push	af
	push	af
	push	af
	ld	-2 (ix), l
	ld	-1 (ix), h
	ld	-4 (ix), e
	ld	-3 (ix), d
;fat.c:370: if (pfile->fstyp == FS_FAT)
	ld	l, -2 (ix)
	ld	h, -1 (ix)
	ld	c, (hl)
	inc	hl
	ld	b, (hl)
;fat.c:371: return f_open(&pfile->fil, path, mode);
	ld	a, -2 (ix)
	add	a, #0x02
	ld	-6 (ix), a
	ld	a, -1 (ix)
	adc	a, #0x00
	ld	-5 (ix), a
;fat.c:370: if (pfile->fstyp == FS_FAT)
	ld	a, c
	dec	a
	or	a, b
	jr	NZ, 00102$
;fat.c:371: return f_open(&pfile->fil, path, mode);
	ld	a, 4 (ix)
	push	af
	inc	sp
	ld	e, -4 (ix)
	ld	d, -3 (ix)
	ld	l, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_f_open
	jr	00111$
00102$:
;fat.c:376: fr = MakeFCB(path, &pfile->fcb);
	pop	de
	push	de
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -3 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_MakeFCB
;fat.c:378: if (fr != FR_OK)
;fat.c:379: return fr;
	ld	c,a
	or	a,a
	jr	NZ, 00111$
;fat.c:381: if (mode & FA_READ)
	ld	a, 4 (ix)
;fat.c:383: rc = BDOS_OPENFILE((WORD)pfile->fcb);
	ld	c, -2 (ix)
	ld	b, -1 (ix)
	inc	bc
	inc	bc
	inc	sp
	inc	sp
	push	bc
;fat.c:381: if (mode & FA_READ)
	bit	0, a
	jr	Z, 00106$
;fat.c:383: rc = BDOS_OPENFILE((WORD)pfile->fcb);
	pop	de
	push	de
	ld	a, #0x0f
	call	_bdoscall
;fat.c:384: return (rc == 0xFF) ? FR_NO_FILE : FR_OK;
	inc	e
	jr	NZ, 00113$
	ld	a, #0x04
	jr	00111$
00113$:
	xor	a, a
	jr	00111$
00106$:
;fat.c:387: if (mode & FA_WRITE)
	bit	1, a
	jr	Z, 00110$
;fat.c:389: rc = BDOS_MAKEFILE((WORD)pfile->fcb);
	pop	de
	push	de
	ld	a, #0x16
	call	_bdoscall
;fat.c:393: if (rc == 0xFF)
	inc	e
	jr	NZ, 00108$
;fat.c:394: return FR_DISK_ERR;		// This should really be "out of space"
	ld	a, #0x01
	jr	00111$
00108$:
;fat.c:396: return FR_OK;
	xor	a, a
	jr	00111$
00110$:
;fat.c:399: return FR_INVALID_PARAMETER;
	ld	a, #0x13
00111$:
;fat.c:400: }
	ld	sp, ix
	pop	ix
	pop	hl
	inc	sp
	jp	(hl)
;fat.c:402: FRESULT Close(FILE * pfile)
;	---------------------------------
; Function Close
; ---------------------------------
_Close::
;fat.c:404: if (pfile->fstyp == FS_FAT)
	ld	e, l
	ld	d, h
	ld	c, (hl)
	inc	hl
	ld	b, (hl)
	ld	a, c
	dec	a
	or	a, b
	jr	NZ, 00102$
;fat.c:405: f_close(&pfile->fil);
	ld	l, e
;	spillPairReg hl
;	spillPairReg hl
	ld	h, d
;	spillPairReg hl
;	spillPairReg hl
	inc	hl
	inc	hl
	push	de
	call	_f_close
	pop	de
00102$:
;fat.c:409: rc = BDOS_CLOSEFILE((WORD)pfile->fcb);
	inc	de
	inc	de
	ld	a, #0x10
	call	_bdoscall
;fat.c:413: if (rc == 0xFF)
	inc	e
;fat.c:414: return FR_INVALID_OBJECT;
;fat.c:416: return FR_OK;
	ld	a, #0x09
	ret	Z
	xor	a, a
;fat.c:417: }
	ret
;fat.c:419: FRESULT Read(FILE * pfile, void * pbuf, UINT btr, UINT * br)
;	---------------------------------
; Function Read
; ---------------------------------
_Read::
	push	ix
	ld	ix,#0
	add	ix,sp
	push	af
	push	af
	ld	-2 (ix), l
	ld	-1 (ix), h
	inc	sp
	inc	sp
	push	de
;fat.c:421: if (btr != RECLEN)
	ld	a, 4 (ix)
	sub	a, #0x80
	or	a, 5 (ix)
	jr	Z, 00102$
;fat.c:422: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jr	00108$
00102$:
;fat.c:424: if (pfile->fstyp == FS_FAT)
	ld	l, -2 (ix)
	ld	h, -1 (ix)
	ld	c, (hl)
	inc	hl
	ld	b, (hl)
;fat.c:425: return f_read(&pfile->fil, pbuf, RECLEN, br);
	pop	de
	pop	hl
	push	hl
	inc	hl
	inc	hl
	push	de
;fat.c:424: if (pfile->fstyp == FS_FAT)
	ld	a, c
	dec	a
	or	a, b
	jr	NZ, 00104$
;fat.c:425: return f_read(&pfile->fil, pbuf, RECLEN, br);
	ld	e, 6 (ix)
	ld	d, 7 (ix)
	push	de
	ld	de, #0x0080
	push	de
	ld	e, -4 (ix)
	ld	d, -3 (ix)
	call	_f_read
	jr	00108$
00104$:
;fat.c:429: BDOS_SETDMA((WORD)pbuf);
	pop	de
	push	de
	push	hl
	ld	a, #0x1a
	call	_bdoscall
	pop	hl
;fat.c:431: rc = BDOS_READSEQ((WORD)&pfile->fcb);
	ex	de, hl
	ld	a, #0x14
	call	_bdoscall
	ld	a, e
;fat.c:437: *br = RECLEN;
	ld	l, 6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, 7 (ix)
;	spillPairReg hl
;	spillPairReg hl
;fat.c:436: if (rc == 0)
	or	a, a
	jr	NZ, 00106$
;fat.c:437: *br = RECLEN;
	ld	(hl), #0x80
	inc	hl
	ld	(hl), #0x00
	jr	00107$
00106$:
;fat.c:439: *br = 0;
	xor	a, a
	ld	(hl), a
	inc	hl
	ld	(hl), a
00107$:
;fat.c:441: return FR_OK;
	xor	a, a
00108$:
;fat.c:442: }
	ld	sp, ix
	pop	ix
	pop	hl
	pop	bc
	pop	bc
	jp	(hl)
;fat.c:444: FRESULT Write(FILE * pfile, void * pbuf, UINT btw, UINT * bw)
;	---------------------------------
; Function Write
; ---------------------------------
_Write::
	push	ix
	ld	ix,#0
	add	ix,sp
	ld	c, l
	ld	b, h
;fat.c:446: if (btw != RECLEN)
	ld	a, 4 (ix)
	sub	a, #0x80
	or	a, 5 (ix)
	jr	Z, 00102$
;fat.c:447: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jr	00107$
00102$:
;fat.c:449: if (pfile->fstyp == FS_FAT)
	ld	l, c
	ld	h, b
	ld	a, (hl)
	inc	hl
	ld	h, (hl)
;	spillPairReg hl
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
;fat.c:450: return f_write(&pfile->fil, pbuf, RECLEN, bw);
	inc	bc
	inc	bc
;fat.c:449: if (pfile->fstyp == FS_FAT)
	ld	a, l
	dec	a
	or	a, h
	jr	NZ, 00104$
;fat.c:450: return f_write(&pfile->fil, pbuf, RECLEN, bw);
	ld	l, 6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, 7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #0x0080
	push	hl
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_f_write
	jr	00107$
00104$:
;fat.c:454: BDOS_SETDMA((WORD)pbuf);
	push	bc
	ld	a, #0x1a
	call	_bdoscall
;fat.c:456: rc = BDOS_WRITESEQ((WORD)&pfile->fcb);
	pop	de
	ld	a, #0x15
	call	_bdoscall
	ld	a, e
;fat.c:460: if (rc != 0)
	or	a, a
	jr	Z, 00106$
;fat.c:461: return FR_DISK_ERR; // Actually "out of space"
	ld	a, #0x01
	jr	00107$
00106$:
;fat.c:463: *bw = RECLEN;
	ld	l, 6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, 7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	(hl), #0x80
	inc	hl
	ld	(hl), #0x00
;fat.c:465: return FR_OK;
	xor	a, a
00107$:
;fat.c:466: }
	pop	ix
	pop	hl
	pop	bc
	pop	bc
	jp	(hl)
;fat.c:468: void DirLine(FILINFO *pfno)
;	---------------------------------
; Function DirLine
; ---------------------------------
_DirLine::
	push	ix
	ld	ix,#0
	add	ix,sp
	push	af
	push	af
	push	af
;fat.c:473: (((pfno->fdate >> 9) & 0x7F) + 1980)
	ld	-2 (ix), l
	ld	-1 (ix), h
	ld	bc,#4
	add	hl,bc
	ld	c, (hl)
	inc	hl
	ld	b, (hl)
	ld	a, b
	srl	a
	ld	e, a
	res	7, e
	ld	d, #0x00
	ld	hl, #0x07bc
	add	hl, de
;fat.c:472: ((pfno->fdate >> 5) & 0x0F),
	ld	e, c
	ld	d, b
	ld	a, #0x05
00149$:
	srl	d
	rr	e
	dec	a
	jr	NZ, 00149$
	ld	a, e
	and	a, #0x0f
	ld	-4 (ix), a
	ld	-3 (ix), #0x00
;fat.c:471: ((pfno->fdate >> 0) & 0x1F),
	ld	a, c
	and	a, #0x1f
	ld	e, a
	ld	d, #0x00
;fat.c:470: printf("\n%02u/%02u/%04u  ",
	ld	bc, #___str_7+0
	push	hl
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	push	de
	push	bc
	call	_printf
	pop	af
	pop	af
	pop	af
	pop	af
;fat.c:479: (((pfno->ftime >> 0) & 0x1F) << 1)
	ld	c, -2 (ix)
	ld	b, -1 (ix)
	ld	hl, #6
	add	hl, bc
	ld	c, (hl)
	inc	hl
	ld	b, (hl)
	ld	a, c
	and	a, #0x1f
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	ld	l, a
	add	hl, hl
;fat.c:478: ((pfno->ftime >> 5) & 0x3F),
	ld	e, c
	ld	d, b
	ld	a, #0x05
00150$:
	srl	d
	rr	e
	dec	a
	jr	NZ, 00150$
	ld	a, e
	and	a, #0x3f
	ld	-4 (ix), a
	ld	-3 (ix), #0x00
;fat.c:477: ((pfno->ftime >> 11) & 0x1F),
	ld	a, b
	rrca
	rrca
	rrca
	and	a, #0x1f
	ld	e, a
	ld	d, #0x00
;fat.c:476: printf("%02u:%02u:%02u  ",
	ld	bc, #___str_8+0
	push	hl
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	push	de
	push	bc
	call	_printf
	pop	af
	pop	af
	pop	af
	pop	af
;fat.c:484: if (pfno->fattrib & AM_DIR)                    /* It is a directory */
	ld	a, -2 (ix)
	add	a, #0x08
	ld	-4 (ix), a
	ld	a, -1 (ix)
	adc	a, #0x00
	ld	-3 (ix), a
	ld	l, -4 (ix)
	ld	h, -3 (ix)
	bit	4, (hl)
	jr	Z, 00102$
;fat.c:485: printf("  <dir>       ");
	ld	hl, #___str_9
	push	hl
	call	_printf
	pop	af
	jr	00103$
00102$:
;fat.c:487: printf("%12lu  ", pfno->fsize);
	ld	l, -2 (ix)
	ld	h, -1 (ix)
	ld	c, (hl)
	inc	hl
	ld	b, (hl)
	inc	hl
	ld	e, (hl)
	inc	hl
	ld	d, (hl)
	push	de
	push	bc
	ld	hl, #___str_10
	push	hl
	call	_printf
	pop	af
	pop	af
	pop	af
00103$:
;fat.c:493: (pfno->fattrib & AM_ARC) ? 'A' : '-');
	ld	l, -4 (ix)
	ld	h, -3 (ix)
	ld	l, (hl)
;	spillPairReg hl
	bit	5, l
	jr	Z, 00106$
	ld	bc, #0x0041
	jr	00107$
00106$:
	ld	bc, #0x002d
00107$:
;fat.c:492: (pfno->fattrib & AM_SYS) ? 'S' : '-',
	bit	2, l
	jr	Z, 00108$
	ld	de, #0x0053
	jr	00109$
00108$:
	ld	de, #0x002d
00109$:
;fat.c:491: (pfno->fattrib & AM_HID) ? 'H' : '-',
	bit	1, l
	jr	Z, 00110$
	ld	-6 (ix), #0x48
	ld	-5 (ix), #0
	jr	00111$
00110$:
	ld	-6 (ix), #0x2d
	ld	-5 (ix), #0
00111$:
;fat.c:490: (pfno->fattrib & AM_RDO) ? 'R' : '-',
	bit	0, l
	jr	Z, 00112$
	ld	-4 (ix), #0x52
	ld	-3 (ix), #0
	jr	00113$
00112$:
	ld	-4 (ix), #0x2d
	ld	-3 (ix), #0
00113$:
;fat.c:489: printf("%c%c%c%c  ",
	push	bc
	push	de
	ld	l, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, #0x00
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #___str_11
	push	hl
	call	_printf
	ld	hl, #10
	add	hl, sp
	ld	sp, hl
;fat.c:495: printf("%s", pfno->fname);
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	de, #0x0009
	add	hl, de
	ld	bc, #___str_12+0
	push	hl
	push	bc
	call	_printf
;fat.c:496: }
	ld	sp,ix
	pop	ix
	ret
___str_7:
	.db 0x0a
	.ascii "%02u/%02u/%04u  "
	.db 0x00
___str_8:
	.ascii "%02u:%02u:%02u  "
	.db 0x00
___str_9:
	.ascii "  <dir>       "
	.db 0x00
___str_10:
	.ascii "%12lu  "
	.db 0x00
___str_11:
	.ascii "%c%c%c%c  "
	.db 0x00
___str_12:
	.ascii "%s"
	.db 0x00
;fat.c:498: FRESULT Dir(void)
;	---------------------------------
; Function Dir
; ---------------------------------
_Dir::
	call	___sdcc_enter_ix
	ld	hl, #-637
	add	hl, sp
	ld	sp, hl
;fat.c:508: szPath = strtok(NULL, " ");
	ld	de, #___str_13
	ld	hl, #0x0000
	call	_strtok
	ld	c, e
	ld	b, d
;fat.c:509: if (szPath == NULL)
	ld	a, b
	or	a, c
	jr	NZ, 00102$
;fat.c:510: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00122$
00102$:
;fat.c:512: fr = f_mount(&fs, szPath, 0);
	push	bc
	xor	a, a
	push	af
	inc	sp
	ld	e, c
	ld	d, b
	ld	hl, #3
	add	hl, sp
	call	_f_mount
	pop	bc
;fat.c:513: if (fr != FR_OK)
	or	a, a
;fat.c:514: return fr;
	jp	NZ,00122$
;fat.c:516: fr = f_stat(szPath, &fno);
	push	bc
	ld	hl, #604
	add	hl, sp
	ex	de, hl
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_f_stat
	ld	e, a
	pop	bc
;fat.c:518: if ((fr == FR_OK) && (fno.fattrib & AM_DIR))
	ld	a, e
	or	a, a
	jr	NZ, 00106$
	ld	a, -27 (ix)
	bit	4, a
	jr	Z, 00106$
;fat.c:519: *szFileSpec = '\0';
	ld	-13 (ix), #0x00
	jr	00107$
00106$:
;fat.c:521: fr = SplitPath(szPath, szFileSpec);
	push	bc
	ld	hl, #626
	add	hl, sp
	ex	de, hl
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
	ld	e, a
	pop	bc
00107$:
;fat.c:523: if (*szFileSpec == '\0')
	ld	d, -13 (ix)
	ld	a, d
	or	a, a
	jr	NZ, 00110$
;fat.c:524: strcpy(szFileSpec, "*");
	push	bc
	ex	de, hl
	push	hl
	ld	hl, #628
	add	hl, sp
	ex	de, hl
	ld	hl, #___str_14
	xor	a, a
00202$:
	cp	a, (hl)
	ldi
	jr	NZ, 00202$
	pop	de
	pop	bc
00110$:
;fat.c:528: if (fr == FR_OK)
	ld	a, e
	or	a, a
	jr	NZ, 00112$
;fat.c:529: fr = f_findfirst(&dir, &fno, szPath, szFileSpec);
	push	bc
	ld	hl, #626
	add	hl, sp
	push	hl
	push	bc
	ld	hl, #608
	add	hl, sp
	ex	de, hl
	ld	hl, #566
	add	hl, sp
	call	_f_findfirst
	ld	e, a
	pop	bc
00112$:
;fat.c:531: if (fr == FR_OK)
	ld	a, e
	or	a, a
	jr	NZ, 00114$
;fat.c:532: printf("\nDirectory of %s\n", szPath);
	push	bc
	push	de
	push	bc
	ld	hl, #___str_15
	push	hl
	call	_printf
	pop	af
	pop	af
	pop	de
	pop	bc
00114$:
;fat.c:534: lines = 20;
	ld	-1 (ix), #0x14
;fat.c:535: while ((fr == FR_OK) && (fno.fname[0]))
00119$:
	ld	a, e
	or	a, a
	jr	NZ, 00121$
	ld	a, -26 (ix)
	or	a, a
	jr	Z, 00121$
;fat.c:537: if( lines-- )
	ld	d, -1 (ix)
	dec	-1 (ix)
	ld	a, d
	or	a, a
	jr	Z, 00116$
;fat.c:539: DirLine(&fno);
	push	bc
	ld	hl, #604
	add	hl, sp
	call	_DirLine
	ld	hl, #604
	add	hl, sp
	ex	de, hl
	ld	hl, #562
	add	hl, sp
	call	_f_findnext
	ld	e, a
	pop	bc
	jr	00119$
00116$:
;fat.c:544: printf("\nPress any key to continue...\n");
	push	bc
	push	de
	ld	hl, #___str_17
	call	_puts
	call	_getchar
	pop	de
	pop	bc
;fat.c:546: lines = 20;
	ld	-1 (ix), #0x14
	jr	00119$
00121$:
;fat.c:550: f_mount(0, szPath, 0);		// unmount ignoring any errors
	push	de
	xor	a, a
	push	af
	inc	sp
	ld	e, c
	ld	d, b
	ld	hl, #0x0000
	call	_f_mount
	pop	de
;fat.c:552: return fr;
	ld	a, e
00122$:
;fat.c:553: }
	ld	sp, ix
	pop	ix
	ret
___str_13:
	.ascii " "
	.db 0x00
___str_14:
	.ascii "*"
	.db 0x00
___str_15:
	.db 0x0a
	.ascii "Directory of %s"
	.db 0x0a
	.db 0x00
___str_17:
	.db 0x0a
	.ascii "Press any key to continue..."
	.db 0x00
;fat.c:555: FRESULT CopyFile(char * szSrcFile, char * szDestFile)
;	---------------------------------
; Function CopyFile
; ---------------------------------
_CopyFile::
	push	ix
	ld	ix,#0
	add	ix,sp
	ld	iy, #-214
	add	iy, sp
	ld	sp, iy
	ld	-2 (ix), l
	ld	-1 (ix), h
;fat.c:561: printf("\n%s ==> %s", szSrcFile, szDestFile);
;	spillPairReg hl
;	spillPairReg hl
	ld	-4 (ix), e
	ld	-3 (ix), d
;	spillPairReg hl
;	spillPairReg hl
	push	de
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #___str_18
	push	hl
	call	_printf
	pop	af
	pop	af
	pop	af
;fat.c:563: if (strcmp(szSrcFile, szDestFile) == 0)
	ld	e, -4 (ix)
	ld	d, -3 (ix)
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_strcmp
	ld	c, e
	ld	a, d
	or	a, c
	jr	NZ, 00102$
;fat.c:564: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00124$
00102$:
;fat.c:566: memset(&fileSrc, 0, sizeof(fileSrc));
	ld	hl, #0
	add	hl, sp
	ld	b, #0x26
00221$:
	ld	(hl), #0x00
	inc	hl
	djnz	00221$
;fat.c:567: memset(&fileDest, 0, sizeof(fileDest));
	ld	hl, #38
	add	hl, sp
	ld	b, #0x26
00223$:
	ld	(hl), #0x00
	inc	hl
	djnz	00223$
;fat.c:569: fileSrc.fstyp = IsFatPath(szSrcFile) ? FS_FAT : FS_CPM;
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	ld	a, d
	or	a, e
	jr	Z, 00126$
	ld	de, #0x0001
	jr	00127$
00126$:
	ld	de, #0x0002
00127$:
	inc	sp
	inc	sp
	push	de
;fat.c:570: fileDest.fstyp = IsFatPath(szDestFile) ? FS_FAT : FS_CPM;
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -3 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	ld	-6 (ix), e
	ld	-5 (ix), d
	ld	a, d
	or	a, -6 (ix)
	jr	Z, 00128$
	ld	-6 (ix), #0x01
	ld	-5 (ix), #0
	jr	00129$
00128$:
	ld	-6 (ix), #0x02
	ld	-5 (ix), #0
00129$:
	ld	a, -6 (ix)
	ld	iy, #38
	add	iy, sp
	ld	0 (iy), a
	ld	1 (iy), #0x00
;fat.c:575: if (Exists(szDestFile))
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -3 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_Exists
	ld	a, d
	or	a, e
	jr	Z, 00108$
;fat.c:577: printf(" Overwrite? (Y/N)");
	ld	hl, #___str_19
	push	hl
	call	_printf
	pop	af
;fat.c:579: if (!Confirm())
	call	_Confirm
	ld	a, d
	or	a, e
	jr	NZ, 00104$
;fat.c:580: return 100;	// special case value to indicate "skip file"
	ld	a, #0x64
	jp	00124$
00104$:
;fat.c:582: fr = DeleteFile(szDestFile);
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -3 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_DeleteFile
;fat.c:584: if (fr != FR_OK)
	or	a, a
;fat.c:585: return fr;
	jp	NZ,00124$
00108$:
;fat.c:588: fr = Open(&fileSrc, szSrcFile, FA_READ);
	ld	a, #0x01
	push	af
	inc	sp
	ld	e, -2 (ix)
	ld	d, -1 (ix)
	ld	hl, #1
	add	hl, sp
	call	_Open
;fat.c:590: if (fr == FR_OK)
	ld	c, a
	or	a, a
	jp	NZ, 00123$
;fat.c:592: fr = Open(&fileDest, szDestFile, FA_WRITE | FA_CREATE_ALWAYS);
	ld	a, #0x0a
	push	af
	inc	sp
	ld	e, -4 (ix)
	ld	d, -3 (ix)
	ld	hl, #39
	add	hl, sp
	call	_Open
;fat.c:594: if (fr == FR_OK)
	ld	c, a
	or	a, a
	jp	NZ, 00121$
;fat.c:599: printf(" ...");
	ld	hl, #___str_20
	push	hl
	call	_printf
	pop	af
;fat.c:601: do
00117$:
;fat.c:603: br = 0;
	xor	a, a
	ld	iy, #76
	add	iy, sp
	ld	0 (iy), a
	ld	1 (iy), a
;fat.c:604: memset(buf, 0x1A, RECLEN);
	ld	hl, #80
	add	hl, sp
	ld	b, #0x80
00225$:
	ld	(hl), #0x1a
	inc	hl
	djnz	00225$
;fat.c:606: fr = Read(&fileSrc, buf, RECLEN, &br);
	ld	hl, #76
	add	hl, sp
	push	hl
	ld	hl, #0x0080
	push	hl
	ld	hl, #84
	add	hl, sp
	ex	de, hl
	ld	hl, #4
	add	hl, sp
	call	_Read
;fat.c:608: if (fr != FR_OK)
	ld	c, a
	or	a, a
	jr	NZ, 00119$
;fat.c:611: if (br > 0)
	ld	iy, #76
	add	iy, sp
	ld	a, 1 (iy)
	or	a, 0 (iy)
	jr	Z, 00118$
;fat.c:613: bw = 0;
	xor	a, a
	inc	iy
	inc	iy
	ld	0 (iy), a
	ld	1 (iy), a
;fat.c:615: fr = Write(&fileDest, buf, RECLEN, &bw);
	ld	hl, #78
	add	hl, sp
	push	hl
	ld	hl, #0x0080
	push	hl
	ld	hl, #84
	add	hl, sp
	ex	de, hl
	ld	hl, #42
	add	hl, sp
	call	_Write
;fat.c:617: if (fr != FR_OK)
	ld	c, a
	or	a, a
	jr	NZ, 00119$
;fat.c:620: if (bw < RECLEN)
	ld	iy, #78
	add	iy, sp
	ld	a, 0 (iy)
	sub	a, #0x80
	ld	a, 1 (iy)
	sbc	a, #0x00
	jr	NC, 00118$
;fat.c:623: fr = FR_DISK_ERR;
	ld	c, #0x01
;fat.c:624: break;
	jr	00119$
00118$:
;fat.c:627: } while (br == RECLEN);
	ld	iy, #76
	add	iy, sp
	ld	a, 0 (iy)
	sub	a, #0x80
	or	a, 1 (iy)
	jp	Z,00117$
00119$:
;fat.c:629: Close(&fileDest);
	push	bc
	ld	hl, #40
	add	hl, sp
	call	_Close
	pop	bc
00121$:
;fat.c:632: Close(&fileSrc);
	push	bc
	ld	hl, #2
	add	hl, sp
	call	_Close
	pop	bc
00123$:
;fat.c:635: return fr;
	ld	a, c
00124$:
;fat.c:636: }
	ld	sp, ix
	pop	ix
	ret
___str_18:
	.db 0x0a
	.ascii "%s ==> %s"
	.db 0x00
___str_19:
	.ascii " Overwrite? (Y/N)"
	.db 0x00
___str_20:
	.ascii " ..."
	.db 0x00
;fat.c:638: FRESULT FatCopy(char * szSrcPath, char * szDestPath)
;	---------------------------------
; Function FatCopy
; ---------------------------------
_FatCopy::
	push	ix
	ld	ix,#0
	add	ix,sp
	ld	iy, #-606
	add	iy, sp
	ld	sp, iy
	ld	-4 (ix), l
	ld	-3 (ix), h
	ld	-6 (ix), e
	ld	-5 (ix), d
;fat.c:651: fr = SplitPath(szSrcPath, szSrcSpec);
	ld	hl, #64
	add	hl, sp
	ex	de, hl
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -3 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
;fat.c:652: if (fr != FR_OK)
	ld	-1 (ix), a
	or	a, a
	jr	Z, 00102$
;fat.c:653: return fr;
	ld	a, -1 (ix)
	jp	00134$
00102$:
;fat.c:655: if (IsFatPath(szDestPath))
	ld	l, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	ld	c, e
	ld	a, d
	or	a, c
	jr	Z, 00108$
;fat.c:657: fr = f_stat(szDestPath, &fno);
	ld	hl, #42
	add	hl, sp
	ex	de, hl
	ld	l, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_f_stat
;fat.c:660: if ((fr == FR_OK) && (fno.fattrib & AM_DIR))
	ld	c, a
	or	a, a
	jr	NZ, 00104$
	ld	hl, #50
	add	hl, sp
	ld	a, (hl)
	bit	4, a
	jr	Z, 00104$
;fat.c:661: *szDestSpec = '\0';
	ld	iy, #76
	add	iy, sp
	ld	0 (iy), #0x00
	jr	00109$
00104$:
;fat.c:663: fr = SplitPath(szDestPath, szDestSpec);
	ld	hl, #76
	add	hl, sp
	ex	de, hl
	ld	l, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
	ld	c, a
	jr	00109$
00108$:
;fat.c:669: fr = SplitPath(szDestPath, szDestSpec);
	ld	hl, #76
	add	hl, sp
	ex	de, hl
	ld	l, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
	ld	c, a
00109$:
;fat.c:671: if (fr != FR_OK)
	ld	a, c
	or	a, a
	jr	Z, 00111$
;fat.c:672: return fr;
	ld	a, c
	jp	00134$
00111$:
;fat.c:674: if (*szSrcSpec == '\0')
	ld	hl, #64
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jr	NZ, 00113$
;fat.c:675: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00134$
00113$:
;fat.c:677: if (IsWild(szSrcSpec) && (*szDestSpec != '\0'))
	ld	hl, #64
	add	hl, sp
	call	_IsWild
	ld	a, d
	or	a, e
	jr	Z, 00115$
	ld	hl, #76
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jr	Z, 00115$
;fat.c:678: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00134$
00115$:
;fat.c:682: fr = f_findfirst(&dir, &fno, szSrcPath, szSrcSpec);
	ld	hl, #64
	add	hl, sp
	push	hl
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -3 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #46
	add	hl, sp
	ex	de, hl
	ld	hl, #4
	add	hl, sp
	call	_f_findfirst
;fat.c:684: if (fr == FR_OK)
	ld	-7 (ix), a
	or	a, a
	jr	NZ, 00118$
;fat.c:685: printf("\nCopying...\n");
	ld	hl, #___str_22
	call	_puts
	jr	00154$
00118$:
;fat.c:687: return FR_NO_FILE;
	ld	a, #0x04
	jp	00134$
;fat.c:689: while ((fr == FR_OK) && (fno.fname[0]))
00154$:
	xor	a, a
	ld	-2 (ix), a
	ld	-1 (ix), a
00131$:
	ld	a, -7 (ix)
	or	a, a
	jp	NZ, 00133$
	ld	iy, #51
	add	iy, sp
	ld	a, 0 (iy)
	or	a, a
	jp	Z, 00133$
;fat.c:694: if (!(fno.fattrib & AM_DIR))
	dec	iy
	bit	4, 0 (iy)
	jp	NZ,00127$
;fat.c:698: strncpy(szSrcFile, szSrcPath, sizeof(szSrcFile) - 1);
	ld	hl, #88
	add	hl, sp
	ex	de, hl
	ld	l, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -3 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	bc, #0x00fe
	xor	a, a
00269$:
	cp	a,(hl)
	ldi
	jp	PO, 00268$
	jr	NZ, 00269$
00270$:
	dec	hl
	ldi
	jp	PE, 00270$
00268$:
;fat.c:699: strncat(szSrcFile, "/", sizeof(szSrcFile) - 1);
	ld	de, #___str_23
	ld	hl, #0x00fe
	push	hl
	ld	hl, #90
	add	hl, sp
	call	_strncat
;fat.c:700: strncat(szSrcFile, fno.fname, sizeof(szSrcFile) - 1);
	ld	hl, #0x00fe
	push	hl
	ld	hl, #53
	add	hl, sp
	ex	de, hl
	ld	hl, #90
	add	hl, sp
	call	_strncat
;fat.c:702: strncpy(szDestFile, szDestPath, sizeof(szDestFile) - 1);
	ld	hl, #343
	add	hl, sp
	ex	de, hl
	ld	l, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	bc, #0x00fe
	xor	a, a
00272$:
	cp	a,(hl)
	ldi
	jp	PO, 00271$
	jr	NZ, 00272$
00273$:
	dec	hl
	ldi
	jp	PE, 00273$
00271$:
;fat.c:703: if (IsFatPath(szDestPath))
	ld	l, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	ld	a, d
	or	a, e
	jr	Z, 00121$
;fat.c:704: strncat(szDestFile, "/", sizeof(szDestFile) - 1);
	ld	hl, #0x00fe
	push	hl
	ld	de, #___str_23
	ld	hl, #345
	add	hl, sp
	call	_strncat
00121$:
;fat.c:705: strncat(szDestFile, (*szDestSpec == '\0') ? fno.fname : szDestSpec, sizeof(szDestFile) - 1);
	ld	iy, #76
	add	iy, sp
	ld	a, 0 (iy)
	or	a, a
	jr	NZ, 00136$
	push	hl
	push	af
	ld	hl, #55
	add	hl, sp
	ld	-8 (ix), l
	ld	hl, #55
	add	hl, sp
	pop	af
	ld	-7 (ix), h
	pop	hl
	jr	00137$
00136$:
	push	hl
	push	af
	ld	hl, #80
	add	hl, sp
	ld	-8 (ix), l
	ld	hl, #80
	add	hl, sp
	pop	af
	ld	-7 (ix), h
	pop	hl
00137$:
	ld	e, -8 (ix)
	ld	d, -7 (ix)
	ld	hl, #0x00fe
	push	hl
	ld	hl, #345
	add	hl, sp
	call	_strncat
;fat.c:707: fr = CopyFile(szSrcFile, szDestFile);
	ld	hl, #343
	add	hl, sp
	ex	de, hl
	ld	hl, #88
	add	hl, sp
	call	_CopyFile
;fat.c:708: if (fr == FR_OK)
	ld	-7 (ix), a
	or	a, a
	jr	NZ, 00123$
;fat.c:710: printf(" [OK]");
	ld	hl, #___str_24
	push	hl
	call	_printf
	pop	af
;fat.c:711: nFiles++;
	inc	-2 (ix)
	jr	NZ, 00274$
	inc	-1 (ix)
00274$:
00123$:
;fat.c:713: if (fr == 100)
	ld	a, -7 (ix)
	sub	a, #0x64
	jr	NZ, 00127$
;fat.c:715: printf(" [Skipped]");
	ld	hl, #___str_25
	push	hl
	call	_printf
	pop	af
;fat.c:716: fr = FR_OK;
	ld	-7 (ix), #0x00
00127$:
;fat.c:720: if (fr == FR_OK)
	ld	a, -7 (ix)
	or	a, a
	jp	NZ, 00131$
;fat.c:721: fr = f_findnext(&dir, &fno);
	ld	hl, #42
	add	hl, sp
	ex	de, hl
	ld	hl, #0
	add	hl, sp
	call	_f_findnext
	ld	-7 (ix), a
	jp	00131$
00133$:
;fat.c:724: printf("\n\n    %i File(s) Copied", nFiles);
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #___str_26
	push	hl
	call	_printf
	pop	af
	pop	af
;fat.c:726: return fr;
	ld	a, -7 (ix)
00134$:
;fat.c:727: }
	ld	sp, ix
	pop	ix
	ret
___str_22:
	.db 0x0a
	.ascii "Copying..."
	.db 0x00
___str_23:
	.ascii "/"
	.db 0x00
___str_24:
	.ascii " [OK]"
	.db 0x00
___str_25:
	.ascii " [Skipped]"
	.db 0x00
___str_26:
	.db 0x0a
	.db 0x0a
	.ascii "    %i File(s) Copied"
	.db 0x00
;fat.c:729: FRESULT CpmCopy(char * szSrcPath, char * szDestPath)
;	---------------------------------
; Function CpmCopy
; ---------------------------------
_CpmCopy::
	push	ix
	ld	ix,#0
	add	ix,sp
	ld	iy, #-1166
	add	iy, sp
	ld	sp, iy
	ld	-10 (ix), l
	ld	-9 (ix), h
	ld	-12 (ix), e
	ld	-11 (ix), d
;fat.c:747: nFiles = 0;
	xor	a, a
	ld	-26 (ix), a
	ld	-25 (ix), a
;fat.c:749: fr = MakeFCB(szSrcPath, &fcbSrch);
	ld	hl, #36
	add	hl, sp
	ex	de, hl
	ld	l, -10 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -9 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_MakeFCB
	ld	-1 (ix), a
;fat.c:753: memcpy(&fcbSave, &fcbSrch, sizeof(fcbSave));
	ex	de, hl
	ld	hl, #0
	add	hl, sp
	ex	de, hl
	ld	hl, #36
	add	hl, sp
	ld	bc, #0x0024
	ldir
;fat.c:755: if (fr != FR_OK)
	ld	a, -1 (ix)
	or	a, a
	jr	Z, 00102$
;fat.c:756: return fr;
	ld	a, -1 (ix)
	jp	00158$
00102$:
;fat.c:758: fr = SplitPath(szSrcPath, szSrcSpec);
	ld	hl, #222
	add	hl, sp
	ex	de, hl
	ld	l, -10 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -9 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
;fat.c:759: if (fr != FR_OK)
	or	a, a
;fat.c:760: return fr;
	jp	NZ,00158$
;fat.c:762: if (IsFatPath(szDestPath))
	ld	l, -12 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -11 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	ld	-2 (ix), e
	ld	-1 (ix), d
	ld	a, d
	or	a, -2 (ix)
	jr	Z, 00110$
;fat.c:764: fr = f_stat(szDestPath, &fno);
	ld	hl, #200
	add	hl, sp
	ex	de, hl
	ld	l, -12 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -11 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_f_stat
;fat.c:767: if ((fr == FR_OK) && (fno.fattrib & AM_DIR))
	ld	-1 (ix), a
	or	a, a
	jr	NZ, 00106$
	ld	hl, #208
	add	hl, sp
	ld	a, (hl)
	bit	4, a
	jr	Z, 00106$
;fat.c:768: *szDestSpec = '\0';
	ld	iy, #234
	add	iy, sp
	ld	0 (iy), #0x00
	jr	00111$
00106$:
;fat.c:770: fr = SplitPath(szDestPath, szDestSpec);
	ld	hl, #234
	add	hl, sp
	ex	de, hl
	ld	l, -12 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -11 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
	ld	-1 (ix), a
	jr	00111$
00110$:
;fat.c:776: fr = SplitPath(szDestPath, szDestSpec);
	ld	hl, #234
	add	hl, sp
	ex	de, hl
	ld	l, -12 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -11 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
	ld	-1 (ix), a
00111$:
;fat.c:778: if (fr != FR_OK)
	ld	a, -1 (ix)
	or	a, a
	jr	Z, 00113$
;fat.c:779: return fr;
	ld	a, -1 (ix)
	jp	00158$
00113$:
;fat.c:781: if (*szSrcSpec == '\0')
	ld	hl, #222
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jr	NZ, 00115$
;fat.c:782: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00158$
00115$:
;fat.c:784: if (IsWild(szSrcSpec) && (*szDestSpec != '\0'))
	ld	hl, #222
	add	hl, sp
	call	_IsWild
	ld	a, d
	or	a, e
	jr	Z, 00117$
	ld	hl, #234
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jr	Z, 00117$
;fat.c:785: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00158$
00117$:
;fat.c:787: nSkip = 0;
	xor	a, a
	ld	-24 (ix), a
	ld	-23 (ix), a
;fat.c:788: rc = 0;
	xor	a, a
	ld	-22 (ix), a
	ld	-21 (ix), a
;fat.c:790: while (rc != 0xFF)
00148$:
	ld	a, -22 (ix)
	inc	a
	or	a, -21 (ix)
	jp	Z,00150$
;fat.c:794: memcpy(&fcbSrch, &fcbSave, sizeof(fcbSrch));
	ex	de, hl
	ld	hl, #36
	add	hl, sp
	ex	de, hl
	ld	hl, #0
	add	hl, sp
	ld	bc, #0x0024
	ldir
;fat.c:798: BDOS_SETDMA((WORD)&buf);
	ld	hl, #72
	add	hl, sp
	ex	de, hl
	ld	a, #0x1a
	call	_bdoscall
;fat.c:800: rc = BDOS_FINDFIRST((WORD)&fcbSrch);
	ld	hl, #36
	add	hl, sp
	ex	de, hl
	ld	a, #0x11
	call	_bdoscall
	ld	-3 (ix), e
	ld	-2 (ix), d
	ld	a, -3 (ix)
	ld	-22 (ix), a
	ld	-21 (ix), #0x00
;fat.c:804: if (nSkip == 0)
	ld	a, -23 (ix)
	or	a, -24 (ix)
	jr	NZ, 00176$
;fat.c:806: if (rc == 0xFF)
	ld	a, -22 (ix)
	inc	a
	or	a, -21 (ix)
	jr	NZ, 00120$
;fat.c:807: return FR_NO_FILE;
	ld	a, #0x04
	jp	00158$
00120$:
;fat.c:808: printf("\nCopying...\n");
	ld	hl, #___str_28
	call	_puts
;fat.c:813: while ((rc != 0xFF) && (nEntry < nSkip))
00176$:
	xor	a, a
	ld	-3 (ix), a
	ld	-2 (ix), a
00124$:
	ld	a, -22 (ix)
	inc	a
	or	a, -21 (ix)
	jr	Z, 00126$
	ld	a, -3 (ix)
	sub	a, -24 (ix)
	ld	a, -2 (ix)
	sbc	a, -23 (ix)
	jp	PO, 00388$
	xor	a, #0x80
00388$:
	jp	P, 00126$
;fat.c:815: rc = BDOS_FINDNEXT((WORD)&fcbSrch);
	ld	hl, #36
	add	hl, sp
	ex	de, hl
	ld	a, #0x12
	call	_bdoscall
	ld	-5 (ix), e
	ld	-4 (ix), d
	ld	a, -5 (ix)
	ld	-22 (ix), a
	ld	-21 (ix), #0x00
;fat.c:816: nEntry++;
	inc	-3 (ix)
	jr	NZ, 00124$
	inc	-2 (ix)
	jr	00124$
00126$:
;fat.c:821: while ((rc != 0xFF) && (nEntry < CHUNKSIZE))
	xor	a, a
	ld	-5 (ix), a
	ld	-4 (ix), a
	ld	a, -24 (ix)
	ld	-3 (ix), a
	ld	a, -23 (ix)
	ld	-2 (ix), a
00128$:
	ld	a, -22 (ix)
	inc	a
	or	a, -21 (ix)
	jp	Z,00194$
	ld	a, -5 (ix)
	sub	a, #0x20
	ld	a, -4 (ix)
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	NC, 00194$
;fat.c:823: dirent = (FCB *)(buf + (32 * rc));
	ld	a, -22 (ix)
	ld	-14 (ix), a
	ld	-13 (ix), #0x00
	ld	b, #0x05
00391$:
	sla	-14 (ix)
	rl	-13 (ix)
	djnz	00391$
	ld	e, -14 (ix)
	ld	d, -13 (ix)
	ld	hl, #72
	add	hl, sp
	add	hl, de
	ld	-7 (ix), l
	ld	-6 (ix), h
;fat.c:827: memcpy(FileList[nEntry], dirent, sizeof(FileList[0]));
	ld	c, -5 (ix)
	ld	b, -4 (ix)
	ld	l, c
	ld	h, b
	add	hl, hl
	add	hl, bc
	add	hl, hl
	add	hl, hl
	ld	-16 (ix), l
	ld	-15 (ix), h
	ex	de,hl
	ld	hl, #246
	add	hl, sp
	add	hl, de
	ld	-14 (ix), l
	ld	-13 (ix), h
	ex	de,hl
	ld	l, -7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	bc, #0x000c
	ldir
;fat.c:829: nEntry++;
	inc	-5 (ix)
	jr	NZ, 00392$
	inc	-4 (ix)
00392$:
;fat.c:830: nSkip++;
	inc	-3 (ix)
	jr	NZ, 00393$
	inc	-2 (ix)
00393$:
;fat.c:832: rc = BDOS_FINDNEXT((WORD)&fcbSrch);
	ld	hl, #36
	add	hl, sp
	ex	de, hl
	ld	a, #0x12
	call	_bdoscall
	ld	-22 (ix), e
	ld	-21 (ix), #0x00
	jp	00128$
00194$:
	ld	a, -5 (ix)
	ld	-20 (ix), a
	ld	a, -4 (ix)
	ld	-19 (ix), a
	ld	a, -3 (ix)
	ld	-24 (ix), a
	ld	a, -2 (ix)
	ld	-23 (ix), a
;fat.c:835: for (int iFile = 0; iFile < nEntry; iFile++)
	ld	a, -26 (ix)
	ld	-8 (ix), a
	ld	a, -25 (ix)
	ld	-7 (ix), a
	xor	a, a
	ld	-6 (ix), a
	ld	-5 (ix), a
00156$:
	ld	a, -6 (ix)
	sub	a, -20 (ix)
	ld	a, -5 (ix)
	sbc	a, -19 (ix)
	jp	PO, 00394$
	xor	a, #0x80
00394$:
	jp	P, 00148$
;fat.c:842: dirent = (FCB *)FileList[iFile];
	ld	c, -6 (ix)
	ld	b, -5 (ix)
	ld	l, c
	ld	h, b
	add	hl, hl
	add	hl, bc
	add	hl, hl
	add	hl, hl
	ld	-4 (ix), l
	ld	-3 (ix), h
	ex	de,hl
	ld	hl, #246
	add	hl, sp
	add	hl, de
	ld	-2 (ix), l
	ld	-1 (ix), h
	ld	a, -2 (ix)
	ld	-18 (ix), a
	ld	a, -1 (ix)
	ld	-17 (ix), a
;fat.c:843: p = szSrcFile;
	push	hl
	push	af
	ld	hl, #634
	add	hl, sp
	ld	-2 (ix), l
	ld	hl, #634
	add	hl, sp
	pop	af
	ld	-1 (ix), h
	pop	hl
;fat.c:847: if (fcbSrch.drv > 0)
	ld	hl, #36
	add	hl, sp
	ld	a, (hl)
	ld	-3 (ix), a
	or	a, a
	jr	Z, 00132$
;fat.c:849: *(p++) = fcbSrch.drv + 'A' - 1;
	ld	a, -3 (ix)
	add	a, #0x40
	ld	-3 (ix), a
	ld	l, -2 (ix)
	ld	h, -1 (ix)
	ld	a, -3 (ix)
	ld	(hl), a
	ld	a, -2 (ix)
	add	a, #0x01
	ld	-4 (ix), a
	ld	a, -1 (ix)
	adc	a, #0x00
	ld	-3 (ix), a
;fat.c:850: *(p++) = ':';
	ld	l, -4 (ix)
	ld	h, -3 (ix)
	ld	(hl), #0x3a
	ld	a, -4 (ix)
	add	a, #0x01
	ld	-2 (ix), a
	ld	a, -3 (ix)
	adc	a, #0x00
	ld	-1 (ix), a
00132$:
;fat.c:853: p2 = p;			// Remember start of filename/ext
	ld	a, -2 (ix)
	ld	-16 (ix), a
	ld	a, -1 (ix)
	ld	-15 (ix), a
;fat.c:855: for (n = 0; n < 8; n++)
	ld	a, -18 (ix)
	add	a, #0x01
	ld	-14 (ix), a
	ld	a, -17 (ix)
	adc	a, #0x00
	ld	-13 (ix), a
	ld	a, -2 (ix)
	ld	-4 (ix), a
	ld	a, -1 (ix)
	ld	-3 (ix), a
	xor	a, a
	ld	-2 (ix), a
	ld	-1 (ix), a
00151$:
;fat.c:857: if (dirent->name[n] == ' ')
	ld	a, -14 (ix)
	add	a, -2 (ix)
	ld	c, a
	ld	a, -13 (ix)
	adc	a, -1 (ix)
	ld	b, a
	ld	a, (bc)
	cp	a, #0x20
	jr	Z, 00135$
;fat.c:859: *(p++) = dirent->name[n] & 0x7F;
	res	7, a
	ld	l, -4 (ix)
	ld	h, -3 (ix)
	ld	(hl), a
	inc	-4 (ix)
	jr	NZ, 00396$
	inc	-3 (ix)
00396$:
;fat.c:855: for (n = 0; n < 8; n++)
	inc	-2 (ix)
	jr	NZ, 00397$
	inc	-1 (ix)
00397$:
	ld	a, -2 (ix)
	sub	a, #0x08
	ld	a, -1 (ix)
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	C, 00151$
00135$:
;fat.c:862: *(p++) = '.';
	ld	l, -4 (ix)
	ld	h, -3 (ix)
	ld	(hl), #0x2e
	ld	c, -4 (ix)
	ld	b, -3 (ix)
	inc	bc
;fat.c:864: for (n = 0; n < 3; n++)
	ld	a, -18 (ix)
	add	a, #0x09
	ld	-4 (ix), a
	ld	a, -17 (ix)
	adc	a, #0x00
	ld	-3 (ix), a
	xor	a, a
	ld	-2 (ix), a
	ld	-1 (ix), a
00153$:
;fat.c:866: if (dirent->ext[n] == ' ')
	ld	a, -4 (ix)
	add	a, -2 (ix)
	ld	e, a
	ld	a, -3 (ix)
	adc	a, -1 (ix)
	ld	d, a
	ld	a, (de)
	cp	a, #0x20
	jr	Z, 00138$
;fat.c:868: *(p++) = dirent->ext[n] & 0x7F;
	res	7, a
	ld	(bc), a
	inc	bc
;fat.c:864: for (n = 0; n < 3; n++)
	inc	-2 (ix)
	jr	NZ, 00399$
	inc	-1 (ix)
00399$:
	ld	a, -2 (ix)
	sub	a, #0x03
	ld	a, -1 (ix)
	rla
	ccf
	rra
	sbc	a, #0x80
	jr	C, 00153$
00138$:
;fat.c:871: *(p++) = '\0';
	xor	a, a
	ld	(bc), a
;fat.c:873: strncpy(szDestFile, szDestPath, sizeof(szDestFile) - 1);
	ld	hl, #885
	add	hl, sp
	ex	de, hl
	ld	l, -12 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -11 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	bc, #0x00fe
	xor	a, a
00401$:
	cp	a,(hl)
	ldi
	jp	PO, 00400$
	jr	NZ, 00401$
00402$:
	dec	hl
	ldi
	jp	PE, 00402$
00400$:
;fat.c:874: if (IsFatPath(szDestPath))
	ld	l, -12 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -11 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	ld	c, e
	ld	a, d
	or	a, c
	jr	Z, 00140$
;fat.c:875: strncat(szDestFile, "/", sizeof(szDestFile) - 1);
	ld	hl, #0x00fe
	push	hl
	ld	de, #___str_29
	ld	hl, #887
	add	hl, sp
	call	_strncat
00140$:
;fat.c:876: strncat(szDestFile, (*szDestSpec == '\0') ? p2 : szDestSpec, sizeof(szDestFile) - 1);
	ld	iy, #234
	add	iy, sp
	ld	a, 0 (iy)
	ld	-1 (ix), a
	or	a, a
	jr	NZ, 00160$
	ld	a, -16 (ix)
	ld	-2 (ix), a
	ld	a, -15 (ix)
	ld	-1 (ix), a
	jr	00161$
00160$:
	push	hl
	push	af
	ld	hl, #238
	add	hl, sp
	ld	-2 (ix), l
	ld	hl, #238
	add	hl, sp
	pop	af
	ld	-1 (ix), h
	pop	hl
00161$:
	ld	hl, #0x00fe
	push	hl
	ld	e, -2 (ix)
	ld	d, -1 (ix)
	ld	hl, #887
	add	hl, sp
	call	_strncat
;fat.c:880: fr = CopyFile(szSrcFile, szDestFile);
	ld	hl, #885
	add	hl, sp
	ex	de, hl
	ld	hl, #630
	add	hl, sp
	call	_CopyFile
;fat.c:881: if (fr == FR_OK)
	ld	-1 (ix), a
	or	a, a
	jr	NZ, 00142$
;fat.c:883: printf(" [OK]");
	ld	hl, #___str_30
	push	hl
	call	_printf
	pop	af
;fat.c:884: nFiles++;
	inc	-8 (ix)
	jr	NZ, 00403$
	inc	-7 (ix)
00403$:
	ld	a, -8 (ix)
	ld	-26 (ix), a
	ld	a, -7 (ix)
	ld	-25 (ix), a
00142$:
;fat.c:886: if (fr == 100)
	ld	a, -1 (ix)
	sub	a, #0x64
	jr	NZ, 00144$
;fat.c:888: printf(" [Skipped]");
	ld	hl, #___str_31
	push	hl
	call	_printf
	pop	af
;fat.c:889: fr = FR_OK;
	ld	-1 (ix), #0x00
00144$:
;fat.c:891: if (fr != FR_OK)
	ld	a, -1 (ix)
	or	a, a
	jr	Z, 00157$
;fat.c:892: return fr;
	ld	a, -1 (ix)
	jr	00158$
00157$:
;fat.c:835: for (int iFile = 0; iFile < nEntry; iFile++)
	inc	-6 (ix)
	jp	NZ,00156$
	inc	-5 (ix)
	jp	00156$
00150$:
;fat.c:896: printf("\n\n    %i File(s) Copied", nFiles);
	ld	l, -26 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -25 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #___str_32
	push	hl
	call	_printf
	pop	af
	pop	af
;fat.c:898: return fr;
	ld	a, -1 (ix)
00158$:
;fat.c:931: }
	ld	sp, ix
	pop	ix
	ret
___str_28:
	.db 0x0a
	.ascii "Copying..."
	.db 0x00
___str_29:
	.ascii "/"
	.db 0x00
___str_30:
	.ascii " [OK]"
	.db 0x00
___str_31:
	.ascii " [Skipped]"
	.db 0x00
___str_32:
	.db 0x0a
	.db 0x0a
	.ascii "    %i File(s) Copied"
	.db 0x00
;fat.c:933: FRESULT Copy(void)
;	---------------------------------
; Function Copy
; ---------------------------------
_Copy::
	call	___sdcc_enter_ix
	ld	hl, #-1122
	add	hl, sp
	ld	sp, hl
;fat.c:941: szSrcPath = strtok(NULL, " ");
	ld	de, #___str_33
	ld	hl, #0x0000
	call	_strtok
	ld	c, e
	ld	b, d
;fat.c:942: if (szSrcPath == NULL)
	ld	a, b
	or	a, c
	jr	NZ, 00102$
;fat.c:943: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00117$
00102$:
;fat.c:945: szDestPath = strtok(NULL, " ");
	push	bc
	ld	de, #___str_33
	ld	hl, #0x0000
	call	_strtok
	ld	-2 (ix), e
	ld	-1 (ix), d
	pop	bc
;fat.c:946: if (szDestPath == NULL)
	ld	a, -1 (ix)
	or	a, -2 (ix)
	jr	NZ, 00104$
;fat.c:947: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00117$
00104$:
;fat.c:949: fr = FR_OK;
	ld	l, #0x00
;	spillPairReg hl
;	spillPairReg hl
;fat.c:951: if (IsFatPath(szSrcPath))
	push	hl
	push	bc
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	pop	bc
	pop	hl
	ld	a, d
	or	a, e
	jr	Z, 00106$
;fat.c:952: fr = f_mount(&fsSrc, szSrcPath, 1);
	push	bc
	ld	a, #0x01
	push	af
	inc	sp
	ld	e, c
	ld	d, b
	ld	hl, #3
	add	hl, sp
	call	_f_mount
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
	pop	bc
00106$:
;fat.c:954: if ((fr == FR_OK) && (IsFatPath(szDestPath)))
	ld	a, l
	or	a, a
	jr	NZ, 00110$
	push	hl
	push	bc
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	pop	bc
	pop	hl
	ld	a, d
	or	a, e
	jr	Z, 00110$
;fat.c:956: fr = f_mount(&fsDest, szDestPath, 1);
	push	bc
	ld	a, #0x01
	push	af
	inc	sp
	ld	e, -2 (ix)
	ld	d, -1 (ix)
	ld	hl, #563
	add	hl, sp
	call	_f_mount
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
	pop	bc
;fat.c:957: if (fr != FR_OK)
	ld	a, l
	or	a, a
	jr	Z, 00110$
;fat.c:958: return fr;
	ld	a, l
	jr	00117$
00110$:
;fat.c:961: if (fr == FR_OK)
	ld	a, l
	or	a, a
	jr	NZ, 00116$
;fat.c:963: if (IsFatPath(szSrcPath))
	push	bc
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	pop	bc
	ld	a, d
	or	a, e
	jr	Z, 00113$
;fat.c:964: fr = FatCopy(szSrcPath, szDestPath);
	push	bc
	ld	e, -2 (ix)
	ld	d, -1 (ix)
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_FatCopy
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
	pop	bc
	jr	00116$
00113$:
;fat.c:966: fr = CpmCopy(szSrcPath, szDestPath);
	push	bc
	ld	e, -2 (ix)
	ld	d, -1 (ix)
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_CpmCopy
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
	pop	bc
00116$:
;fat.c:969: f_mount(0, szSrcPath, 0);		// unmount ignoring any errors
	push	hl
	xor	a, a
	push	af
	inc	sp
	ld	e, c
	ld	d, b
	ld	hl, #0x0000
	call	_f_mount
	xor	a, a
	push	af
	inc	sp
	ld	e, -2 (ix)
	ld	d, -1 (ix)
	ld	hl, #0x0000
	call	_f_mount
	pop	hl
;fat.c:972: return fr;
	ld	a, l
00117$:
;fat.c:973: }
	ld	sp, ix
	pop	ix
	ret
___str_33:
	.ascii " "
	.db 0x00
;fat.c:975: FRESULT Rename(void)
;	---------------------------------
; Function Rename
; ---------------------------------
_Rename::
	call	___sdcc_enter_ix
	ld	hl, #-1165
	add	hl, sp
	ld	sp, hl
;fat.c:989: szSrcPath = strtok(NULL, " ");
	ld	de, #___str_34
	ld	hl, #0x0000
	call	_strtok
	ld	-7 (ix), e
;fat.c:990: if (szSrcPath == NULL)
	ld	-6 (ix), d
	ld	a, d
	or	a, -7 (ix)
	jr	NZ, 00102$
;fat.c:991: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00133$
00102$:
;fat.c:993: szDestPath = strtok(NULL, " ");
	ld	de, #___str_34
	ld	hl, #0x0000
	call	_strtok
	ld	-5 (ix), e
;fat.c:994: if (szDestPath == NULL)
	ld	-4 (ix), d
	ld	a, d
	or	a, -5 (ix)
	jr	NZ, 00104$
;fat.c:995: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00133$
00104$:
;fat.c:997: fr = SplitPath(szSrcPath, szSrcSpec);
	ld	hl, #624
	add	hl, sp
	ex	de, hl
	ld	l, -7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
;fat.c:998: if (fr != FR_OK)
	or	a, a
;fat.c:999: return fr;
	jp	NZ,00133$
;fat.c:1001: if (!IsFatPath(szSrcPath))
	ld	l, -7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_IsFatPath
	ld	a, d
	or	a, e
	jr	NZ, 00108$
;fat.c:1002: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00133$
00108$:
;fat.c:1004: fr = SplitPath(szDestPath, szDestSpec);
	ld	hl, #636
	add	hl, sp
	ex	de, hl
	ld	l, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
;fat.c:1005: if (fr != FR_OK)
	or	a, a
;fat.c:1006: return fr;
	jp	NZ,00133$
;fat.c:1013: if (*szSrcSpec == '\0')
	ld	hl, #624
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jr	NZ, 00112$
;fat.c:1014: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00133$
00112$:
;fat.c:1019: if (IsWild(szSrcSpec) && (*szDestSpec != '\0'))
	ld	hl, #624
	add	hl, sp
	call	_IsWild
	ld	a, d
	or	a, e
	jr	Z, 00114$
	ld	hl, #636
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jr	Z, 00114$
;fat.c:1020: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00133$
00114$:
;fat.c:1022: fr = f_mount(&fsSrc, szSrcPath, 1);
	ld	a, #0x01
	push	af
	inc	sp
	ld	e, -7 (ix)
	ld	d, -6 (ix)
	ld	hl, #1
	add	hl, sp
	call	_f_mount
;fat.c:1023: if (fr != FR_OK)
	or	a, a
;fat.c:1024: return fr;
	jp	NZ,00133$
;fat.c:1028: fr = f_findfirst(&dir, &fno, szSrcPath, szSrcSpec);
	ld	hl, #624
	add	hl, sp
	push	hl
	ld	l, -7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #606
	add	hl, sp
	ex	de, hl
	ld	hl, #564
	add	hl, sp
	call	_f_findfirst
;fat.c:1030: if (fr == FR_OK)
	ld	-3 (ix), a
	or	a, a
	jr	NZ, 00154$
;fat.c:1031: printf("\nRenaming...\n");
	ld	hl, #___str_36
	call	_puts
;fat.c:1033: while ((fr == FR_OK) && (fno.fname[0]))
00154$:
	xor	a, a
	ld	-2 (ix), a
	ld	-1 (ix), a
00125$:
	ld	a, -3 (ix)
	or	a, a
	jp	NZ, 00127$
	ld	hl, #611
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jp	Z, 00127$
;fat.c:1038: strncpy(szSrcFile, szSrcPath, sizeof(szSrcFile) - 1);
	ld	hl, #648
	add	hl, sp
	ex	de, hl
	ld	l, -7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	bc, #0x00fe
	xor	a, a
00274$:
	cp	a,(hl)
	ldi
	jp	PO, 00273$
	jr	NZ, 00274$
00275$:
	dec	hl
	ldi
	jp	PE, 00275$
00273$:
;fat.c:1039: strncat(szSrcFile, "/", sizeof(szSrcFile) - 1);
	ld	hl, #0x00fe
	push	hl
	ld	de, #___str_37
	ld	hl, #650
	add	hl, sp
	call	_strncat
;fat.c:1040: strncat(szSrcFile, fno.fname, sizeof(szSrcFile) - 1);
	ld	hl, #0x00fe
	push	hl
	ld	hl, #613
	add	hl, sp
	ex	de, hl
	ld	hl, #650
	add	hl, sp
	call	_strncat
;fat.c:1044: strncpy(szDestFile, *szDestPath ? szDestPath : szSrcPath, sizeof(szDestFile) - 1);
	ld	hl, #903
	add	hl, sp
	ex	de, hl
	ld	l, -5 (ix)
	ld	h, -4 (ix)
	ld	a, (hl)
	or	a, a
	jr	Z, 00135$
	ld	l, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	jr	00136$
00135$:
	ld	l, -7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
00136$:
	ld	bc, #0x00fe
	xor	a, a
00277$:
	cp	a,(hl)
	ldi
	jp	PO, 00276$
	jr	NZ, 00277$
00278$:
	dec	hl
	ldi
	jp	PE, 00278$
00276$:
;fat.c:1045: strncat(szDestFile, "/", sizeof(szDestFile) - 1);
	ld	hl, #0x00fe
	push	hl
	ld	de, #___str_37
	ld	hl, #905
	add	hl, sp
	call	_strncat
;fat.c:1046: strncat(szDestFile, (*szDestSpec == '\0') ? fno.fname : szDestSpec, sizeof(szDestFile) - 1);
	ld	hl, #636
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jr	NZ, 00137$
	ld	hl, #611
	add	hl, sp
	ex	de, hl
	jr	00138$
00137$:
	ld	hl, #636
	add	hl, sp
	ex	de, hl
00138$:
	ld	hl, #0x00fe
	push	hl
	ld	hl, #905
	add	hl, sp
	call	_strncat
;fat.c:1048: printf("\n%s ==> %s", szSrcFile, szDestFile);
	ld	hl, #903
	add	hl, sp
	push	hl
	ld	hl, #650
	add	hl, sp
	push	hl
	ld	hl, #___str_38
	push	hl
	call	_printf
	pop	af
	pop	af
	pop	af
;fat.c:1050: fr = f_rename(szSrcFile, szDestFile);
	ld	hl, #903
	add	hl, sp
	ex	de, hl
	ld	hl, #648
	add	hl, sp
	call	_f_rename
;fat.c:1051: if (fr == FR_OK)
	ld	-3 (ix), a
	or	a, a
	jr	NZ, 00121$
;fat.c:1052: nFiles++;
	inc	-2 (ix)
	jr	NZ, 00279$
	inc	-1 (ix)
00279$:
00121$:
;fat.c:1054: if (fr == FR_OK)
	ld	a, -3 (ix)
	or	a, a
	jp	NZ, 00125$
;fat.c:1055: fr = f_findnext(&dir, &fno);
	ld	hl, #602
	add	hl, sp
	ex	de, hl
	ld	hl, #560
	add	hl, sp
	call	_f_findnext
	ld	-3 (ix), a
	jp	00125$
00127$:
;fat.c:1058: f_mount(0, szSrcPath, 0);		// unmount ignoring any errors
	xor	a, a
	push	af
	inc	sp
	ld	e, -7 (ix)
	ld	d, -6 (ix)
	ld	hl, #0x0000
	call	_f_mount
;fat.c:1060: if (fr != FR_OK)
	ld	a, -3 (ix)
	or	a, a
	jr	Z, 00129$
;fat.c:1061: return fr;
	ld	a, -3 (ix)
	jr	00133$
00129$:
;fat.c:1063: if (nFiles)
	ld	a, -1 (ix)
	or	a, -2 (ix)
	jr	Z, 00131$
;fat.c:1064: printf("\n\n    %i File(s) Renamed", nFiles);
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #___str_39
	push	hl
	call	_printf
	pop	af
	pop	af
	jr	00132$
00131$:
;fat.c:1066: fr = FR_NO_FILE;
	ld	-3 (ix), #0x04
00132$:
;fat.c:1068: return fr;
	ld	a, -3 (ix)
00133$:
;fat.c:1069: }
	ld	sp, ix
	pop	ix
	ret
___str_34:
	.ascii " "
	.db 0x00
___str_36:
	.db 0x0a
	.ascii "Renaming..."
	.db 0x00
___str_37:
	.ascii "/"
	.db 0x00
___str_38:
	.db 0x0a
	.ascii "%s ==> %s"
	.db 0x00
___str_39:
	.db 0x0a
	.db 0x0a
	.ascii "    %i File(s) Renamed"
	.db 0x00
;fat.c:1071: FRESULT Delete(void)
;	---------------------------------
; Function Delete
; ---------------------------------
_Delete::
	call	___sdcc_enter_ix
	ld	hl, #-898
	add	hl, sp
	ld	sp, hl
;fat.c:1081: nFiles = 0;
	xor	a, a
	ld	-7 (ix), a
	ld	-6 (ix), a
;fat.c:1083: szPath = strtok(NULL, " ");
	ld	de, #___str_40
	ld	hl, #0x0000
	call	_strtok
	ld	-5 (ix), e
;fat.c:1084: if (szPath == NULL)
	ld	-4 (ix), d
	ld	a, d
	or	a, -5 (ix)
	jr	NZ, 00102$
;fat.c:1085: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00122$
00102$:
;fat.c:1087: fr = f_mount(&fs, szPath, 0);
	xor	a, a
	push	af
	inc	sp
	ld	e, -5 (ix)
	ld	d, -4 (ix)
	ld	hl, #1
	add	hl, sp
	call	_f_mount
;fat.c:1088: if (fr != FR_OK)
	or	a, a
;fat.c:1089: return fr;
	jp	NZ,00122$
;fat.c:1091: fr = SplitPath(szPath, szFileSpec);
	ld	hl, #624
	add	hl, sp
	ld	e, l
	ld	d, h
	push	hl
	ld	l, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	_SplitPath
	pop	hl
;fat.c:1092: if (fr != FR_OK)
;fat.c:1093: return fr;
;fat.c:1095: if (*szFileSpec == '\0')
	or	a, a
	jp	NZ, 00122$
	or	a, (hl)
	jr	NZ, 00108$
;fat.c:1096: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jp	00122$
00108$:
;fat.c:1100: fr = f_findfirst(&dir, &fno, szPath, szFileSpec);
	ex	de, hl
	push	de
	ld	l, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #606
	add	hl, sp
	ex	de, hl
	ld	hl, #564
	add	hl, sp
	call	_f_findfirst
;fat.c:1102: if (fr == FR_OK)
	ld	-3 (ix), a
	or	a, a
	jr	NZ, 00132$
;fat.c:1103: printf("\nDeleting...\n");
	ld	hl, #___str_42
	call	_puts
;fat.c:1105: while ((fr == FR_OK) && (fno.fname[0]))
00132$:
	xor	a, a
	ld	-2 (ix), a
	ld	-1 (ix), a
00114$:
	ld	a, -3 (ix)
	or	a, a
	jp	NZ, 00116$
	ld	hl, #611
	add	hl, sp
	ld	a, (hl)
	or	a, a
	jr	Z, 00116$
;fat.c:1109: strncpy(szDelFile, szPath, sizeof(szDelFile) - 1);
	ld	hl, #636
	add	hl, sp
	ex	de, hl
	ld	l, -5 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -4 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	bc, #0x00fe
	xor	a, a
00202$:
	cp	a,(hl)
	ldi
	jp	PO, 00201$
	jr	NZ, 00202$
00203$:
	dec	hl
	ldi
	jp	PE, 00203$
00201$:
;fat.c:1110: strncat(szDelFile, "/", sizeof(szDelFile) - 1);
	ld	hl, #0x00fe
	push	hl
	ld	de, #___str_43
	ld	hl, #638
	add	hl, sp
	call	_strncat
;fat.c:1111: strncat(szDelFile, fno.fname, sizeof(szDelFile) - 1);
	ld	hl, #0x00fe
	push	hl
	ld	hl, #613
	add	hl, sp
	ex	de, hl
	ld	hl, #638
	add	hl, sp
	call	_strncat
;fat.c:1113: printf("\n%s", szDelFile);
	ld	hl, #636
	add	hl, sp
	push	hl
	ld	hl, #___str_44
	push	hl
	call	_printf
	pop	af
	pop	af
;fat.c:1115: fr = f_unlink(szDelFile);
	ld	hl, #636
	add	hl, sp
	call	_f_unlink
;fat.c:1116: if (fr != FR_OK)
	or	a, a
;fat.c:1117: return fr;
	jr	NZ, 00122$
;fat.c:1119: nFiles++;
	inc	-2 (ix)
	jr	NZ, 00204$
	inc	-1 (ix)
00204$:
	ld	a, -2 (ix)
	ld	-7 (ix), a
	ld	a, -1 (ix)
	ld	-6 (ix), a
;fat.c:1121: fr = f_findnext(&dir, &fno);
	ld	hl, #602
	add	hl, sp
	ex	de, hl
	ld	hl, #560
	add	hl, sp
	call	_f_findnext
	ld	-3 (ix), a
	jp	00114$
00116$:
;fat.c:1124: f_mount(0, szPath, 0);		// unmount ignoring any errors
	xor	a, a
	push	af
	inc	sp
	ld	e, -5 (ix)
	ld	d, -4 (ix)
	ld	hl, #0x0000
	call	_f_mount
;fat.c:1126: if (fr != FR_OK)
	ld	a, -3 (ix)
	or	a, a
	jr	Z, 00118$
;fat.c:1127: return fr;
	ld	a, -3 (ix)
	jr	00122$
00118$:
;fat.c:1129: if (nFiles)
	ld	a, -6 (ix)
	or	a, -7 (ix)
	jr	Z, 00120$
;fat.c:1130: printf("\n\n    %i File(s) Deleted", nFiles);
	ld	l, -7 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -6 (ix)
;	spillPairReg hl
;	spillPairReg hl
	push	hl
	ld	hl, #___str_45
	push	hl
	call	_printf
	pop	af
	pop	af
	jr	00121$
00120$:
;fat.c:1132: fr = FR_NO_FILE;
	ld	-3 (ix), #0x04
00121$:
;fat.c:1134: return fr;
	ld	a, -3 (ix)
00122$:
;fat.c:1135: }
	ld	sp, ix
	pop	ix
	ret
___str_40:
	.ascii " "
	.db 0x00
___str_42:
	.db 0x0a
	.ascii "Deleting..."
	.db 0x00
___str_43:
	.ascii "/"
	.db 0x00
___str_44:
	.db 0x0a
	.ascii "%s"
	.db 0x00
___str_45:
	.db 0x0a
	.db 0x0a
	.ascii "    %i File(s) Deleted"
	.db 0x00
;fat.c:1137: FRESULT MakeDir(void)
;	---------------------------------
; Function MakeDir
; ---------------------------------
_MakeDir::
	call	___sdcc_enter_ix
	ld	hl, #-560
	add	hl, sp
	ld	sp, hl
;fat.c:1143: szPath = strtok(NULL, " ");
	ld	de, #___str_46
	ld	hl, #0x0000
	call	_strtok
	ld	c, e
	ld	b, d
;fat.c:1144: if (szPath == NULL)
	ld	a, b
	or	a, c
	jr	NZ, 00102$
;fat.c:1145: return FR_INVALID_PARAMETER;
	ld	a, #0x13
	jr	00105$
00102$:
;fat.c:1147: fr = f_mount(&fs, szPath, 0);
	push	bc
	xor	a, a
	push	af
	inc	sp
	ld	e, c
	ld	d, b
	ld	hl, #3
	add	hl, sp
	call	_f_mount
	pop	bc
;fat.c:1148: if (fr != FR_OK)
	or	a, a
;fat.c:1149: return fr;
	jr	NZ, 00105$
;fat.c:1151: fr = f_mkdir(szPath);
	push	bc
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_f_mkdir
	ld	e, a
	pop	bc
;fat.c:1153: f_mount(0, szPath, 0);		// unmount ignoring any errors
	push	de
	xor	a, a
	push	af
	inc	sp
	ld	e, c
	ld	d, b
	ld	hl, #0x0000
	call	_f_mount
	pop	de
;fat.c:1155: return fr;
	ld	a, e
00105$:
;fat.c:1156: }
	ld	sp, ix
	pop	ix
	ret
___str_46:
	.ascii " "
	.db 0x00
;fat.c:1226: FRESULT Info(void)
;	---------------------------------
; Function Info
; ---------------------------------
_Info::
	call	___sdcc_enter_ix
	push	af
	push	af
;fat.c:1229: disk_initialize(0);
	xor	a, a
	call	_disk_initialize
;fat.c:1230: disk_ioctl(0, GET_SECTOR_COUNT, &size);
	ld	hl, #0
	add	hl, sp
	push	hl
	ld	l, #0x01
;	spillPairReg hl
;	spillPairReg hl
	xor	a, a
	call	_disk_ioctl
;fat.c:1231: printf("\nUSB number 512 byte sectors: %08lX hex", size); //((uint64_t)size * 512) );
	pop	de
	pop	hl
	ex	de, hl
	push	de
	push	hl
	push	de
	push	hl
	ld	hl, #___str_47
	push	hl
	call	_printf
	pop	af
	pop	af
;fat.c:1232: printf("\nUSB size: %llu GB", (size / 2000000) );
	ld	hl, #0x001e
	ex	(sp),hl
	ld	hl, #0x8480
	push	hl
	ld	e, -4 (ix)
	ld	d, -3 (ix)
	ld	l, -2 (ix)
;	spillPairReg hl
;	spillPairReg hl
	ld	h, -1 (ix)
;	spillPairReg hl
;	spillPairReg hl
	call	__divulong
	pop	af
	pop	af
	ld	bc, #___str_48+0
	push	hl
	push	de
	push	bc
	call	_printf
	pop	af
	pop	af
	pop	af
;fat.c:1233: return FR_OK;
	xor	a, a
;fat.c:1234: }
	ld	sp, ix
	pop	ix
	ret
___str_47:
	.db 0x0a
	.ascii "USB number 512 byte sectors: %08lX hex"
	.db 0x00
___str_48:
	.db 0x0a
	.ascii "USB size: %llu GB"
	.db 0x00
;fat.c:1236: int main(int argc, char * argv[])
;	---------------------------------
; Function main
; ---------------------------------
_main::
	push	ix
	ld	ix,#0
	add	ix,sp
	push	af
	push	af
;fat.c:1245: if (argc != 2)
	ld	a, l
	sub	a, #0x02
	or	a, h
	jr	Z, 00102$
;fat.c:1246: return Usage();
	call	_Usage
	jp	00125$
00102$:
;fat.c:1248: tok = strtok(argv[1], " ");
	ex	de, hl
	inc	hl
	inc	hl
	ld	a, (hl)
	inc	hl
	ld	h, (hl)
;	spillPairReg hl
	ld	l, a
;	spillPairReg hl
;	spillPairReg hl
	ld	de, #___str_49
	call	_strtok
	ld	c, e
	ld	b, d
;fat.c:1250: if (tok == NULL)
	ld	a, b
	or	a, c
	jr	NZ, 00104$
;fat.c:1251: return Usage();
	call	_Usage
	jp	00125$
00104$:
;fat.c:1261: disk_initialize(0);
	push	bc
	xor	a, a
	call	_disk_initialize
	ld	hl, #2
	add	hl, sp
	push	hl
	ld	l, #0x01
;	spillPairReg hl
;	spillPairReg hl
	xor	a, a
	call	_disk_ioctl
	pop	bc
;fat.c:1264: strupr(tok);
	push	bc
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_strupr
	pop	bc
;fat.c:1266: if (!strcmp(tok, "DIR"))
	push	bc
	ld	de, #___str_50
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_strcmp
	pop	bc
	ld	a, d
	or	a, e
	jr	NZ, 00121$
;fat.c:1267: fr = Dir();
	call	_Dir
	ld	c, a
	jr	00122$
00121$:
;fat.c:1268: else if (!strcmp(tok, "COPY"))
	push	bc
	ld	de, #___str_51
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_strcmp
	pop	bc
	ld	a, d
	or	a, e
	jr	NZ, 00118$
;fat.c:1269: fr = Copy();
	call	_Copy
	ld	c, a
	jr	00122$
00118$:
;fat.c:1270: else if (!strcmp(tok, "REN"))
	push	bc
	ld	de, #___str_52
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_strcmp
	pop	bc
	ld	a, d
	or	a, e
	jr	NZ, 00115$
;fat.c:1271: fr = Rename();
	call	_Rename
	ld	c, a
	jr	00122$
00115$:
;fat.c:1272: else if (!strcmp(tok, "DEL"))
	push	bc
	ld	de, #___str_53
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_strcmp
	pop	bc
	ld	a, d
	or	a, e
	jr	NZ, 00112$
;fat.c:1273: fr = Delete();
	call	_Delete
	ld	c, a
	jr	00122$
00112$:
;fat.c:1274: else if (!strcmp(tok, "MD"))
	push	bc
	ld	de, #___str_54
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_strcmp
	pop	bc
	ld	a, d
	or	a, e
	jr	NZ, 00109$
;fat.c:1275: fr = MakeDir();
	call	_MakeDir
	ld	c, a
	jr	00122$
00109$:
;fat.c:1278: else if (!strcmp(tok, "INFO"))
	ld	de, #___str_55
	ld	l, c
;	spillPairReg hl
;	spillPairReg hl
	ld	h, b
;	spillPairReg hl
;	spillPairReg hl
	call	_strcmp
	ld	a, d
	or	a, e
	jr	NZ, 00106$
;fat.c:1279: fr = Info();
	call	_Info
	ld	c, a
	jr	00122$
00106$:
;fat.c:1281: fr = FR_INVALID_PARAMETER;
	ld	c, #0x13
00122$:
;fat.c:1283: if (fr != FR_OK)
	ld	a, c
	or	a, a
	jr	Z, 00124$
;fat.c:1284: return Error(fr);
	ld	a, c
	call	_Error
	jr	00125$
00124$:
;fat.c:1286: printf("\n");
	ld	hl, #___str_57
	call	_puts
;fat.c:1288: return 0;
	ld	de, #0x0000
00125$:
;fat.c:1289: }
	ld	sp, ix
	pop	ix
	ret
___str_49:
	.ascii " "
	.db 0x00
___str_50:
	.ascii "DIR"
	.db 0x00
___str_51:
	.ascii "COPY"
	.db 0x00
___str_52:
	.ascii "REN"
	.db 0x00
___str_53:
	.ascii "DEL"
	.db 0x00
___str_54:
	.ascii "MD"
	.db 0x00
___str_55:
	.ascii "INFO"
	.db 0x00
___str_57:
	.db 0x00
	.area _CODE
___str_58:
	.ascii "Successful Completion"
	.db 0x00
___str_59:
	.ascii "Disk I/O Error"
	.db 0x00
___str_60:
	.ascii "Internal Error - Assertion Failed"
	.db 0x00
___str_61:
	.ascii "Drive Not Ready"
	.db 0x00
___str_62:
	.ascii "File Not Found"
	.db 0x00
___str_63:
	.ascii "Path Not Found"
	.db 0x00
___str_64:
	.ascii "Invalid Path Name"
	.db 0x00
___str_65:
	.ascii "Access Denied"
	.db 0x00
___str_66:
	.ascii "Exists"
	.db 0x00
___str_67:
	.ascii "Invalid Object"
	.db 0x00
___str_68:
	.ascii "Write Protected"
	.db 0x00
___str_69:
	.ascii "Invalid Drive"
	.db 0x00
___str_70:
	.ascii "Volume Not Mounted"
	.db 0x00
___str_71:
	.ascii "No Filesystem on Drive"
	.db 0x00
___str_72:
	.ascii "Make Filesystem Failed"
	.db 0x00
___str_73:
	.ascii "Timeout"
	.db 0x00
___str_74:
	.ascii "Locked"
	.db 0x00
___str_75:
	.ascii "Insufficient Memory"
	.db 0x00
___str_76:
	.ascii "Too Many Open Files"
	.db 0x00
___str_77:
	.ascii "Invalid Parameter"
	.db 0x00
	.area _INITIALIZER
__xinit__ErrTab:
	.dw ___str_58
	.dw ___str_59
	.dw ___str_60
	.dw ___str_61
	.dw ___str_62
	.dw ___str_63
	.dw ___str_64
	.dw ___str_65
	.dw ___str_66
	.dw ___str_67
	.dw ___str_68
	.dw ___str_69
	.dw ___str_70
	.dw ___str_71
	.dw ___str_72
	.dw ___str_73
	.dw ___str_74
	.dw ___str_75
	.dw ___str_76
	.dw ___str_77
	.area _CABS (ABS)
