[Reduction] #219: memcmp

This commit is contained in:
nmlgc 2014-08-27 07:05:29 +02:00
parent 4f075e1718
commit 39bf07ac61
16 changed files with 66 additions and 616 deletions

36
libs/BorlandC/memcmp.asm Normal file
View File

@ -0,0 +1,36 @@
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
public _memcmp
_memcmp proc DIST
@@s1 = DPTR_ 2 + dPtrSize
@@s2 = DPTR_ 2 + (dPtrSize * 2)
@@n = word ptr 2 + (dPtrSize * 3)
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+@@n]
mov cx, ax
jcxz short @@mcm_end
LDS_ si, [bp+@@s1]
LES_ di, [bp+@@s2]
ife LDATA
mov ax, ds
mov es, ax
endif
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, ES_ [di-1]
xor ch, ch
@@mcm_end:
popDS_
sub ax, cx
pop di
pop si
pop bp
ret
_memcmp endp

View File

@ -8804,44 +8804,7 @@ loc_48DA:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_4901
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_4901:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -16507,9 +16470,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_8893

View File

@ -8683,45 +8683,7 @@ loc_4BBC:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
; sub_A240+4EP ...
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_4BE3
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_4BE3:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -16355,9 +16317,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_8B0E

View File

@ -12390,44 +12390,7 @@ loc_5F32:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
_s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_5F59
lds si, [bp+s1]
les di, [bp+_s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_5F59:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -20177,9 +20140,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_9F81

View File

@ -9268,44 +9268,7 @@ loc_66FF:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_6726
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_6726:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -16370,9 +16333,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_9E8C

View File

@ -5228,44 +5228,7 @@ loc_4AFF:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_4B26
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_4B26:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -12279,9 +12242,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_828C

View File

@ -5311,44 +5311,7 @@ loc_514C:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_5173
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_5173:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -12372,9 +12335,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_88D9

View File

@ -5557,44 +5557,7 @@ loc_4C81:
retf
sub_4C4C endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_4CA8
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_4CA8:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -12617,9 +12580,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_840E

View File

@ -4771,44 +4771,7 @@ loc_4B4F:
retf
sub_4B43 endp ; sp-analysis failed
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_4B76
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_4B76:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -11877,9 +11840,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_82DC

View File

@ -5190,44 +5190,7 @@ loc_4E31:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_4E58
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_4E58:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -12292,9 +12255,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_85BE

View File

@ -7800,44 +7800,7 @@ loc_608D:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_60B4
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_60B4:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -14905,9 +14868,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_981A

View File

@ -4683,44 +4683,7 @@ loc_55F5:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_561C
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_561C:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -11739,9 +11702,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_8D82

View File

@ -5296,44 +5296,7 @@ loc_5CB5:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_5CDC
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_5CDC:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -12399,9 +12362,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_9442

View File

@ -8186,44 +8186,7 @@ loc_63B9:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_63E0
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_63E0:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -15239,9 +15202,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_9B46

View File

@ -5462,44 +5462,7 @@ loc_5AE1:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_5B08
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_5B08:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -12516,9 +12479,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_926E

View File

@ -4978,44 +4978,7 @@ loc_5905:
retf
_getenv endp
; =============== S U B R O U T I N E =======================================
; Attributes: library function bp-based frame
; int __cdecl memcmp(const void *s1, const void *s2, size_t n)
_memcmp proc far
s1 = dword ptr 6
s2 = dword ptr 0Ah
n = word ptr 0Eh
push bp
mov bp, sp
push si
push di
push ds
mov ax, [bp+n]
mov cx, ax
jcxz short loc_592C
lds si, [bp+s1]
les di, [bp+s2]
cld
repe cmpsb
mov al, [si-1]
xor ah, ah
mov cl, es:[di-1]
xor ch, ch
loc_592C:
pop ds
sub ax, cx
pop di
pop si
pop bp
retf
_memcmp endp
include libs/BorlandC/memcmp.asm
; =============== S U B R O U T I N E =======================================
@ -11985,9 +11948,7 @@ arg_6 = word ptr 0Ch
push ax ; s2
push word ptr [bp+s1+2]
push word ptr [bp+s1] ; s1
nop
push cs
call near ptr _memcmp
nopcall _memcmp
add sp, 0Ah
or ax, ax
jz short loc_9092