[Reduction] #492: unlink

This commit is contained in:
nmlgc 2014-09-07 19:01:21 +02:00
parent 9ed6e1e93f
commit 45f1b0d447
4 changed files with 33 additions and 117 deletions

27
libs/BorlandC/unlink.asm Normal file
View File

@ -0,0 +1,27 @@
; int __cdecl unlink(const char *path)
_unlink proc DIST
@@path = DPTR_ 2 + dPtrSize
push bp
mov bp, sp
push si
push di
pushDS_
mov ah, 41h
LDS_ dx, [bp+@@path]
int 21h
popDS_
jb short @@unlinkFailed
xor ax, ax
jmp short @@ret
@@unlinkFailed:
push ax
call __IOERROR
@@ret:
pop di
pop si
pop bp
ret
_unlink endp

View File

@ -3724,42 +3724,7 @@ _localeconv proc far
_localeconv endp
include libs/BorlandC/toupper.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl unlink(const char *path)
_unlink proc far
_path = dword ptr 6
push bp
mov bp, sp
push si
push di
push ds
mov ah, 41h ; 'A'
lds dx, [bp+_path]
int 21h ; DOS - 2+ - DELETE A FILE (UNLINK)
; DS:DX -> ASCIZ pathname of file to delete (no wildcards allowed)
pop ds
jb short loc_2765
xor ax, ax
jmp short loc_2769
; ---------------------------------------------------------------------------
loc_2765:
push ax
call __IOERROR
loc_2769:
pop di
pop si
pop bp
retf
_unlink endp
include libs/BorlandC/unlink.asm
; =============== S U B R O U T I N E =======================================
@ -5174,9 +5139,7 @@ loc_3CCA:
call __MKNAME
push dx
push ax ; path
nop
push cs
call near ptr _unlink
nopcall _unlink
pop cx
pop cx
les bx, [bp+stream]

View File

@ -3443,42 +3443,7 @@ _localeconv proc far
_localeconv endp
include libs/BorlandC/toupper.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl unlink(const char *path)
_unlink proc far
_path = dword ptr 6
push bp
mov bp, sp
push si
push di
push ds
mov ah, 41h ; 'A'
lds dx, [bp+_path]
int 21h ; DOS - 2+ - DELETE A FILE (UNLINK)
; DS:DX -> ASCIZ pathname of file to delete (no wildcards allowed)
pop ds
jb short loc_27CD
xor ax, ax
jmp short loc_27D1
; ---------------------------------------------------------------------------
loc_27CD:
push ax
call __IOERROR
loc_27D1:
pop di
pop si
pop bp
retf
_unlink endp
include libs/BorlandC/unlink.asm
; =============== S U B R O U T I N E =======================================
@ -4992,9 +4957,7 @@ loc_3DA2:
call __MKNAME
push dx
push ax ; path
nop
push cs
call near ptr _unlink
nopcall _unlink
pop cx
pop cx
les bx, [bp+stream]

View File

@ -6224,42 +6224,7 @@ _localeconv proc far
_localeconv endp
include libs/BorlandC/toupper.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl unlink(const char *path)
_unlink proc far
_path = dword ptr 6
push bp
mov bp, sp
push si
push di
push ds
mov ah, 41h ; 'A'
lds dx, [bp+_path]
int 21h ; DOS - 2+ - DELETE A FILE (UNLINK)
; DS:DX -> ASCIZ pathname of file to delete (no wildcards allowed)
pop ds
jb short loc_378D
xor ax, ax
jmp short loc_3791
; ---------------------------------------------------------------------------
loc_378D:
push ax
call __IOERROR
loc_3791:
pop di
pop si
pop bp
retf
_unlink endp
include libs/BorlandC/unlink.asm
; =============== S U B R O U T I N E =======================================
@ -8202,9 +8167,7 @@ loc_5322:
call __MKNAME
push dx
push ax ; path
nop
push cs
call near ptr _unlink
nopcall _unlink
pop cx
loc_5357: