[Reduction] #257: xfflush

This commit is contained in:
nmlgc 2014-08-28 21:54:04 +02:00
parent f0825bf2e5
commit 6ebf0877f7
17 changed files with 61 additions and 731 deletions

45
libs/BorlandC/xfflush.asm Normal file
View File

@ -0,0 +1,45 @@
; void _xfflush(void)
public __xfflush
__xfflush proc DIST
@@i = word ptr -(dPtrSize + 2)
@@fp = DPTR_ -(dPtrSize)
push bp
mov bp, sp
sub sp, dPtrSize + 2
push si
push di
mov [bp+@@i], 4
if LDATA
mov word ptr [bp+@@fp+2], ds
endif
mov word ptr [bp+@@fp], offset _streams
jmp short @@check_i
@@check_RDWR:
LES_ bx, [bp+@@fp]
test byte ptr ES_[bx+FILE.flags], 3
jz short @@advance
if LDATA
push word ptr [bp+@@fp+2]
endif
push bx
nopcall _fflush
pop cx
if LDATA
pop cx
endif
@@advance:
dec [bp+@@i]
add word ptr [bp+@@fp], size FILE
@@check_i:
cmp [bp+@@i], 0
jnz short @@check_RDWR
pop di
pop si
mov sp, bp
pop bp
ret
__xfflush endp

View File

@ -9809,52 +9809,7 @@ loc_57BA:
retf
__xfclose endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 0CAAh
jmp short loc_57FC
; ---------------------------------------------------------------------------
loc_57E0:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_57F5
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_57F5:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_57FC:
cmp [bp+var_6], 0
jnz short loc_57E0
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -9576,52 +9576,7 @@ loc_5A35:
retf
__xfclose endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 9FAh
jmp short loc_5A77
; ---------------------------------------------------------------------------
loc_5A5B:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_5A70
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_5A70:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_5A77:
cmp [bp+var_6], 0
jnz short loc_5A5B
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -13439,52 +13439,7 @@ loc_6EA8:
retf
__xfclose endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 1A56h
jmp short loc_6EEA
; ---------------------------------------------------------------------------
loc_6ECE:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_6EE3
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_6EE3:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_6EEA:
cmp [bp+var_6], 0
jnz short loc_6ECE
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -1527,47 +1527,7 @@ _setvbuf endp
include libs/BorlandC/_strlen.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc near
var_4 = word ptr -4
stream = word ptr -2
push bp
mov bp, sp
sub sp, 4
push si
push di
mov [bp+var_4], 4
mov [bp+stream], 2694h
jmp short loc_2151
; ---------------------------------------------------------------------------
loc_213C:
mov bx, [bp+stream]
test byte ptr [bx+2], 3
jz short loc_214A
push bx ; stream
call _fflush
pop cx
loc_214A:
dec [bp+var_4]
add [bp+stream], 10h
loc_2151:
cmp [bp+var_4], 0
jnz short loc_213C
pop di
pop si
mov sp, bp
pop bp
retn
__xfflush endp
include libs/BorlandC/xfflush.asm
; ---------------------------------------------------------------------------
db 0

View File

@ -8322,52 +8322,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 1490h
jmp short loc_6DF5
; ---------------------------------------------------------------------------
loc_6DD9:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_6DEE
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_6DEE:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_6DF5:
cmp [bp+var_6], 0
jnz short loc_6DD9
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -5009,52 +5009,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 84Ah
jmp short loc_51F5
; ---------------------------------------------------------------------------
loc_51D9:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_51EE
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_51EE:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_51F5:
cmp [bp+var_6], 0
jnz short loc_51D9
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -5288,52 +5288,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 0C60h
jmp short loc_5842
; ---------------------------------------------------------------------------
loc_5826:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_583B
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_583B:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_5842:
cmp [bp+var_6], 0
jnz short loc_5826
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -5364,52 +5364,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 0C1Ch
jmp short loc_5377
; ---------------------------------------------------------------------------
loc_535B:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_5370
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_5370:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_5377:
cmp [bp+var_6], 0
jnz short loc_535B
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -4703,52 +4703,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 0CD4h
jmp short loc_5245
; ---------------------------------------------------------------------------
loc_5229:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_523E
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_523E:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_5245:
cmp [bp+var_6], 0
jnz short loc_5229
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -5104,52 +5104,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 0B20h
jmp short loc_5527
; ---------------------------------------------------------------------------
loc_550B:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_5520
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_5520:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_5527:
cmp [bp+var_6], 0
jnz short loc_550B
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -6454,52 +6454,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 24E8h
jmp short loc_6783
; ---------------------------------------------------------------------------
loc_6767:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_677C
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_677C:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_6783:
cmp [bp+var_6], 0
jnz short loc_6767
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -4733,52 +4733,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 938h
jmp short loc_5CEB
; ---------------------------------------------------------------------------
loc_5CCF:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_5CE4
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_5CE4:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_5CEB:
cmp [bp+var_6], 0
jnz short loc_5CCF
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -5168,52 +5168,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 14FCh
jmp short loc_63AB
; ---------------------------------------------------------------------------
loc_638F:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_63A4
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_63A4:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_63AB:
cmp [bp+var_6], 0
jnz short loc_638F
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -6635,52 +6635,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 20C6h
jmp short loc_6AAF
; ---------------------------------------------------------------------------
loc_6A93:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_6AA8
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_6AA8:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_6AAF:
cmp [bp+var_6], 0
jnz short loc_6A93
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -5077,52 +5077,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 1808h
jmp short loc_61D7
; ---------------------------------------------------------------------------
loc_61BB:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_61D0
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_61D0:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_61D7:
cmp [bp+var_6], 0
jnz short loc_61BB
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================

View File

@ -4900,52 +4900,7 @@ include libs/BorlandC/_strlen.asm
include libs/BorlandC/strrchr.asm
include libs/BorlandC/write.asm
include libs/BorlandC/writea.asm
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
__xfflush proc far
var_6 = word ptr -6
stream = dword ptr -4
push bp
mov bp, sp
sub sp, 6
push si
push di
mov [bp+var_6], 4
mov word ptr [bp+stream+2], ds
mov word ptr [bp+stream], 2884h
jmp short loc_5FFB
; ---------------------------------------------------------------------------
loc_5FDF:
les bx, [bp+stream]
test byte ptr es:[bx+2], 3
jz short loc_5FF4
push word ptr [bp+stream+2]
push bx ; stream
nop
call _fflush
pop cx
pop cx
loc_5FF4:
dec [bp+var_6]
add word ptr [bp+stream], 14h
loc_5FFB:
cmp [bp+var_6], 0
jnz short loc_5FDF
pop di
pop si
mov sp, bp
pop bp
retf
__xfflush endp
include libs/BorlandC/xfflush.asm
; =============== S U B R O U T I N E =======================================