	Title Del_Fil
	page ,132

;-------------------------------------------------------------------------

DATA	SEGMENT	PUBLIC	'DATA'
		DB	'del_fil '
SP_SAVE		DW	0
		DD	del_fil
		DD	0

DATA	ENDS

;-------------------------------------------------------------------------

;	PARAMETER LIST CONTROL BLOCK

FRAME	STRUC

	PARM1	DD	?	;OLD FILE (CHARACTER*80)
	PARM2	DD	?	;NEW FILE (CHARACTER*80)

FRAME	ENDS
;-------------------------------------------------------------------------


;-------------------CODE SEGMENT DEFINITION FOR PROFORT-------------------

CODE	SEGMENT	PARA	PUBLIC	'CODE'
	ASSUME	CS:CODE,DS:DATA			;required by RMFORT
	DW	SEG DATA			;required by RMFORT
;-------------------------------------------------------------------------
PUBLIC	del_fil
del_fil	PROC	FAR
	ASSUME	CS:CODE			;
	MOV	AX,DATA			;standard preamble, only CS,
	MOV	DS,AX			;SS, and SP must be maintained
	MOV	SP_SAVE,SP		;for PROFORT. Module address is

	LDS	SI,ES:PARM1[BX]
	MOV	DX,[SI+2]		;OFFSET OF FILE NAME INTO DX
	MOV	AX,[SI+4]		;SEGMENT OF FILE NAME INTO AX
	MOV	DS,AX

	MOV	AH,41H			;DELETE FILE
	INT	21H			;IF CARRY IS SET, AX=ERROR CODE

	JC	DELETE_ERROR

	LDS	SI,ES:PARM2[BX]		;GET ADDR OF ERROR
	MOV	WORD PTR [SI],0			;NO ERROR
	JMP	RETURN

DELETE_ERROR:
	LDS	SI,ES:PARM2[BX]
	MOV	[SI],AX			;SET ERROR


RETURN:	RET

del_fil	ENDP
;-------------------------------------------------------------------------

CODE	ENDS
	END
