	SECTION _TEXT align=1 CLASS=CODE USE32
	SECTION _DATA align=16 CLASS=DATA USE32
	SECTION _BSS align=16 CLASS=BSS USE32
	SECTION _CONST align=16 CLASS=CONST USE32
	SECTION _STRING align=4 CLASS=STRING USE32
	SECTION cstartup align=4 CLASS=INITDATA USE32
	SECTION crundown align=4 CLASS=EXITDATA USE32
	SECTION cppinit  align=4 CLASS=CPPINIT USE32
	SECTION cppexit  align=4 CLASS=CPPEXIT USE32
	GROUP DGROUP _DATA _BSS _CONST _STRING

SECTION _TEXT
[GLOBAL	_OpenFileDialogBox]
;
; Line 21:	BOOL OpenFileDialogBox(char *Fspec, char *Fname)
;
_OpenFileDialogBox:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD [EBP+08H]
L_2:
;
; Line 22:	{
;
;
; Line 23:	return DlgFileOpen(Fspec, Fspec, Fname, &FileOpen);
;
	PUSH	DWORD _FileOpen
	PUSH	DWORD [EBP+0CH]
	PUSH	EBX
	PUSH	EBX
	CALL	_DlgFileOpen
	ADD	ESP,BYTE 010H
L_1:
	POP	EBX
	POP	EBP
	RET
[GLOBAL	_SaveAsDialogBox]
;
; Line 29:	BOOL SaveAsDialogBox(char *Fspec, char *Sspec, char *Fname)
;
_SaveAsDialogBox:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	MOV	EBX,DWORD [EBP+08H]
	MOV	ESI,DWORD [EBP+0CH]
L_4:
;
; Line 30:	{
;
;
; Line 31:	return DlgFileOpen(Fspec, Sspec ? Sspec : Fspec, Fname, &SaveAs);
;
	PUSH	DWORD _SaveAs
	PUSH	DWORD [EBP+010H]
	TEST	ESI,ESI
	JE	SHORT	L_5
	MOV	EAX,ESI
	JMP	SHORT	L_6
L_5:
	MOV	EAX,EBX
L_6:
	PUSH	EAX
	PUSH	EBX
	CALL	_DlgFileOpen
	ADD	ESP,BYTE 010H
L_3:
	POP	ESI
	POP	EBX
	POP	EBP
	RET
;
; Line 35:	static BOOL DlgFileOpen(char *Fspec, char *Sspec, char *Fname, DBOX *db)
;
_DlgFileOpen:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
L_8:
;
; Line 36:	{
;
;
; Line 39:	strncpy(FileSpec, Fspec, 15);
;
	PUSH	BYTE 0FH
	PUSH	DWORD [EBP+08H]
	PUSH	DWORD _FileSpec
	CALL	_strncpy
	ADD	ESP,BYTE 0CH
;
; Line 40:	strncpy(SrchSpec, Sspec, 15);
;
	PUSH	BYTE 0FH
	PUSH	DWORD [EBP+0CH]
	PUSH	DWORD _SrchSpec
	CALL	_strncpy
	ADD	ESP,BYTE 0CH
;
; Line 42:	if ((rtn = DialogBox(NULL, db, TRUE, DlgFnOpen)) != FALSE)
;
	PUSH	DWORD _DlgFnOpen
	PUSH	BYTE 01H
	PUSH	DWORD [EBP+014H]
	PUSH	BYTE 00H
	CALL	_DialogBox
	ADD	ESP,BYTE 010H
	MOV	EBX,EAX
	TEST	EAX,EAX
	JE	SHORT	L_9
;
; Line 43:	strcpy(Fname, FileName);
;
	PUSH	DWORD _FileName
	PUSH	DWORD [EBP+010H]
	CALL	_strcpy
	ADD	ESP,BYTE 08H
L_9:
;
; Line 45:	return rtn;
;
	MOV	EAX,EBX
L_7:
	POP	EBX
	POP	EBP
	RET
;
; Line 51:	static int DlgFnOpen(WINDOW wnd,MESSAGE msg,PARAM p1,PARAM p2)
;
_DlgFnOpen:
	PUSH	EBP
	MOV	EBP,ESP
	SUB	ESP,031CH
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
	MOV	EBX,DWORD [EBP+014H]
	MOV	EDI,DWORD _FileSpec
L_12:
;
; Line 52:	{
;
;
; Line 53:	switch (msg)    {
;
	MOV	EAX,DWORD [EBP+0CH]
	CMP	EAX,BYTE 02H
	JE	NEAR	L_17
	CMP	EAX,BYTE 03H
	JE	SHORT	L_15
	CMP	EAX,BYTE 048H
	JE	NEAR	L_16
	JMP	NEAR	L_14
L_15:
;
; Line 55:	int rtn = DefaultWndProc(wnd, msg, p1, p2);
;
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CMP	DWORD [EAX+04H+_classdefs+00H],BYTE 00H
	JNE	SHORT	L_18
	PUSH	EBX
	PUSH	DWORD [EBP+010H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	MOV	EAX,DWORD [EAX+_classdefs+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_19
L_18:
	PUSH	EBX
	PUSH	DWORD [EBP+010H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_19:
	MOV	DWORD [EBP-0CH],EAX
;
; Line 56:	DBOX *db = wnd->extension;
;
	MOV	EAX,DWORD [ESI+06CH]
	MOV	DWORD [EBP-08H],EAX
;
; Line 57:	WINDOW cwnd = ControlWindow(db, ID_FILENAME);
;
	PUSH	BYTE 02AH
	PUSH	DWORD [EBP-08H]
	CALL	_ControlWindow
	ADD	ESP,BYTE 08H
	MOV	DWORD [EBP-04H],EAX
;
; Line 58:	SendMessage(cwnd, SETTEXTLENGTH, 64, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 040H
	PUSH	BYTE 03BH
	PUSH	DWORD [EBP-04H]
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 59:	return rtn;
;
	MOV	EAX,DWORD [EBP-0CH]
	JMP	NEAR	L_11
L_16:
;
; Line 62:	InitDlgBox(wnd);
;
	PUSH	ESI
	CALL	_InitDlgBox
	POP	ECX
;
; Line 63:	break;
;
	JMP	NEAR	L_13
L_17:
;
; Line 65:	switch ((int) p1)    {
;
	MOV	EAX,DWORD [EBP+010H]
	CMP	EAX,BYTE 02BH
	JE	NEAR	L_23
	CMP	EAX,BYTE 02CH
	JE	NEAR	L_24
	CMP	EAX,BYTE 02DH
	JE	NEAR	L_25
	CMP	EAX,BYTE 034H
	JE	SHORT	L_22
	JMP	NEAR	L_21
L_22:
;
; Line 68:	if ((int)p2 == 0)	{
;
	TEST	EBX,EBX
	JNE	NEAR	L_26
;
; Line 72:	GetItemText(wnd, ID_FILENAME, fn, MAXPATH);
;
	PUSH	DWORD 0104H
	LEA	EAX,[EBP-0314H]
	PUSH	EAX
	PUSH	BYTE 02AH
	PUSH	ESI
	CALL	_GetItemText
	ADD	ESP,BYTE 010H
;
; Line 73:	fnsplit(fn, NULL, NULL, nm, ext);
;
	LEA	EAX,[EBP-010CH]
	PUSH	EAX
	LEA	EAX,[EBP-020CH]
	PUSH	EAX
	PUSH	BYTE 00H
	PUSH	BYTE 00H
	LEA	EAX,[EBP-0314H]
	PUSH	EAX
	CALL	_fnsplit
	ADD	ESP,BYTE 014H
;
; Line 74:	strcpy(FileName, nm);
;
	LEA	EAX,[EBP-020CH]
	PUSH	EAX
	PUSH	DWORD _FileName
	CALL	_strcpy
	ADD	ESP,BYTE 08H
;
; Line 75:	strcat(FileName, ext);
;
	LEA	EAX,[EBP-010CH]
	PUSH	EAX
	PUSH	DWORD _FileName
	CALL	_strcat
	ADD	ESP,BYTE 08H
;
; Line 76:	CreatePath(NULL, fn, FALSE, TRUE);
;
	PUSH	BYTE 01H
	PUSH	BYTE 00H
	LEA	EAX,[EBP-0314H]
	PUSH	EAX
	PUSH	BYTE 00H
	CALL	_CreatePath
	ADD	ESP,BYTE 010H
;
; Line 77:	if (IncompleteFilename(FileName))    {
;
	PUSH	DWORD _FileName
	CALL	_IncompleteFilename
	POP	ECX
	TEST	EAX,EAX
	JE	SHORT	L_28
;
; Line 79:	DBOX *db = wnd->extension;
;
	MOV	EAX,DWORD [ESI+06CH]
	MOV	DWORD [EBP-031CH],EAX
;
; Line 80:	WINDOW cwnd = ControlWindow(db, ID_FILENAME);
;
	PUSH	BYTE 02AH
	PUSH	DWORD [EBP-031CH]
	CALL	_ControlWindow
	ADD	ESP,BYTE 08H
	MOV	DWORD [EBP-0318H],EAX
;
; Line 81:	strcpy(FileSpec, FileName);
;
	PUSH	DWORD _FileName
	PUSH	EDI
	CALL	_strcpy
	ADD	ESP,BYTE 08H
;
; Line 82:	strcpy(SrchSpec, FileName);
;
	PUSH	DWORD _FileName
	PUSH	DWORD _SrchSpec
	CALL	_strcpy
	ADD	ESP,BYTE 08H
;
; Line 83:	InitDlgBox(wnd);
;
	PUSH	ESI
	CALL	_InitDlgBox
	POP	ECX
;
; Line 84:	SendMessage(cwnd, SETFOCUS, TRUE, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 01H
	PUSH	BYTE 08H
	PUSH	DWORD [EBP-0318H]
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 85:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_11
L_28:
L_26:
;
; Line 88:	break;
;
	JMP	NEAR	L_20
L_23:
;
; Line 91:	switch ((int) p2)    {
;
	CMP	EBX,BYTE 040H
	JE	SHORT	L_33
	CMP	EBX,BYTE 041H
	JE	SHORT	L_34
	CMP	EBX,BYTE 049H
	JE	SHORT	L_32
	JMP	SHORT	L_31
L_32:
;
; Line 93:	case LB_SELECTION:
;
L_33:
;
; Line 95:	GetDlgListText(wnd, FileName, ID_FILES);
;
	PUSH	BYTE 02BH
	PUSH	DWORD _FileName
	PUSH	ESI
	CALL	_GetDlgListText
	ADD	ESP,BYTE 0CH
;
; Line 96:	PutItemText(wnd, ID_FILENAME, FileName);
;
	PUSH	DWORD _FileName
	PUSH	BYTE 02AH
	PUSH	ESI
	CALL	_PutItemText
	ADD	ESP,BYTE 0CH
;
; Line 97:	break;
;
	JMP	SHORT	L_30
L_34:
;
; Line 100:	GetDlgListText(wnd, FileName, ID_FILES);
;
	PUSH	BYTE 02BH
	PUSH	DWORD _FileName
	PUSH	ESI
	CALL	_GetDlgListText
	ADD	ESP,BYTE 0CH
;
; Line 101:	SendMessage(wnd, COMMAND, ID_OK, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 034H
	PUSH	BYTE 02H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 102:	break;
;
	JMP	SHORT	L_30
L_31:
;
; Line 104:	break;
;
	JMP	SHORT	L_30
L_30:
;
; Line 106:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_11
L_24:
;
; Line 108:	switch ((int) p2)    {
;
	CMP	EBX,BYTE 041H
	JE	SHORT	L_38
	CMP	EBX,BYTE 049H
	JE	SHORT	L_37
	JMP	SHORT	L_36
L_37:
;
; Line 110:	PutItemText(wnd, ID_FILENAME, FileSpec);
;
	PUSH	EDI
	PUSH	BYTE 02AH
	PUSH	ESI
	CALL	_PutItemText
	ADD	ESP,BYTE 0CH
;
; Line 111:	break;
;
	JMP	SHORT	L_35
L_38:
;
; Line 116:	GetDlgListText(wnd, dd, ID_DIRECTORY);
;
	PUSH	BYTE 02CH
	LEA	EAX,[EBP-01CH]
	PUSH	EAX
	PUSH	ESI
	CALL	_GetDlgListText
	ADD	ESP,BYTE 0CH
;
; Line 117:	chdir(dd);
;
	LEA	EAX,[EBP-01CH]
	PUSH	EAX
	CALL	_chdir
	POP	ECX
;
; Line 118:	InitDlgBox(wnd);
;
	PUSH	ESI
	CALL	_InitDlgBox
	POP	ECX
;
; Line 119:	SendMessage(wnd, COMMAND, ID_OK, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 034H
	PUSH	BYTE 02H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 120:	break;
;
	JMP	SHORT	L_35
L_36:
;
; Line 123:	break;
;
	JMP	SHORT	L_35
L_35:
;
; Line 125:	return TRUE;
;
	MOV	EAX,01H
	JMP	NEAR	L_11
L_25:
;
; Line 128:	switch ((int) p2)    {
;
	CMP	EBX,BYTE 041H
	JE	SHORT	L_42
	CMP	EBX,BYTE 049H
	JE	SHORT	L_41
	JMP	SHORT	L_40
L_41:
;
; Line 130:	PutItemText(wnd, ID_FILENAME, FileSpec);
;
	PUSH	EDI
	PUSH	BYTE 02AH
	PUSH	ESI
	CALL	_PutItemText
	ADD	ESP,BYTE 0CH
;
; Line 131:	break;
;
	JMP	SHORT	L_39
L_42:
;
; Line 136:	GetDlgListText(wnd, dr, ID_DRIVE);
;
	PUSH	BYTE 02DH
	LEA	EAX,[EBP-01CH]
	PUSH	EAX
	PUSH	ESI
	CALL	_GetDlgListText
	ADD	ESP,BYTE 0CH
;
; Line 137:	setdisk(*dr - 'A');
;
	MOVSX	EAX,BYTE [EBP-01CH]
	SUB	EAX,BYTE 041H
	PUSH	EAX
	CALL	_setdisk
	POP	ECX
;
; Line 138:	InitDlgBox(wnd);
;
	PUSH	ESI
	CALL	_InitDlgBox
	POP	ECX
;
; Line 139:	SendMessage(wnd, COMMAND, ID_OK, 0);
;
	PUSH	BYTE 00H
	PUSH	BYTE 034H
	PUSH	BYTE 02H
	PUSH	ESI
	CALL	_SendMessage
	ADD	ESP,BYTE 010H
;
; Line 141:	default:
;
L_40:
;
; Line 142:	break;
;
	JMP	SHORT	L_39
L_39:
;
; Line 144:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_11
L_21:
;
; Line 147:	break;
;
	JMP	SHORT	L_20
L_20:
;
; Line 149:	default:
;
L_14:
;
; Line 150:	break;
;
	JMP	SHORT	L_13
L_13:
;
; Line 152:	return DefaultWndProc(wnd, msg, p1, p2);
;
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CMP	DWORD [EAX+04H+_classdefs+00H],BYTE 00H
	JNE	SHORT	L_43
	PUSH	EBX
	PUSH	DWORD [EBP+010H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	MOV	EAX,DWORD [EAX+_classdefs+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
	JMP	SHORT	L_44
L_43:
	PUSH	EBX
	PUSH	DWORD [EBP+010H]
	MOVSX	EAX,WORD [EBP+0CH]
	PUSH	EAX
	PUSH	ESI
	MOV	EAX,DWORD [ESI+00H]
	IMUL	EAX,BYTE 0CH
	CALL	DWORD [EAX+04H+_classdefs+00H]
	ADD	ESP,BYTE 010H
L_44:
L_11:
	POP	EDI
	POP	ESI
	POP	EBX
	MOV	ESP,EBP
	POP	EBP
	RET
;
; Line 163:	static void InitDlgBox(WINDOW wnd)
;
_InitDlgBox:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	MOV	EBX,DWORD [EBP+08H]
L_46:
;
; Line 164:	{
;
;
; Line 165:	if (*FileSpec)
;
	CMP	BYTE [_FileSpec],BYTE 00H
	JE	SHORT	L_47
;
; Line 166:	PutItemText(wnd, ID_FILENAME, FileSpec);
;
	PUSH	DWORD _FileSpec
	PUSH	BYTE 02AH
	PUSH	EBX
	CALL	_PutItemText
	ADD	ESP,BYTE 0CH
L_47:
;
; Line 167:	if (BuildFileList(wnd, SrchSpec))
;
	PUSH	DWORD _SrchSpec
	PUSH	EBX
	CALL	_BuildFileList
	ADD	ESP,BYTE 08H
	TEST	EAX,EAX
	JE	SHORT	L_49
;
; Line 168:	BuildDirectoryList(wnd);
;
	PUSH	EBX
	CALL	_BuildDirectoryList
	POP	ECX
L_49:
;
; Line 169:	BuildDriveList(wnd);
;
	PUSH	EBX
	CALL	_BuildDriveList
	POP	ECX
;
; Line 170:	BuildPathDisplay(wnd);
;
	PUSH	EBX
	CALL	_BuildPathDisplay
	POP	ECX
;
; Line 171:	}
;
L_45:
	POP	EBX
	POP	EBP
	RET
;
; Line 176:	static void StripPath(char *filespec)
;
_StripPath:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	EBX
	PUSH	ESI
	PUSH	EDI
	MOV	EDI,DWORD [EBP+08H]
L_52:
;
; Line 177:	{
;
;
; Line 180:	cp = strchr(filespec, ':');
;
	PUSH	BYTE 03AH
	PUSH	EDI
	CALL	_strchr
	ADD	ESP,BYTE 08H
	MOV	EBX,EAX
;
; Line 181:	if (cp != NULL)
;
	TEST	EBX,EBX
	JE	SHORT	L_53
;
; Line 182:	cp++;
;
	INC	EBX
	JMP	SHORT	L_54
L_53:
;
; Line 184:	cp = filespec;
;
	MOV	EBX,EDI
L_54:
	JMP	SHORT	L_55
L_57:
;
; Line 186:	cp1 = strchr(cp, '\\');
;
	PUSH	BYTE 05CH
	PUSH	EBX
	CALL	_strchr
	ADD	ESP,BYTE 08H
	MOV	ESI,EAX
;
; Line 187:	if (cp1 == NULL)
;
	TEST	ESI,ESI
	JE	SHORT	L_56
;
; Line 188:	break;
;
L_58:
;
; Line 189:	cp = cp1+1;
;
	MOV	EBX,ESI
	INC	EBX
L_55:
;
; Line 185:	while (TRUE)    {
;
	JMP	SHORT	L_57
L_56:
;
; Line 191:	strcpy(filespec, cp);
;
	PUSH	EBX
	PUSH	EDI
	CALL	_strcpy
	ADD	ESP,BYTE 08H
;
; Line 192:	}
;
L_51:
	POP	EDI
	POP	ESI
	POP	EBX
	POP	EBP
	RET
;
; Line 195:	static BOOL IncompleteFilename(char *s)
;
_IncompleteFilename:
	PUSH	EBP
	MOV	EBP,ESP
	PUSH	ESI
	PUSH	EDI
	MOV	ESI,DWORD [EBP+08H]
L_61:
;
; Line 196:	{
;
;
; Line 197:	int lc = strlen(s)-1;
;
	PUSH	ESI
	CALL	_strlen
	POP	ECX
	DEC	EAX
	MOV	EDI,EAX
;
; Line 198:	if (strchr(s, '?') || strchr(s, '*') || !*s)
;
	PUSH	BYTE 03FH
	PUSH	ESI
	CALL	_strchr
	ADD	ESP,BYTE 08H
	TEST	EAX,EAX
	JNE	SHORT	L_64
	PUSH	BYTE 02AH
	PUSH	ESI
	CALL	_strchr
	ADD	ESP,BYTE 08H
	TEST	EAX,EAX
	JNE	SHORT	L_64
	CMP	BYTE [ESI+00H],BYTE 00H
	JNE	SHORT	L_62
L_64:
;
; Line 199:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_60
L_62:
;
; Line 200:	if (*(s+lc) == ':' || *(s+lc) == '\\')
;
	MOVSX	EAX,BYTE [ESI+EDI+00H]
	CMP	EAX,BYTE 03AH
	JE	SHORT	L_67
	MOVSX	EAX,BYTE [ESI+EDI+00H]
	CMP	EAX,BYTE 05CH
	JNE	SHORT	L_65
L_67:
;
; Line 201:	return TRUE;
;
	MOV	EAX,01H
	JMP	SHORT	L_60
L_65:
;
; Line 202:	return FALSE;
;
	MOV	EAX,00H
L_60:
	POP	EDI
	POP	ESI
	POP	EBP
	RET
SECTION _BSS

_FileSpec	RESB	0FH
	RESB	01H

_SrchSpec	RESB	0FH
	RESB	01H

_FileName	RESB	0FH
SECTION _CONST

SECTION _TEXT
[EXTERN	_SaveAs]
[EXTERN	_BuildFileList]
[EXTERN	_chdir]
[EXTERN	_GetItemText]
[EXTERN	_strncpy]
[EXTERN	_BuildDriveList]
[EXTERN	_strlen]
[EXTERN	_DialogBox]
[EXTERN	_setdisk]
[EXTERN	_BuildPathDisplay]
[EXTERN	_CreatePath]
[EXTERN	_fnsplit]
[EXTERN	_ControlWindow]
[EXTERN	_FileOpen]
[EXTERN	_classdefs]
[EXTERN	_PutItemText]
[EXTERN	_SendMessage]
[EXTERN	_strcat]
[EXTERN	_strchr]
[EXTERN	_BuildDirectoryList]
[EXTERN	_GetDlgListText]
[EXTERN	_strcpy]
