answersLogoWhite

0

BinarySearch proc ;params: array (of integers), length, target

push ebp

mov ebp, esp

mov ebx, [ebp + 8]

mov ecx, [ebp + 12]

xor edx, edx

dec ecx

jmp LoopCond

LoopStart:

mov eax, edx

add eax, ecx

shr eax, 1

push ecx

mov ecx, [ebp + 16]

cmp [eax * 4 + ebx], ecx

pop ecx

je Exit

jl UpperHalf

mov ecx, eax

dec ecx

jmp LoopCond

UpperHalf:

mov edx, eax

inc edx

LoopCond:

cmp ecx, edx

jge LoopStart

mov eax, -1

Exit:

pop ebp

ret

BinarySearch endp

User Avatar

Wiki User

17y ago

What else can I help you with?

Related Questions

How do you convert binary to hexadecimal using assembly language?

Well, honey, in assembly language, you convert binary to hexadecimal by grouping the binary digits into sets of four, then converting each group into its hexadecimal equivalent. You can use bitwise operations like shifting and masking to make the conversion process smoother. Just remember, in the end, hexadecimal is just a fancy way of saying "base 16."


How do you convert from assembly to binary in c plus plus?

Use inline assembly instructions. Then compile your C++ program to produce the machine code.


Write a program in 8086 assembly language that accepts two input characters pack two characters in one word and store them in consecutive locating in a memory buffer The first address of buffer is 400?

develop and test an assembly language to convert a two digit BCD number to binary


How does an assembly to binary converter work?

An assembly to binary converter works by translating assembly language instructions into binary code, which is the language that computers understand. Each assembly instruction is converted into a series of 1s and 0s that represent specific operations and data. This conversion process allows the computer to execute the instructions given in assembly language.


What is the name of the translator used by Assembly Language?

Assembly language does not use a traditional translator; instead, it uses an assembler to convert its mnemonics into machine code. The assembler translates the assembly instructions into binary code that the computer's CPU can understand and execute.


What are the two types of machine language?

1- Binary language 2- Assembly Language


Implementation of binary search algorithm using ASM assembler in 8086?

Hi, I hope this is useful http://www.indiastudychannel.com/projects/2748-Assembly-language-program-for-Binary-search.aspx good luck!


What the two types of machine?

1- Binary language 2- Assembly Language


What are two types of machines?

1- Binary language 2- Assembly Language


What is a computer program that converts assembly language into machine language?

A computer program that converts assembly language into machine language is called an assembler. The assembler translates the mnemonics and symbols used in assembly language into binary code that the computer's processor can execute. This process is essential for enabling programmers to write low-level code that is more understandable than raw machine language while still allowing the code to run efficiently on hardware.


How do you write a c program to convert binary to decimal by using while statement?

write a c++ program to convert binary number to decimal number by using while statement


Is Assembly-language programs are written using binary codes?

Assembly language allows the developer to have almost total control over what the sequence of instructions will be when a program executes. A compiler tries to translate a high level language such as C++ into a series of instructions, but a good assembly language programmer may be able to optimize the sequence when a compiler cannot. Primarily assembly language is used for speed and optimal machine code.


C program to receive floating point and convert it into binary?

scanf


Why is assembly language considered easier for humans to program than machine language?

Assembly is signficantly shorter and easier to remember than the equivilant machine instructions. Assembly instructions are human readable characters, for which a direct translation exists to the binary machine code instructions. Pseudo example: add <- assembly instruction 1010101010 <- machine instruction


What is the language of 0s and 1S?

The language of 0s and 1s is called binary which is internally used by the computer system for performing different activities. The other levels of languages such as high level languages, assembly language are internally converted into binary language for the processing by the computers.


Write a program of binary heap in c or c language?

to implement operations on binary heap in c


What is the code that was established so that all computers will be able to use the same binary code?

When you program a computer to do something then you use what is known as a higher level language. For the computer to run the program it must first convert your program into binary so the computer can do the work. That work is done by either sending an electrical signal or not sending an electrical signal through the computer. When the computer has finished running the program it then has to change the binary system it uses into the higher level language you use so you get the answer you want


Is a set of instructions or statements to the computer?

Computer language, or coding language, can be in a variety of different formats. These 'languages' may include C, C++, C#, Java, Ruby, Python, and others. Many of these languages are converted into binary code (the code that computers actually understand) before they are run. Binary code is not readable by humans, but computer languages are. That is why most people write instructions in a programming languages and then use another program to convert that code into binary.


How assembly language communicate with the CPU of any computer devices?

Assembly language code is the lowest-level form of programming before Machine code (binary), and each command in Assembler code directly references binary commands which tell the CPU what to do.


What are the characteristics of assembly language?

Assembly language is a low level language that uses mnemonics to represent each operation. Instead of using pure binary, like machine language does, these mnemonics allow for greater readibility and ease of understanding that binary does not. Additionally, an assembly language will have a set of data definitions that dictates where and how variables and their assigned data are stored.