[Reduction] #511: segread

This commit is contained in:
nmlgc 2014-09-26 23:15:24 +02:00
parent bbf47ec102
commit 86b99b9265
5 changed files with 83 additions and 231 deletions

33
libs/BorlandC/regs.inc Normal file
View File

@ -0,0 +1,33 @@
BYTEREGS struc ; (sizeof=0x8, standard type)
_al db ?
_ah db ?
_bl db ?
_bh db ?
_cl db ?
_ch db ?
_dl db ?
_dh db ?
BYTEREGS ends
WORDREGS struc ; (sizeof=0x10, standard type)
_ax dw ?
_bx dw ?
_cx dw ?
_dx dw ?
_si dw ?
_di dw ?
_cflags dw ?
_flags dw ?
WORDREGS ends
REGS union ; (sizeof=0x10, standard type)
x WORDREGS ?
h BYTEREGS ?
REGS ends
SREGS struc ; (sizeof=0x8, standard type)
_es dw ?
_cs dw ?
_ss dw ?
_ds dw ?
SREGS ends

38
libs/BorlandC/segread.asm Normal file
View File

@ -0,0 +1,38 @@
; void __cdecl segread(struct SREGS *segp)
_segread proc DIST
@@segp = DPTR_ 2 + dPtrSize
push bp
mov bp, sp
push si
push di
if LDATA
mov bx, es
endif
LES_ si, [bp+@@segp]
if LDATA
mov es:[si], bx
else
mov [si]._es, es
endif
if LPROG
mov ax, [bp+4]
mov ES_[si]._cs, ax
else
mov ES_[si]._cs, cs
endif
mov word ptr ES_[si]._ss, ss
ifdef __HUGE__
mov ax, [bp+4]
mov ES_[si]._ds, ax
else
mov word ptr ES_[si]._ds, ds
endif
if LDATA
mov es, bx
endif
pop di
pop si
pop bp
ret
_segread endp

View File

@ -1,46 +1,3 @@
; ---------------------------------------------------------------------------
BYTEREGS struc ; (sizeof=0x8, standard type)
_al db ?
_ah db ?
_bl db ?
_bh db ?
_cl db ?
_ch db ?
_dl db ?
_dh db ?
BYTEREGS ends
; ---------------------------------------------------------------------------
WORDREGS struc ; (sizeof=0x10, standard type)
_ax dw ?
_bx dw ?
_cx dw ?
_dx dw ?
_si dw ?
_di dw ?
_cflag dw ?
_flags dw ?
WORDREGS ends
; ---------------------------------------------------------------------------
REGS union ; (sizeof=0x10, standard type)
x WORDREGS ?
h BYTEREGS ?
REGS ends
; ---------------------------------------------------------------------------
SREGS struc ; (sizeof=0x8, standard type)
_es dw ?
_cs dw ?
_ss dw ?
_ds dw ?
SREGS ends
; ;
; +-------------------------------------------------------------------------+ ; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) | ; | This file has been generated by The Interactive Disassembler (IDA) |
@ -77,6 +34,7 @@ SREGS ends
.model large .model large
include ReC98.inc include ReC98.inc
include libs/BorlandC/regs.inc
; =========================================================================== ; ===========================================================================
@ -3359,34 +3317,7 @@ include libs/BorlandC/newarray.asm
include libs/BorlandC/N_LXMUL.ASM include libs/BorlandC/N_LXMUL.ASM
include libs/BorlandC/N_PCMP.ASM include libs/BorlandC/N_PCMP.ASM
include libs/BorlandC/reada.asm include libs/BorlandC/reada.asm
include libs/BorlandC/segread.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; void __cdecl segread(struct SREGS *segp)
_segread proc far
segp = dword ptr 6
push bp
mov bp, sp
push si
push di
mov bx, es
les si, [bp+segp]
mov es:[si], bx
mov ax, [bp+4]
mov es:[si+2], ax
mov word ptr es:[si+4], ss
mov word ptr es:[si+6], ds
mov es, bx
pop di
pop si
pop bp
retf
_segread endp
include libs/BorlandC/setupio.asm include libs/BorlandC/setupio.asm
include libs/BorlandC/cconv.asm include libs/BorlandC/cconv.asm
include libs/BorlandC/toupper.asm include libs/BorlandC/toupper.asm
@ -4272,9 +4203,7 @@ outregs = dword ptr 0Ch
push ss push ss
lea ax, [bp+segp] lea ax, [bp+segp]
push ax ; segp push ax ; segp
nop nopcall _segread
push cs
call near ptr _segread
pop cx pop cx
pop cx pop cx
push ss push ss
@ -4406,9 +4335,7 @@ outregs = dword ptr 0Ah
push ss push ss
lea ax, [bp+segp] lea ax, [bp+segp]
push ax ; segp push ax ; segp
nop nopcall _segread
push cs
call near ptr _segread
pop cx pop cx
pop cx pop cx
push ss push ss

View File

@ -1,46 +1,3 @@
; ---------------------------------------------------------------------------
BYTEREGS struc ; (sizeof=0x8, standard type)
_al db ?
_ah db ?
_bl db ?
_bh db ?
_cl db ?
_ch db ?
_dl db ?
_dh db ?
BYTEREGS ends
; ---------------------------------------------------------------------------
WORDREGS struc ; (sizeof=0x10, standard type)
_ax dw ?
_bx dw ?
_cx dw ?
_dx dw ?
_si dw ?
_di dw ?
_cflag dw ?
_flags dw ?
WORDREGS ends
; ---------------------------------------------------------------------------
REGS union ; (sizeof=0x10, standard type)
x WORDREGS ?
h BYTEREGS ?
REGS ends
; ---------------------------------------------------------------------------
SREGS struc ; (sizeof=0x8, standard type)
_es dw ?
_cs dw ?
_ss dw ?
_ds dw ?
SREGS ends
; ;
; +-------------------------------------------------------------------------+ ; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) | ; | This file has been generated by The Interactive Disassembler (IDA) |
@ -76,6 +33,7 @@ SREGS ends
.model large .model large
include ReC98.inc include ReC98.inc
include libs/BorlandC/regs.inc
; =========================================================================== ; ===========================================================================
@ -3061,34 +3019,7 @@ include libs/BorlandC/newarray.asm
include libs/BorlandC/N_LXMUL.ASM include libs/BorlandC/N_LXMUL.ASM
include libs/BorlandC/N_PCMP.ASM include libs/BorlandC/N_PCMP.ASM
include libs/BorlandC/reada.asm include libs/BorlandC/reada.asm
include libs/BorlandC/segread.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; void __cdecl segread(struct SREGS *segp)
_segread proc far
segp = dword ptr 6
push bp
mov bp, sp
push si
push di
mov bx, es
les si, [bp+segp]
mov es:[si], bx
mov ax, [bp+4]
mov es:[si+2], ax
mov word ptr es:[si+4], ss
mov word ptr es:[si+6], ds
mov es, bx
pop di
pop si
pop bp
retf
_segread endp
include libs/BorlandC/setupio.asm include libs/BorlandC/setupio.asm
include libs/BorlandC/cconv.asm include libs/BorlandC/cconv.asm
include libs/BorlandC/toupper.asm include libs/BorlandC/toupper.asm
@ -3974,9 +3905,7 @@ outregs = dword ptr 0Ch
push ss push ss
lea ax, [bp+segp] lea ax, [bp+segp]
push ax ; segp push ax ; segp
nop nopcall _segread
push cs
call near ptr _segread
pop cx pop cx
pop cx pop cx
push ss push ss
@ -4108,9 +4037,7 @@ outregs = dword ptr 0Ah
push ss push ss
lea ax, [bp+segp] lea ax, [bp+segp]
push ax ; segp push ax ; segp
nop nopcall _segread
push cs
call near ptr _segread
pop cx pop cx
pop cx pop cx
push ss push ss

View File

@ -1,46 +1,3 @@
; ---------------------------------------------------------------------------
BYTEREGS struc ; (sizeof=0x8, standard type)
_al db ?
_ah db ?
_bl db ?
_bh db ?
_cl db ?
_ch db ?
_dl db ?
_dh db ?
BYTEREGS ends
; ---------------------------------------------------------------------------
WORDREGS struc ; (sizeof=0x10, standard type)
_ax dw ?
_bx dw ?
_cx dw ?
_dx dw ?
_si dw ?
_di dw ?
_cflags dw ?
_flags dw ?
WORDREGS ends
; ---------------------------------------------------------------------------
REGS union ; (sizeof=0x10, standard type)
x WORDREGS ?
h BYTEREGS ?
REGS ends
; ---------------------------------------------------------------------------
SREGS struc ; (sizeof=0x8, standard type)
_es dw ?
_cs dw ?
_ss dw ?
_ds dw ?
SREGS ends
; ;
; +-------------------------------------------------------------------------+ ; +-------------------------------------------------------------------------+
; | This file has been generated by The Interactive Disassembler (IDA) | ; | This file has been generated by The Interactive Disassembler (IDA) |
@ -102,6 +59,7 @@ SREGS ends
.model large .model large
include ReC98.inc include ReC98.inc
include libs/BorlandC/regs.inc
; =========================================================================== ; ===========================================================================
@ -5884,34 +5842,7 @@ loc_3673:
retn retn
__scantol endp __scantol endp
include libs/BorlandC/segread.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; void __cdecl segread(struct SREGS *segp)
_segread proc far
segp = dword ptr 6
push bp
mov bp, sp
push si
push di
mov bx, es
les si, [bp+segp]
mov es:[si], bx
mov ax, [bp+4]
mov es:[si+2], ax
mov word ptr es:[si+4], ss
mov word ptr es:[si+6], ds
mov es, bx
pop di
pop si
pop bp
retf
_segread endp
include libs/BorlandC/setupio.asm include libs/BorlandC/setupio.asm
include libs/BorlandC/cconv.asm include libs/BorlandC/cconv.asm
include libs/BorlandC/toupper.asm include libs/BorlandC/toupper.asm
@ -7349,9 +7280,7 @@ outregs = dword ptr 0Ch
push ss push ss
lea ax, [bp+segp] lea ax, [bp+segp]
push ax ; segp push ax ; segp
nop nopcall _segread
push cs
call near ptr _segread
pop cx pop cx
pop cx pop cx
push ss push ss
@ -7485,9 +7414,7 @@ outregs = dword ptr 0Ah
push ss push ss
lea ax, [bp+segp] lea ax, [bp+segp]
push ax ; segp push ax ; segp
nop nopcall _segread
push cs
call near ptr _segread
pop cx pop cx
pop cx pop cx
push ss push ss