home *** CD-ROM | disk | FTP | other *** search
- ;******************************************************************************
- ; Filename: CLOSE.ASM
- ; Author: Peter Andersson
- ; Version: 0.0
- ; Created: 1994.06.05
- ; Updated: 1994.09.20
- ;******************************************************************************
- ; Copyright Peter Andersson, 1994-1995.
- ; All rights reserved.
- ;******************************************************************************
- ; Function: LONG @close(LONG handle)
- ; Comment: Closes a file
- ; Input: Eax, handle - file handle
- ; Returns: -1 if an error occured or 0 if alright
- ;******************************************************************************
-
- Include STDDEF.INC
-
- Codeseg
-
- Proc close ,1
- Push Ebx
- Mov Ebx,Eax
- Mov Ah,3Eh
- Int 21h
- Jc @@Error
- Pop Ebx
- Clear Eax
- Ret
- Align 4
- @@Error: Mov [Word errno],Ax
- Ifdef DEBUG
- Call printf,Offset ErrCloseMsg,Bx,Ax
- Endif
- Pop Ebx
- Mov Eax,-1
- Ret
- Endp
-
- Dataseg
-
- IfDef DEBUG
- ErrCloseMsg Db "Error closing file with handle %h! Error: %h",LF,0
- Endif
-
- End