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
Assignment RequirementsYou have been working as a technology associate in the information systems department at Corporation Tech
garik1379 [7]

Answer:

hola me llamos por mi nombre

Explanation:

me gusta la tegnologia

y no e trabajado xq soy estudiamte aun

7 0
3 years ago
What would be the most important data to access in the HRIS for the units and divisions of the MNE to determine feasible HR prog
12345 [234]

The most important data to access in the HRIS to determine feasible HR programs is <u>personnel cost</u>.

<h3>What is HRIS?</h3>

HRIS is an acronym for human resource information system and it can be defined as a software system that is designed and developed, so as to help a business firm to collect, manage, and store detailed data on its employees or workers.

Generally, the important data to access in the human resource information system (HRIS) system for the units and divisions of the multinational enterprise (MNE) to determine feasible HR programs is personnel cost because it would affect the total amount of money that would be spent in training them on how to use the latest technology in the market.

Read more on HRIS here: brainly.com/question/23264557

7 0
2 years ago
Some hardware can be added to the computer without having to restart or power down the computer. After a short period of time th
faltersainse [42]

Answer:

Plug and play technology

Explanation:

Plug and play technology also know as PnP allows user to directly connect devices to a computer and start using inmediatly. Other way user must have to search and install drivers for each component.

Usually PnP comes for regular use devices like: Keyboards, mouses, flashmemories, cameras, and others

8 0
3 years ago
What is the easiest way to ensure all of your computers include the newest Windows updates while still ensuring that those updat
levacccp [35]

Answer:

By Using WSUS(Windows Server Update Service).

Explanation:

Windows Server Update Services server (WSUS):-It was previously known as SUS(Software Update Services).It is a repository that is central on the same network on which we are present.It downloads and maintain latest updates for the computer from the Microsoft update server.

5 0
3 years ago
Use list indexing to print the last element of the list literal value.
AnnZ [28]

Answer:

print(["Not me", "Nor me", "Print me!"][2])

Explanation:

Given

print(["Not me", "Nor me", "Print me!"])

Required

Print last element of the list literal value

The implication of this question is to print "Print me!"

We start by analysing the given list.

The given list has 3 elements

But because indexing of a list starts from 0, the index of the last element will be 3 - 1 = 2

So, to print the last element, we simply direct the print statement to the last index.

This is done as follows

print(["Not me", "Nor me", "Print me!"][2])

The [2] shows that only the literal at the last index will be printed.

This means that the string "Print me!" will be printed.

The code can also be rewritten as follows

mylist = ["Not me", "Nor me", "Print me!"]

print(mylist[2])

Here, the first line stores the list in a variable.

The second line prints the last element of the list literal value which is "Print me!"

4 0
2 years ago
Other questions:
  • WILL MARK BRAILIEST IF ANSWERED FAST!!!
    8·1 answer
  • An array UnsortedInt consists of integers in random order. Another array SortedInt consists of a sorted list of integers.
    13·1 answer
  • What is NOT a good habit when presenting to an audience?
    5·2 answers
  • Which two encryption protocols might be used to provide secure transmissions for browser and web server communications?
    14·1 answer
  • Whats wrong with my code for .addEventListener
    11·1 answer
  • Write an algorithm and flowchart to calculate sum of two given numbers​
    13·1 answer
  • Implement a metho d to nd the k-th largest element in an array of size N using a minimum priority queue (MinPQ). Assume that the
    8·1 answer
  • Npesta kenos reaction
    13·2 answers
  • ¿por que hay peligros en internet?
    11·1 answer
  • A(n) _________ produces dynamic reports, supports alerts/rss functionality, and supports user subscriptions.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!