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
Extension: Cash Register Program
Evgesh-ka [11]

Answer:

hee hee 4 you are correct

Explanation:

6 0
2 years ago
Quality answers will be appriciated! :)​
Naddika [18.5K]
<h2>1.</h2>

  1. F
  2. T
  3. T
  4. T
  5. F
  6. F
  7. T

________

<h2>2.</h2>

  1. A
  2. B
  3. D5*E5
  4. A

6 0
2 years ago
Read 2 more answers
How ICT has helped education to grow through progression?
Vsevolod [243]

Answer:

Hey there!

Explanation:

This is ur answer...

<em>ICTs can enhance the quality of education in several ways: by increasing learner motivation and engagement, by facilitating the acquisition of basic skills, and by enhancing teacher training. ICTs are also transformational tools which, when used appropriately, can promote the shift to a learner-centered </em><em>environment.</em>

Hope it helps!

Brainliest pls!

Have a good day!^^

6 0
1 year ago
Question 7 of 25
Vika [28.1K]

Explanation:

the right answer may be A.

5 0
2 years ago
Simple measurement questions, I'm on #5 right now but if you know any other ones that would be helpful (picture)
dangina [55]

Answer:

one inch=25.4

12 meters=13.12

10 quarts=9.46

12 milliliters=0.0004

400 pounds= 181 kg

25 meters/second=82

68F=20C

Explanation:

heres the full ones

one inch=25.4

12 meters=13.1234 yards

10 quarts=9.46353

12 milliliters=0.000405768

400 pounds=181.437

25m/s=82.021f/s

68f=20C

7 0
3 years ago
Other questions:
  • A company decides to create static design diagrams for an upcoming project. Which statement correctly describes the attribute of
    6·1 answer
  • Jim is a forensic specialist. He seized a suspect computer from a crime scene, removed the hard drive and bagged it, documented
    10·1 answer
  • Why should you not perform any personal grooming task while driving?
    5·2 answers
  • How are clustering and Network Load Balancing similar?
    13·1 answer
  • What is the advertising photographer’s main objective in creating an image?
    11·1 answer
  • You are given an array of integers, each with an unknown number of digits. You are also told the total number of digits of all t
    7·1 answer
  • Suppose that a computer can read or write a memory word in 5 nsec. Also suppose that when an interrupt occurs, all 32 CPU regist
    10·2 answers
  • 8. A sprite is a simple spider shaped thing with n legs coming out from a center point. The angle
    10·1 answer
  • Define the missing function. licenseNum is created as: (100000 * customID) licenseYear, where customID is a function parameter.
    12·1 answer
  • Please explain what steps you will take to prevent hackers from getting access to your personal information.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!