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
Question #2
UNO [17]

Explanation:

by staying late to help people aswell as being their and putting full effort into it

because the others arent helping they are only only just reminding

4 0
3 years ago
Read 2 more answers
Select the guidelines you should follow when creating a memo.
densk [106]

Answer:

Get to the point at the beginning of the memo.

Keep the paragraph lengths short.

At the end, inform the readers if there are specific actions they need to take.

Explanation:

6 0
3 years ago
Why does angular page look different after refresh.
alukav5142 [94]
Most of the web applications are written with SPA frameworks such as Angular, React, Vue.js, etc. The problem with these SPAs is that the single page is loaded in the browser once and then the framework will take care of all the routing among pages and gives the impression to the user that it is a multi-page application. When you refresh your page in the browser that single page called index.html is reloaded and you will lose the entire state of the application.
3 0
3 years ago
Formatting commands can be used to add number formats? True of false
Aleks04 [339]

Answer:

false

Explanation:

3 0
3 years ago
The _______ move the fabric forward in the machine. A. pressure plates B. zipper feet C. hem guides D. feed dogs
Lyrx [107]
The equipment that move the fabric forward are called "Hem guides"
8 0
4 years ago
Other questions:
  • The keyboard, mouse, trackpad, microphone, light pen, and voice recognition are examples of _____ devices.
    5·1 answer
  • Computer networks make setting appointments easier by _____.
    9·2 answers
  • The accessibility of a website refers to which of
    6·1 answer
  • Can anyone find any words in here?
    14·2 answers
  • You need to install an operating system on a computer that will be sharing files for the company employees. You estimate there w
    9·1 answer
  • Please help I really need it
    7·1 answer
  • <img src="https://tex.z-dn.net/?f=6.372%20%5Ctimes%2075%20find%20the%20product" id="TexFormula1" title="6.372 \times 75 find the
    6·1 answer
  • When you create names for the elements of a webpage (such as ), what are some rules that you can follow to make your HTML code e
    13·2 answers
  • hey guys just dropped some hot beats so go and follow me my user is the beats and comment if you would do that that would be gra
    11·1 answer
  • Using a wireless technology known as ___, many smartphones can now be tapped on special payment devices to complete your purchas
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!