]>
wirehaze git hosting - MS-DOS.git/blob - v4.0/src/MAPPER/CLOSE.ASM
4 title CP
/DOS DosClose mapper
* * *
6 dosxxx
segment byte public 'dos'
7 assume
cs:dosxxx
,ds:nothing
,es:nothing
,ss:nothing
9 ; ************************************************************************* *
13 ; * FUNCTION: This module will close a file or a device.
17 ; * PUSH WORD FileHandle ; File Handle or device handle
22 ; * IF ERROR (AX not = 0)
26 ; * o Invalid file handle
29 ; * MODULES CALLED: DOS int 21H function 3EH
32 ; *************************************************************************
43 FileHandle dw ?
; file or device handle
48 Enter DosClose
; push registers
50 ; Only files are closed. Devices are not closed, since OPEN creates
51 ; a dummy device handle without actually openning the device.
53 mov bx,[bp].FileHandle
; load the handle
54 mov ax,bx ; check for device handle
55 neg ax ; if device handle, return
56 jns GoodExit
; do not close the device
59 mov ax,03e00h ; load opcode
60 int 21h
; close the file
61 jc ErrorExit
; return if error
64 sub ax,ax ; else, set good return code
68 ret size
str - 6 ; return