summaryrefslogtreecommitdiff
path: root/v4.0/src/MAPPER/DELETE.ASM
blob: c9dae66a1abff54cc5731448daa27895a2af40d2 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
;
page 80,132
;
title CP/DOS  DosDelete  mapper
;
dosxxx	segment byte public 'dos'
	assume	cs:dosxxx,ds:nothing,es:nothing,ss:nothing
;
; ************************************************************************* *
; *
; *	 MODULE: DosDelete
; *
; *	 FILE NAME: DOS012.ASM
; *
; *	 FUNCTION: This module removes a directory entry associated with a
; *		   filename.
; *
; *
; *	 CALLING SEQUENCE:
; *
; *		   PUSH@ ASCIIZ FileName  ;  FileName path
; *		   PUSH@ DWORD 0	  ;  Reserved (must be zero)
; *		   CALL  DosDelete
; *
; *	 RETURN SEQUENCE:
; *
; *		   IF ERROR (AX not = 0)
; *
; *		      AX = Error Code:
; *		      o   Invalid file path name
; *
; *	 MODULES CALLED:  DOS int 21H  function 41H
; *
; *
; *
; *************************************************************************

	public	DosDelete
	.sall
	.xlist
	include macros.inc
	.list

str	struc
old_bp	dw	?
return	dd	?
dtrm12	dd	?	; reserved, always 0
asc012	dd	?	; file name path pointer
str	ends

DosDelete  proc   far
	Enter	DosDelete		    ; push registers

	lds	dx,dword ptr [bp].asc012    ; file path name

	mov	ah,041h
	int	21h			    ; delete the file
	jc	err012			    ; jump if no error

	sub	ax,ax			    ; set good return code

err012:
	mexit				    ; pop registers
	ret	size str - 6		    ; return

DosDelete  endp

dosxxx	ends

	end