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
kondor19780726 [428]
3 years ago
14

Write an x86_64 Assembly program that sorts a programmer-defined array. The size of the array and the address of the array shoul

d be passed to the called sort function via registers. You can choose the sorting algorithm to be implemented. A simple example would be Bubble Sort. Test using 5 or 10 elements. You know know how to print character digits, you may print the array before and/or after sorting to look at the contents of your array.
Computers and Technology
1 answer:
sashaice [31]3 years ago
5 0

Answer:

Check the explanation

Explanation:

Algorithm –

Load data from offset 500 to register CL (for count).

Travel from opening memory position to last and evaluate the two numbers if first number is bigger than second number then we will have to swap them.

First pass fix the position for last number.

Decrease the count by 1.

Again travel from opening memory position to (last-1, by help of count) and compare 2 numbers if second number is smaller than that of the first number then swap them.

Second pass fix the position for last two numbers.

Repeate.

Step by step Explanation –

MOV SI, 500: set the value of SI to 500.

MOV CL, [SI]: load data from offset SI to register CL.

DEC CL: decrease value of register CL BY 1.

MOV SI, 500: set the value of SI to 500.

MOV CH, [SI]: load data from offset SI to register CH.

DEC CH: decrease value of register CH BY 1.

INC SI: increase value of SI BY 1.

MOV AL, [SI]: load value from offset SI to register AL.

INC SI: increase value of SI BY 1.

CMP AL, [SI]: compares value of register AL and [SI] (AL-[SI]).

JC 41C: jump to address 41C if carry generated.

XCHG AL, [SI]: exchange the contents of register AL and SI.

DEC SI: decrease value of SI by 1.

XCHG AL, [SI]: exchange the contents of register AL and SI.

INC SI: increase value of SI by 1.

DEC CH: decrease value of register CH by 1.

JNZ 40F: jump to address 40F if zero flat reset.

DEC CL: decrease value of register CL by 1.

JNZ 407: jump to address 407 if zero flat reset.

HLT: stop.

You might be interested in
B) Use an Excel function to find: Note: No need to use Excel TABLES to answer these questions! 6. The average viewer rating of a
nydimaria [60]

Answer:

Use the average function for viewer ratings

Use the min function for the earliest airing year

Explanation:

The average function gives the minimum value in a set of data

The min function gives the lowest value in a set of data

4 0
3 years ago
What is the definition of a flowchart? *
hodyreva [135]

Answer:

A flowchart is simply a graphical representation of steps. It shows steps in sequential order and is widely used in presenting the flow of algorithms, workflow or processes. Typically, a flowchart shows the steps as boxes of various kinds, and their order by connecting them with arrows.

Explanation:

8 0
3 years ago
MICR is an input or output devices
Nataly [62]

Explanation:

If a device is putting data into the computer in the form of text, sound, images, button presses etc. then it is an input device, if the device is outputting things from the computer such as sound, movement, printing, images etc., then it is an output device. ... Therefore it is an input device.

8 0
3 years ago
How do u answer questions on brainly if ur on the app and on a phone. For me there is no answer button :(
Rudik [331]

Answer:

oh for me there is maybe try reloading?

Explanation:

8 0
3 years ago
Which of the following is used to allocate memory for the instance variables of an object of a class?1. the reserved word public
kodGreya [7K]

Answer:

The correct answer to the following question will be 2. the operator new.

Explanation:

New operator is used to allocating the memory to the instance object.The new object can be created by using a "new" keyword in java .

Syntax of using 'new' operator is :

class_name object_name=new class_name() // it allocated the memory to the class

For Example :

ABC obj = new ABC;  

Now, this time obj points to the object of the ABC class.

obj = new ABC ();

call the construction of ABC class

3 0
3 years ago
Other questions:
  • Write a program named TypingGrades that allows a user to enter a student’s number of words typed. The output is the letter grade
    9·1 answer
  • Explain the steps you take when conducting research online to ensure it the source is providing reliable information.
    6·1 answer
  • How would you determine if your earned credits would transfer to a regionally accredited school?
    14·2 answers
  • What is a digital certificate? Select one: a. It is a means of establishing the validity of an offer from a person, entity, web
    7·1 answer
  • In this section, you will use a stack to implement a program that checks if a string is balanced. Use the skeleton code provided
    5·1 answer
  • "Packet switches have multiple links attached to them. For each attached link the packet switch has a/an ____________, which sto
    7·1 answer
  • If I write too much for an exam answer, do I get downgraded?
    7·1 answer
  • When a support agent does not know the answer to a question, a good incident management strategy is to tell the user ____.
    5·1 answer
  • When adding new hardware, such as a printer, to a computer you often have to add associated software that allows the printer to
    6·1 answer
  • What are some of the characteristics found in an editorial photograph?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!