home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Unsorted BBS Collection
/
thegreatunsorted.tar
/
thegreatunsorted
/
programming
/
asm_programming
/
INDXWORD.RT
< prev
next >
Wrap
Text File
|
1993-01-09
|
733b
|
30 lines
public _indexword
;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
; Find a word (2bytes) in a counted list
; In:
; AX - word to find
; EDX -> string of words, first byte is length (in words)
; Out:
; CF=1 - not found
; CF=0 - found
; EAX - index
;░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
_indexword:
push edi
push ecx
lea edi,[edx+1]
movzx ecx,byte ptr [edx]
repnz scasw
jnz short indexwordf0
movzx eax,byte ptr [edx]
sub eax,ecx
dec eax
jmp short indexwordf1
indexwordf0:
stc
indexwordf1:
pop ecx
pop edi
ret