1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Vesna [10]
3 years ago
5

write an assembly language procedure that also performs the binary search. The C program will time multiple searches performed b

y both the C code and your assembly language procedure and compare the result. If all goes as expected, your assembly language procedure should be faster than the C code.

Computers and Technology
1 answer:
laiz [17]3 years ago
6 0

Answer:

Let’s identify variables needed for this program.

First variables will be the one which will hold the values present in the Given Numbers in Array list and key of 16-bit and it will be array ARR and KEY. variables will be holding the Messages MSG1 “KEY IS FOUND AT “, RES ”  POSITION”, 13, 10,” $” and MSG2 ‘KEY NOT FOUND!!!.$’ to be printed for the User. Other variables will be holding Length of the Array and it will be LEN, So in all Six variables.

The identified variables are ARR, KEY, LEN, RES, MSG1 and MSG2.

DATA SEGMENT

    ARR DW 0000H,1111H,2222H,3333H,4444H,5555H,6666H,7777H,8888H,9999H

    LEN DW ($-ARR)/2

    KEY EQU 7777H

    MSG1 DB "KEY IS FOUND AT "

    RES DB "  POSITION",13,10," $"

    MSG2 DB 'KEY NOT FOUND!!!.$'

DATA ENDS

CODE SEGMENT  

   ASSUME DS:DATA CS:CODE

START:

     MOV AX,DATA

     MOV DS,AX

   

     MOV BX,00

     MOV DX,LEN

     MOV CX,KEY

AGAIN: CMP BX,DX

      JA FAIL

      MOV AX,BX

      ADD AX,DX

      SHR AX,1

      MOV SI,AX

      ADD SI,SI

      CMP CX,ARR[SI]

      JAE BIG

      DEC AX

      MOV DX,AX

      JMP AGAIN

BIG:   JE SUCCESS

      INC AX

      MOV BX,AX

      JMP AGAIN

SUCCESS: ADD AL,01

        ADD AL,'0'

        MOV RES,AL

        LEA DX,MSG1

        JMP DISP

FAIL: LEA DX,MSG2

DISP: MOV AH,09H

     INT 21H

     

     MOV AH,4CH

     INT 21H      

CODE ENDS

END START

In this Assembly Language Programming, A single program is divided into four Segments which are 1. Data Segment, 2. Code Segment, 3. Stack Segment, and 4. Extra  Segment. Now, from these one is compulsory i.e. Code Segment if at all you don’t need variable(s) for your program.if you need variable(s) for your program you will need two Segments i.e. Code Segment and Data Segment.

Explanation:

The attached Logic is a C like Program to conduct a binary search we need small Algorithm Shown above in a very simple way, So Just we will covert the logic into Assembly There are many things uncommon in the programing Language. There are No While Loops or Modules but this things are to be implemented in different ways.

You might be interested in
What is a database query?
lana [24]
C.a form used to create a new tables for the database
8 0
2 years ago
Read 2 more answers
An accountant initially records adjusting entries in a(n) _____.
Alexus [3.1K]
Journal!
Adjusting entries are changes to journal entries you've already recorded.
4 0
3 years ago
__________________________would be involved in projects such as implementing security measures and software to protect systems a
defon

<u>Network Administrator</u><u>/Network Engineer</u> would be involved in projects such as implementing security measures and software to protect systems and information infrastructure, including firewalls and data-encryption programs.

<h3>What does an administrator of a network do?</h3>

The  network administrator is known to be a person who is involved in the day-to-day management of these networks is the responsibility of network and computer system administrators.

They function by helping to plan, set up, and provide maintenance for a company's computer systems, etc., for data communication.

Therefore, <u>Network Administrator</u><u>/Network Engineer</u> would be involved in projects such as implementing security measures and software to protect systems and information infrastructure, including firewalls and data-encryption programs.

Hence, option D is correct.

Learn more about Network Administrator from

brainly.com/question/5860806
#SPJ1

3 0
11 months ago
Every object in asequence container has a specific position.<br><br> a. True<br><br> b. False
Anastasy [175]

Answer: a)True

Explanation: A sequence container is a class which has the sequence of the objects present in it .By having the objects in a sequence it has a specific position that is given to the objects to keep them in a particular order .the sequence of objects can be like first object, second object , third object ...etc. Therefore the statement given is true that every object in a sequence container has a specific position.

5 0
3 years ago
A table cell contains _______ piece(s) of data.
Karolina [17]
A table cell contains one piece of data
3 0
3 years ago
Other questions:
  • Alicia is a dietitian. She gives other people suggestions for nutrition. She wants to organize a large amount of data concerning
    13·1 answer
  • The date June 10, 1960, is special because when it is written in the following format, the month times the day equals the year:
    5·1 answer
  • What output is displayed when the code that follows is executed? HashMap sales = new HashMap&lt;&gt;(); sales.put("January", 389
    12·1 answer
  • What statement best describes operating systems?
    12·1 answer
  • Su now wants to modify the text box that contains her numbered list. She accesses the Format Shape pane. In what ways can Su mod
    7·2 answers
  • An invisible path determining the way of travel from one place to another.
    10·1 answer
  • Which is NOT one of the basic characteristics of life? What feature of Microsoft
    5·1 answer
  • KAPWING Video Editing Software allows you to use existing You Tube Videos in your design.
    8·1 answer
  • Which of the following is the file type of Microsoft® Publisher files?
    12·2 answers
  • Question 5 of 10
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!