Can someone help me convert ASM to 86000 I do not know much about ASM and I need this this subroutine for the program I am working on.
This is a binary search subroutine if you didn't know :-)
Thank You
Input: term is the term being searched for
Array is the pointer to the array
Asize indicates the size of array in bytes
bsearch proc term

WORD,array

WORD,asize

WORD
mov eax,array
mov ecx,array
add ecx,asize
@@:
cmp eax,ecx
jg not_found
mov edx,eax
add edx,ecx
shr edx,1
xchg DWORD PTR [edx],eax
cmp eax,term
xchg DWORD PTR [edx],eax
jg search_right
jl search_left
mov eax,edx
sub eax,array
ret
search_right:
mov ecx,edx
jmp @B
search_left:
mov eax,edx
jmp @B
not_found:
mov eax,-1
ret
bsearch endp