2014-10-04 00:59:04 +00:00
|
|
|
; int _CType _FARFUNC _close( register int fd )
|
2014-11-05 17:20:02 +00:00
|
|
|
__rtl_close proc
|
2014-10-04 00:59:04 +00:00
|
|
|
@@fd = word ptr cPtrSize + 2
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
|
|
|
mov ah, 3Eh
|
|
|
|
mov bx, [bp+@@fd]
|
|
|
|
int 21h
|
|
|
|
jb short @@_closeFailed
|
|
|
|
add bx, bx
|
|
|
|
mov _openfd[bx], 0
|
|
|
|
xor ax, ax
|
|
|
|
jmp short @@_closeRet
|
|
|
|
|
|
|
|
@@_closeFailed:
|
|
|
|
push ax
|
|
|
|
call __IOERROR
|
|
|
|
|
|
|
|
@@_closeRet:
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
retf
|
|
|
|
__rtl_close endp
|
|
|
|
|
|
|
|
; int __cdecl _close(int fd)
|
2014-11-05 17:20:02 +00:00
|
|
|
__close proc
|
2014-10-04 00:59:04 +00:00
|
|
|
@@fd = word ptr cPtrSize + 2
|
|
|
|
|
|
|
|
push bp
|
|
|
|
mov bp, sp
|
|
|
|
push si
|
|
|
|
push di
|
|
|
|
push [bp+@@fd]
|
|
|
|
call __rtl_close
|
|
|
|
pop cx
|
|
|
|
pop di
|
|
|
|
pop si
|
|
|
|
pop bp
|
|
|
|
ret
|
|
|
|
__close endp
|