home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Devil's Doorknob BBS Capture (1996-2003)
/
devilsdoorknobbbscapture1996-2003.iso
/
Dloads
/
PROGRAMM
/
CODE32.ZIP
/
INDXBYTE.RT
< prev
next >
Wrap
Text File
|
1993-01-09
|
732b
|
30 lines
public _indexbyte
;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
; Find a byte in a counted string and return index
; In:
; AL - byte to find
; EDX -> string of bytes, first byte is length
; Out:
; CF=1 - not found
; CF=0 - found
; EAX - index
;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
_indexbyte:
push edi
push ecx
lea edi,[edx+1]
movzx ecx,byte ptr [edx]
repnz scasb
jnz short indexbytef0
movzx eax,byte ptr [edx]
sub eax,ecx
dec eax
jmp short indexbytef1
indexbytef0:
stc
indexbytef1:
pop ecx
pop edi
ret