[Reduction] #519-520: intdos

This commit is contained in:
nmlgc 2014-10-02 17:54:48 +02:00
parent 399e6e3098
commit ef57ff6ae8
4 changed files with 96 additions and 312 deletions

93
libs/BorlandC/intdos.asm Normal file
View File

@ -0,0 +1,93 @@
; int __cdecl intdos(union REGS *inregs, union REGS *outregs)
_intdos proc DIST
@@segp = SREGS ptr -(size SREGS)
@@inregs = DPTR_ (dPtrSize + 2)
@@outregs = DPTR_ (dPtrSize + 2 + dPtrSize)
push bp
mov bp, sp
sub sp, size SREGS
push si
push di
push ss
lea ax, [bp+@@segp]
push ax
nopcall _segread
pop cx
pop cx
push ss
lea ax, [bp+@@segp]
push ax
push word ptr [bp+@@outregs+2]
push word ptr [bp+@@outregs]
push word ptr [bp+@@inregs+2]
push word ptr [bp+@@inregs]
call _intdosx
add sp, (dPtrSize * 2) + 4
pop di
pop si
mov sp, bp
pop bp
ret
_intdos endp
; int __cdecl intdosx(union REGS *inregs, union REGS *outregs, struct SREGS *segregs)
_intdosx proc DIST
@@inregs = DPTR_ (2 + dPtrSize)
@@outregs = DPTR_ (2 + dPtrSize + dPtrSize)
@@segregs = DPTR_ (2 + dPtrSize + dPtrSize + dPtrSize)
push bp
mov bp, sp
push si
push di
push ds
LDS_ si, [bp+@@segregs]
push [si+SREGS._es]
push [si+SREGS._ds]
LDS_ si, [bp+@@inregs]
mov ax, [si+WORDREGS._ax]
mov bx, [si+WORDREGS._bx]
mov cx, [si+WORDREGS._cx]
mov dx, [si+WORDREGS._dx]
mov di, [si+WORDREGS._di]
mov si, [si+WORDREGS._si]
pop ds
pop es
push bp
int 21h
pop bp
pushf
pushf
push si
push ds
push es
ife LDATA
mov ds, [bp-6]
endif
LDS_ si, [bp+@@segregs]
pop [si+SREGS._es]
pop [si+SREGS._ds]
LDS_ si, [bp+@@outregs]
pop [si+WORDREGS._si]
pop [si+WORDREGS._flags]
pop [si+WORDREGS._cflags]
and [si+WORDREGS._cflags], 1
mov [si+WORDREGS._di], di
mov [si+WORDREGS._dx], dx
mov [si+WORDREGS._cx], cx
mov [si+WORDREGS._bx], bx
mov [si+WORDREGS._ax], ax
pop ds
jz short @@intdosOK
push ax
push ax
call __IOERROR
pop ax
@@intdosOK:
pop di
pop si
pop bp
ret
_intdosx endp

View File

@ -4148,110 +4148,7 @@ include libs/BorlandC/cputype.asm
include libs/BorlandC/FARHEAP.ASM
include libs/BorlandC/fbrk.asm
include libs/BorlandC/int86.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl intdos(union REGS *inregs, union REGS *outregs)
_intdos proc far
segp = SREGS ptr -8
inregs = dword ptr 6
outregs = dword ptr 0Ah
push bp
mov bp, sp
sub sp, 8
push si
push di
push ss
lea ax, [bp+segp]
push ax ; segp
nopcall _segread
pop cx
pop cx
push ss
lea ax, [bp+segp]
push ax ; segregs
push word ptr [bp+outregs+2]
push word ptr [bp+outregs] ; outregs
push word ptr [bp+inregs+2]
push word ptr [bp+inregs] ; inregs
push cs
call near ptr _intdosx
add sp, 0Ch
pop di
pop si
mov sp, bp
pop bp
retf
_intdos endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl intdosx(union REGS *inregs, union REGS *outregs, struct SREGS *segregs)
_intdosx proc far
inregs = dword ptr 6
outregs = dword ptr 0Ah
segregs = dword ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
lds si, [bp+segregs]
push word ptr [si]
push word ptr [si+6]
lds si, [bp+inregs]
mov ax, [si]
mov bx, [si+2]
mov cx, [si+4]
mov dx, [si+6]
mov di, [si+0Ah]
mov si, [si+8]
pop ds
pop es
push bp
int 21h ; DOS -
pop bp
pushf
pushf
push si
push ds
push es
lds si, [bp+segregs]
pop word ptr [si]
pop word ptr [si+6]
lds si, [bp+outregs]
pop word ptr [si+8]
pop word ptr [si+0Eh]
pop word ptr [si+0Ch]
and word ptr [si+0Ch], 1
mov [si+0Ah], di
mov [si+6], dx
mov [si+4], cx
mov [si+2], bx
mov [si], ax
pop ds
jz short loc_36FE
push ax
push ax
call __IOERROR
pop ax
loc_36FE:
pop di
pop si
pop bp
retf
_intdosx endp
include libs/BorlandC/intdos.asm
include libs/BorlandC/ioctl.asm
include libs/BorlandC/signal.asm
include libs/BorlandC/access.asm

View File

@ -3850,110 +3850,7 @@ include libs/BorlandC/cputype.asm
include libs/BorlandC/FARHEAP.ASM
include libs/BorlandC/fbrk.asm
include libs/BorlandC/int86.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl intdos(union REGS *inregs, union REGS *outregs)
_intdos proc far
segp = SREGS ptr -8
inregs = dword ptr 6
outregs = dword ptr 0Ah
push bp
mov bp, sp
sub sp, 8
push si
push di
push ss
lea ax, [bp+segp]
push ax ; segp
nopcall _segread
pop cx
pop cx
push ss
lea ax, [bp+segp]
push ax ; segregs
push word ptr [bp+outregs+2]
push word ptr [bp+outregs] ; outregs
push word ptr [bp+inregs+2]
push word ptr [bp+inregs] ; inregs
push cs
call near ptr _intdosx
add sp, 0Ch
pop di
pop si
mov sp, bp
pop bp
retf
_intdos endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl intdosx(union REGS *inregs, union REGS *outregs, struct SREGS *segregs)
_intdosx proc far
inregs = dword ptr 6
outregs = dword ptr 0Ah
segregs = dword ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
lds si, [bp+segregs]
push word ptr [si]
push word ptr [si+6]
lds si, [bp+inregs]
mov ax, [si]
mov bx, [si+2]
mov cx, [si+4]
mov dx, [si+6]
mov di, [si+0Ah]
mov si, [si+8]
pop ds
pop es
push bp
int 21h ; DOS -
pop bp
pushf
pushf
push si
push ds
push es
lds si, [bp+segregs]
pop word ptr [si]
pop word ptr [si+6]
lds si, [bp+outregs]
pop word ptr [si+8]
pop word ptr [si+0Eh]
pop word ptr [si+0Ch]
and word ptr [si+0Ch], 1
mov [si+0Ah], di
mov [si+6], dx
mov [si+4], cx
mov [si+2], bx
mov [si], ax
pop ds
jz short loc_3766
push ax
push ax
call __IOERROR
pop ax
loc_3766:
pop di
pop si
pop bp
retf
_intdosx endp
include libs/BorlandC/intdos.asm
include libs/BorlandC/ioctl.asm
include libs/BorlandC/signal.asm
include libs/BorlandC/access.asm

View File

@ -7225,110 +7225,7 @@ _farcoreleft endp ; sp-analysis failed
include libs/BorlandC/FHEAPCHK.ASM
include libs/BorlandC/int86.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl intdos(union REGS *inregs, union REGS *outregs)
_intdos proc far
segp = SREGS ptr -8
inregs = dword ptr 6
outregs = dword ptr 0Ah
push bp
mov bp, sp
sub sp, 8
push si
push di
push ss
lea ax, [bp+segp]
push ax ; segp
nopcall _segread
pop cx
pop cx
push ss
lea ax, [bp+segp]
push ax ; segregs
push word ptr [bp+outregs+2]
push word ptr [bp+outregs] ; outregs
push word ptr [bp+inregs+2]
push word ptr [bp+inregs] ; inregs
push cs
call near ptr _intdosx
add sp, 0Ch
pop di
pop si
mov sp, bp
pop bp
retf
_intdos endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl intdosx(union REGS *inregs, union REGS *outregs, struct SREGS *segregs)
_intdosx proc far
inregs = dword ptr 6
outregs = dword ptr 0Ah
segregs = dword ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
lds si, [bp+segregs]
push word ptr [si]
push word ptr [si+6]
lds si, [bp+inregs]
mov ax, [si]
mov bx, [si+2]
mov cx, [si+4]
mov dx, [si+6]
mov di, [si+0Ah]
mov si, [si+8]
pop ds
pop es
push bp
int 21h ; DOS -
pop bp
pushf
pushf
push si
push ds
push es
lds si, [bp+segregs]
pop word ptr [si]
pop word ptr [si+6]
lds si, [bp+outregs]
pop word ptr [si+8]
pop word ptr [si+0Eh]
pop word ptr [si+0Ch]
and word ptr [si+0Ch], 1
mov [si+0Ah], di
mov [si+6], dx
mov [si+4], cx
mov [si+2], bx
mov [si], ax
pop ds
jz short loc_4D70
push ax
push ax
call __IOERROR
pop ax
loc_4D70:
pop di
pop si
pop bp
retf
_intdosx endp
include libs/BorlandC/intdos.asm
include libs/BorlandC/ioctl.asm
include libs/BorlandC/signal.asm
include libs/BorlandC/access.asm