home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
BURKS 2
/
BURKS_AUG97.ISO
/
BURKS
/
SOFTWARE
/
LIBS
/
PMC101.ZIP
/
LIBSRC.ZIP
/
STRSTR.ASM
(
.txt
)
< prev
next >
Wrap
Assembly Source File
|
1994-06-14
|
966b
|
65 lines
.386p
locals
extrn STRLEN:near
public STRSTR
_TEXT segment byte public use32 'CODE'
assume cs:_TEXT
STRSTR:
push ebx esi edi
cld
mov edi,[esp+4+12+04h]
push edi
call STRLEN
or eax,eax
jz short @@00
mov ebx,eax
mov esi,[esp+4+12+00h]
push esi
call STRLEN
sub ebx,eax
jc short @@01
lea edx,[eax-1]
or eax,eax
mov eax,edi
jz short @@00
lodsb
@@01l:
mov ecx,ebx
jecxz short @@01
repne scasb
jne short @@01
mov ebx,ecx
mov ecx,edx
jecxz short @@02
push esi edi
repe cmpsb
pop edi esi
jne @@01l
@@02:
lea eax,[edi-1]
jmp short @@00
@@01:
xor eax,eax
@@00:
pop edi esi ebx
ret 08h
_TEXT ends
end