]> wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/SFILEMOD.ASM

wirehaze git hosting

MZ is back!
[MS-DOS.git] / v4.0 / src / MAPPER / SFILEMOD.ASM
1 ;\ f\e0
2 page 80,132
3
4 title CP/DOS DosSetFileMode mapper
5
6 dosxxx segment byte public 'dos'
7 assume cs:dosxxx,ds:nothing,es:nothing,ss:nothing
8
9 ;**********************************************************************
10 ;*
11 ;* MODULE: dossetfilemode
12 ;*
13 ;* FUNCTION: Set file mode
14 ;*
15 ;* CALLING SEQUENCE:
16 ;*
17 ;* push@ asciiz file path name
18 ;* push word new attribute
19 ;* push dword reserved
20 ;* call dossetfilemode
21 ;*
22 ;* MODULES CALLED: PC-DOS Int 21h, ah=43h, change file mode
23 ;*
24 ;*********************************************************************
25
26 public dossetfilemode
27 .sall
28 .xlist
29 include macros.inc
30 .list
31
32
33 str struc
34 old_bp dw ?
35 return dd ?
36 Rsrvd dd ? ; reserved
37 Attrib dw ? ; file attribute
38 Path dd ? ; path name pointer pointer
39 str ends
40
41 dossetfilemode proc far
42 Enter dossetfilemode ; push registers
43
44 lds dx,[bp].path ; set pointer to path
45 mov cx,[bp].attrib
46
47 mov ax,4301h
48 int 21h ; change file mode
49 jc exit ; jump if error, return DOS error in ax
50
51 xor ax,ax ; set good return code
52 jmp short exit ; return
53
54 exit: mexit ; pop registers
55 ret size str - 6 ; return
56
57 dossetfilemode endp
58
59 dosxxx ends
60
61 end